camera_model.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #ifndef CAMERA_MODEL_H
  2. #define CAMERA_MODEL_H
  3. #include <stdint.h>
  4. /**
  5. * The dithering algorithms available.
  6. */
  7. enum DitheringAlgorithm { FLOYD_STEINBERG, JARVIS_JUDICE_NINKE, STUCKI };
  8. class CameraModel {
  9. private:
  10. static CameraModel* instance;
  11. // Private constructor to prevent instantiation.
  12. CameraModel();
  13. /**
  14. * Flag to enable or disable dithering.
  15. */
  16. bool isDitheringDisabled;
  17. /**
  18. * Flag to represent the flash state when saving pictures to the Flipper.
  19. */
  20. bool isFlashEnabled;
  21. /**
  22. * Flag to invert pixel colors.
  23. */
  24. bool isInverted;
  25. /**
  26. * Flag to stop or start the stream.
  27. */
  28. bool isStreamEnabled;
  29. /**
  30. * Holds the currently selected dithering algorithm.
  31. */
  32. DitheringAlgorithm ditherAlgorithm;
  33. public:
  34. static CameraModel* getInstance();
  35. // Getter functions
  36. bool getIsDitheringDisabled();
  37. bool getIsFlashEnabled();
  38. bool getIsInverted();
  39. bool getIsStreamEnabled();
  40. DitheringAlgorithm getDitherAlgorithm();
  41. // Setter functions
  42. void setIsDitheringDisabled(bool value);
  43. void setIsFlashEnabled(bool value);
  44. void setIsInverted(bool value);
  45. void setIsStreamEnabled(bool value);
  46. void setDitherAlgorithm(DitheringAlgorithm value);
  47. };
  48. #endif