_convert_images.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #ifndef IMAGES_H_
  2. #define IMAGES_H_
  3. #include <stdint.h>
  4. #include <stdbool.h>
  5. //----------------------------------------------------------------------------- ----------------------------------------
  6. typedef enum showMode {
  7. // {INV:--:WHT:BLK::--:--:CLR:SET}
  8. SHOW_SET_ = 0x01,
  9. SHOW_CLR_ = 0x02,
  10. SHOW_ALL_ = SHOW_SET_ | SHOW_CLR_,
  11. SHOW_BLK_ = 0x10,
  12. SHOW_WHT_ = 0x20,
  13. SHOW_NRM_ = 0x00,
  14. SHOW_INV_ = SHOW_BLK_ | SHOW_WHT_,
  15. SHOW_SET_BLK = SHOW_SET_ | SHOW_BLK_,
  16. SHOW_SET_WHT = SHOW_SET_ | SHOW_WHT_,
  17. SHOW_CLR_BLK = SHOW_CLR_ | SHOW_BLK_,
  18. SHOW_CLR_WHT = SHOW_CLR_ | SHOW_WHT_,
  19. SHOW_ALL = SHOW_ALL_ | SHOW_NRM_,
  20. SHOW_ALL_INV = SHOW_ALL_ | SHOW_INV_,
  21. } showMode_t;
  22. //----------------------------------------------------------------------------- ----------------------------------------
  23. typedef struct image {
  24. uint8_t w; // width
  25. uint8_t h; // height
  26. bool c; // compressed?
  27. uint16_t len; // image data length
  28. uint8_t tag; // rle tag
  29. uint8_t data[]; // image data
  30. } image_t;
  31. //----------------------------------------------------------------------------- ----------------------------------------
  32. //[TAG]
  33. //----------------------------------------------------------------------------- ----------------------------------------
  34. #ifndef IMGTEST
  35. #include <gui/gui.h>
  36. void show(
  37. Canvas* const canvas,
  38. const uint8_t tlx,
  39. const uint8_t tly,
  40. const image_t* img,
  41. const showMode_t mode);
  42. #endif
  43. #endif //IMAGES_H_