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:
@@ -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 1‑bit 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()
|
||||
|
||||
@@ -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 row‑wise LSB‑oriented (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
|
||||
|
||||
Reference in New Issue
Block a user