mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2025-12-08 20:47:08 +03:00
1st artwork version
This commit is contained in:
@@ -60,6 +60,10 @@ void GDS_Clear( struct GDS_Device* Device, int Color ) {
|
||||
}
|
||||
|
||||
void GDS_ClearWindow( struct GDS_Device* Device, int x1, int y1, int x2, int y2, int Color ) {
|
||||
// -1 means up to width/height
|
||||
if (x2 < 0) x2 = Device->Width - 1;
|
||||
if (y2 < 0) y2 = Device->Height - 1;
|
||||
|
||||
// driver can provide own optimized clear window
|
||||
if (Device->ClearWindow) {
|
||||
Device->ClearWindow( Device, x1, y1, x2, y2, Color );
|
||||
|
||||
@@ -218,8 +218,10 @@ bool GDS_DrawJPEG( struct GDS_Device* Device, uint8_t *Source, int x, int y, int
|
||||
|
||||
// then place it
|
||||
if (Fit & GDS_IMAGE_CENTER_X) Context.XOfs = (Device->Width + x - Context.Width) / 2;
|
||||
else if (Fit & GDS_IMAGE_RIGHT) Context.XOfs = Device->Width - Context.Width;
|
||||
if (Fit & GDS_IMAGE_CENTER_Y) Context.YOfs = (Device->Height + y - Context.Height) / 2;
|
||||
|
||||
else if (Fit & GDS_IMAGE_BOTTOM) Context.YOfs = Device->Height - Context.Height;
|
||||
|
||||
Context.XMin = x - Context.XOfs;
|
||||
Context.YMin = y - Context.YOfs;
|
||||
|
||||
|
||||
@@ -9,8 +9,11 @@ struct GDS_Device;
|
||||
|
||||
enum { GDS_RGB565, GDS_RGB555, GDS_RGB444 };
|
||||
|
||||
#define GDS_IMAGE_TOP 0x00
|
||||
#define GDS_IMAGE_LEFT 0x00
|
||||
#define GDS_IMAGE_CENTER_X 0x01
|
||||
#define GDS_IMAGE_RIGHT 0x04
|
||||
#define GDS_IMAGE_TOP 0x00
|
||||
#define GDS_IMAGE_BOTTOM 0x08
|
||||
#define GDS_IMAGE_CENTER_Y 0x02
|
||||
#define GDS_IMAGE_CENTER (GDS_IMAGE_CENTER_X | GDS_IMAGE_CENTER_Y)
|
||||
#define GDS_IMAGE_FIT 0x10
|
||||
|
||||
Reference in New Issue
Block a user