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