camera_model.h 1.3 KB

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