1
0
mirror of https://github.com/thooge/esp32-nmea2000-obp60.git synced 2026-08-18 18:32:30 +02:00

Fix image converter

This commit is contained in:
Norbert Walter
2026-02-28 16:42:37 +00:00
parent 0b3b5f387b
commit 7e35c250cd
2 changed files with 30 additions and 10 deletions
+27
View File
@@ -194,7 +194,34 @@ inline void drawMonochromeBitmap(
#endif
}
// helper for built-in OBP logo (400×300 mono bitmap)
inline void drawOBPLogo(int16_t x, int16_t y, uint16_t color) {
constexpr int LOGO_W = 400;
constexpr int LOGO_H = 300;
drawMonochromeBitmap(x, y,
gImage_Logo_OBP_400x300_sw,
LOGO_W, LOGO_H,
color,
/*vertical=*/false,
/*lsbFirst=*/false,
/*mirrorX=*/false);
}
// Display wrapper functions for E-Ink/TFT compatibility
// generic bitmap draw that accepts 1bit data; TFT version
// forwards to drawMonochromeBitmap whereas EPD uses native drawBitmap
inline void displayDrawBitmap(int16_t x, int16_t y,
const uint8_t *bmp,
int16_t w, int16_t h,
uint16_t color) {
#ifdef DISPLAY_ST7796
drawMonochromeBitmap(x, y, bmp, w, h, color);
#else
getdisplay().drawBitmap(x, y, bmp, w, h, color);
#endif
}
inline void displayFirstPage() {
#ifdef DISPLAY_ST7796
// TFT LCD doesn't need firstPage()
+3 -10
View File
@@ -397,16 +397,9 @@ void OBP60Task(GwApi *api){
displayNextPage(); // Fast Refresh
if(String(displaymode) == "Logo + QR Code" || String(displaymode) == "Logo"){
getdisplay().fillScreen(commonData.bgcolor);
// logo is 400×300 pixels regardless of physical display resolution
const int LOGO_W = 400;
const int LOGO_H = 300;
// bitmap is stored rowwise LSBoriented (adfruit generator), no vertical packing
drawMonochromeBitmap(0, 0, gImage_Logo_OBP_400x300_sw,
LOGO_W, LOGO_H,
commonData.fgcolor,
/*vertical=*/false,
/*lsbFirst=*/false,
/*mirrorX=*/false);
// draw the fixed-size logo via generic display wrapper
displayDrawBitmap(0, 0, gImage_Logo_OBP_400x300_sw,
400, 300, commonData.fgcolor);
displayNextPage(); // Fast Refresh
displayNextPage(); // Fast Refresh
delay(SHOW_TIME); // Logo show time