help modifying BMP_functions to display BMP with 16-bit color RGB555 #1029
-
I'd appreciate some pointers for modifying the code excerpt below...beyond the obvious initial check for color depth. I'm not clear on how to modify the padding, lineBuffer, and color conversion code. (I need to display a BMP that uses RGB555 mode...16 bits...whereas the library's "BMP_functions.ino" only recognizes 24 bit BMP format.) Thank you.
PS: FWIW, TFT_eSPI worked with the Adafruit ESP32 Feather and the Adafruit 3.5" TFT 320x480 w/ HXD8357D (their product ID 2050) with the following user_setup. I successfully ran the Colour_Test and TFT_SPIFFS_BMP examples (I converted the latter to littleFS).
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
Can you provide an image and the full/simplified sketch you have and I will see if I can get it to work. |
Beta Was this translation helpful? Give feedback.
-
Sure thing - thank you. Here's a zipped BMP with 16-bit 555 depth (drag/drop of the BMP itself didn't work...format not recognized). My test sketch is the following, together with your BMP_functions.ino in separate tab:
Also, in BMP_functions.ino, I changed bmpFS = SPIFFS.open(filename, "r"); Of course it fails with "BMP format not recognized" since the helper only takes 24-bit color (it works with the parrot.bmp from the example). If I was sufficiently skilled, I would have modified BMP_functions.ino to take either 24-bit or 16-bit and submitted a PR, but sadly... |
Beta Was this translation helpful? Give feedback.
-
This should work (note r,g,b and new c variables are now 16 bit):
|
Beta Was this translation helpful? Give feedback.
Sure thing - thank you. Here's a zipped BMP with 16-bit 555 depth (drag/drop of the BMP itself didn't work...format not recognized).
graph20190626.zip
My test sketch is the following, together with your BMP_functions.ino in separate tab: