mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2025-12-06 19:47:02 +03:00
VU bitmap is 8bits grayscale, not RGB332 - release
This commit is contained in:
@@ -215,13 +215,21 @@ void GDS_DrawRGB16( struct GDS_Device* Device, uint16_t *Image, int x, int y, in
|
||||
}
|
||||
|
||||
/****************************************************************************************
|
||||
* Simply draw a RGB 8 bits image (R:3,G:3,B:2)
|
||||
* Simply draw a RGB 8 bits image (R:3,G:3,B:2) or plain grayscale
|
||||
* monochrome (0.2125 * color.r) + (0.7154 * color.g) + (0.0721 * color.b)
|
||||
* grayscale (0.3 * R) + (0.59 * G) + (0.11 * B) )
|
||||
*/
|
||||
void GDS_DrawRGB8( struct GDS_Device* Device, uint8_t *Image, int x, int y, int Width, int Height ) {
|
||||
void GDS_DrawRGB8( struct GDS_Device* Device, uint8_t *Image, int x, int y, int Width, int Height, int RGB_Mode ) {
|
||||
if (Device->DrawRGB8) {
|
||||
Device->DrawRGB8( Device, Image, x, y, Width, Height );
|
||||
Device->DrawRGB8( Device, Image, x, y, Width, Height, RGB_Mode );
|
||||
} else if (RGB_Mode == GDS_GRAYSCALE) {
|
||||
// 8 bits pixels
|
||||
int Scale = 8 - Device->Depth;
|
||||
for (int r = 0; r < Height; r++) {
|
||||
for (int c = 0; c < Width; c++) {
|
||||
GDS_DrawPixel( Device, c + x, r + y, *Image++ >> Scale);
|
||||
}
|
||||
}
|
||||
} else if (Device->Depth < 3) {
|
||||
// 3 bits pixels to be placed
|
||||
int Scale = 3 - Device->Depth;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
struct GDS_Device;
|
||||
|
||||
enum { GDS_RGB565, GDS_RGB555, GDS_RGB444 };
|
||||
enum { GDS_RGB565, GDS_RGB555, GDS_RGB444, GDS_RGB332, GDS_GRAYSCALE };
|
||||
|
||||
// Fit options for GDS_DrawJPEG
|
||||
#define GDS_IMAGE_LEFT 0x00
|
||||
@@ -24,4 +24,4 @@ uint16_t* GDS_DecodeJPEG(uint8_t *Source, int *Width, int *Height, float Scale)
|
||||
void GDS_GetJPEGSize(uint8_t *Source, int *Width, int *Height);
|
||||
bool GDS_DrawJPEG( struct GDS_Device* Device, uint8_t *Source, int x, int y, int Fit);
|
||||
void GDS_DrawRGB16( struct GDS_Device* Device, uint16_t *Image, int x, int y, int Width, int Height, int RGB_Mode );
|
||||
void GDS_DrawRGB8( struct GDS_Device* Device, uint8_t *Image, int x, int y, int Width, int Height );
|
||||
void GDS_DrawRGB8( struct GDS_Device* Device, uint8_t *Image, int x, int y, int Width, int Height, int RGB_Mode );
|
||||
@@ -112,7 +112,7 @@ struct GDS_Device {
|
||||
void (*DrawBitmapCBR)(struct GDS_Device* Device, uint8_t *Data, int Width, int Height, int Color );
|
||||
// may provide for optimization
|
||||
void (*DrawRGB16)( struct GDS_Device* Device, uint16_t *Image,int x, int y, int Width, int Height, int RGB_Mode );
|
||||
void (*DrawRGB8)( struct GDS_Device* Device, uint8_t *Image, int x, int y, int Width, int Height );
|
||||
void (*DrawRGB8)( struct GDS_Device* Device, uint8_t *Image, int x, int y, int Width, int Height, int RGB_Mode );
|
||||
void (*ClearWindow)( struct GDS_Device* Device, int x1, int y1, int x2, int y2, int Color );
|
||||
|
||||
// interface-specific methods
|
||||
|
||||
Reference in New Issue
Block a user