From e0a1627fbaf15d6bdaa439e53c8f6fbf54dd1da1 Mon Sep 17 00:00:00 2001 From: Phil Howard Date: Tue, 13 Dec 2022 14:03:28 +0000 Subject: [PATCH] JPEGDEC/PicoGraphics: Add support for RGB888 target. Fixes https://github.com/pimoroni/pimoroni-pico/issues/573 --- micropython/modules/jpegdec/jpegdec.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/micropython/modules/jpegdec/jpegdec.cpp b/micropython/modules/jpegdec/jpegdec.cpp index f7b2b4c6..69a16e26 100644 --- a/micropython/modules/jpegdec/jpegdec.cpp +++ b/micropython/modules/jpegdec/jpegdec.cpp @@ -137,6 +137,9 @@ MICROPY_EVENT_POLL_HOOK // Dithered output to RGB332 current_graphics->set_pixel_dither({pDraw->x + x, pDraw->y + y}, (RGB565)(pDraw->pPixels[i])); } + } else if (current_graphics->pen_type == PicoGraphics::PEN_RGB888) { + current_graphics->set_pen(RGB((RGB565)pDraw->pPixels[i]).to_rgb888()); + current_graphics->pixel({pDraw->x + x, pDraw->y + y}); } else if (current_graphics->pen_type == PicoGraphics::PEN_P8 || current_graphics->pen_type == PicoGraphics::PEN_P4 || current_graphics->pen_type == PicoGraphics::PEN_3BIT) { current_graphics->set_pixel_dither({pDraw->x + x, pDraw->y + y}, RGB((RGB565)pDraw->pPixels[i])); } else {