gds_image.h 1.1 KB

123456789101112131415161718192021222324252627
  1. #pragma once
  2. #include <stdint.h>
  3. #include "esp_err.h"
  4. // no progressive JPEG handling
  5. struct GDS_Device;
  6. enum { GDS_RGB565, GDS_RGB555, GDS_RGB444, GDS_RGB332, GDS_GRAYSCALE };
  7. // Fit options for GDS_DrawJPEG
  8. #define GDS_IMAGE_LEFT 0x00
  9. #define GDS_IMAGE_CENTER_X 0x01
  10. #define GDS_IMAGE_RIGHT 0x04
  11. #define GDS_IMAGE_TOP 0x00
  12. #define GDS_IMAGE_BOTTOM 0x08
  13. #define GDS_IMAGE_CENTER_Y 0x02
  14. #define GDS_IMAGE_CENTER (GDS_IMAGE_CENTER_X | GDS_IMAGE_CENTER_Y)
  15. #define GDS_IMAGE_FIT 0x10 // re-scale by a factor of 2^N (up to 3)
  16. // Width and Height can be NULL if you already know them (actual scaling is closest ^2)
  17. uint16_t* GDS_DecodeJPEG(uint8_t *Source, int *Width, int *Height, float Scale);
  18. void GDS_GetJPEGSize(uint8_t *Source, int *Width, int *Height);
  19. bool GDS_DrawJPEG( struct GDS_Device* Device, uint8_t *Source, int x, int y, int Fit);
  20. void GDS_DrawRGB16( struct GDS_Device* Device, uint16_t *Image, int x, int y, int Width, int Height, int RGB_Mode );
  21. void GDS_DrawRGB8( struct GDS_Device* Device, uint8_t *Image, int x, int y, int Width, int Height, int RGB_Mode );