gds_image.h 889 B

1234567891011121314151617181920212223
  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 };
  7. #define GDS_IMAGE_TOP 0x00
  8. #define GDS_IMAGE_CENTER_X 0x01
  9. #define GDS_IMAGE_CENTER_Y 0x02
  10. #define GDS_IMAGE_CENTER (GDS_IMAGE_CENTER_X | GDS_IMAGE_CENTER_Y)
  11. #define GDS_IMAGE_FIT 0x10
  12. // Width and Height can be NULL if you already know them (actual scaling is closest ^2)
  13. uint16_t* GDS_DecodeJPEG(uint8_t *Source, int *Width, int *Height, float Scale);
  14. void GDS_GetJPEGSize(uint8_t *Source, int *Width, int *Height);
  15. void GDS_DrawRGB16( struct GDS_Device* Device, uint16_t *Image, int x, int y, int Width, int Height, int RGB_Mode );
  16. // set DisplayWidth and DisplayHeight to non-zero if you want autoscale to closest factor ^2 from 0..3
  17. bool GDS_DrawJPEG( struct GDS_Device* Device, uint8_t *Source, int x, int y, int Fit);