color conversion of readRect() different from readPixel() for ILI9488 #3108
-
Hello -- vscode + PlatformIO driving an ILI9488 (DFR0669) on an ESP32-DevKitC-VIE, TFT_eSPI v2.5.33 When I use readPixel() it works fine, but when I use readRect() the colors seem wrong. Read frequency doesn't seem to be the issue (10MHz works for readPixel, even 5MHz doesn't work for readRect). I notice that in the code (judging by vscode highlighting based on #define variables), readPixel() for me comes to:
but readRect() comes to:
If I change the code to be like the readPixel version (just tft_Read_8() with no mask/shift) -- that fixes the problem and everything works as expected. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
seems like my issue #3081 I'll check later if your workaround works. |
Beta Was this translation helpful? Give feedback.
-
unfortunately that wasn't my case |
Beta Was this translation helpful? Give feedback.
-
readRect creates a bitmap with swapped bytes in the 16-bit colour value. It is intended to be used with pushRect, see here: https://github.com/Bodmer/TFT_eSPI/blob/master/TFT_eSPI.h#L600-L604 |
Beta Was this translation helpful? Give feedback.
-
Ah, thanks. I was thrown off by its use in the screen server example, but presumably the sketch on the other end of the Serial transmission is smart enough to adjust depending on whether it uses readPixel or readRect? Just as a side FR, since readRect is so much faster than readPixel for capturing a screen, I'll keep using my hacked version; it'd be nice to have a readRect (under whatever appropriate name) that works like readPixel (just another thing for the FR-to-consider list :-) ). |
Beta Was this translation helpful? Give feedback.
readRect creates a bitmap with swapped bytes in the 16-bit colour value. It is intended to be used with pushRect, see here:
https://github.com/Bodmer/TFT_eSPI/blob/master/TFT_eSPI.h#L600-L604