diff options
Diffstat (limited to 'main/jpeg_decoder.c')
| -rw-r--r-- | main/jpeg_decoder.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/main/jpeg_decoder.c b/main/jpeg_decoder.c index 259af65..f2a7d92 100644 --- a/main/jpeg_decoder.c +++ b/main/jpeg_decoder.c @@ -70,12 +70,11 @@ esp_err_t jpeg_decoder_decode(size_t jpeg_len, jpeg_decode_cfg_t dec_cfg = { .output_format = JPEG_DECODE_OUT_FORMAT_RGB565, - .rgb_order = JPEG_DEC_RGB_ELEMENT_ORDER_RGB, - // TODO: known color bug on M5 — solid red renders correctly but solid - // green renders ~black and solid blue renders green. Likely a JPEG - // colorspace / channel-permutation issue, not a byte-order one - // (swapping to BGR turns red into blue, confirming RGB is the right - // element ordering). Needs follow-up. + // Empirically: _RGB emits the RGB565 word in big-endian byte order + // (red 0xF800 → bytes f8 00) which our LE uint16 painter reads + // swapped. _BGR emits little-endian to match (despite the + // misleading "BGR" name) — verified by the decode-byte dump. + .rgb_order = JPEG_DEC_RGB_ELEMENT_ORDER_BGR, .conv_std = JPEG_YUV_RGB_CONV_STD_BT601, }; |
