camera_model.h 1.3 KB

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