Hi creator(s) of MCUFRIEND_kbv,
This is quite a neat project!
Over the past few days I've been taking a look at some of the files in the examples folder of the this main branch, because I'm currently looking for a way of loading an image with it's pixel data on a Teensy 4.0 microntroller. This is the first GitHub project that has an example very simillar to what I'm looking for, and hence why the example file showBMP_not_Uno.ino caught my attention.
I'm a relative beginner with Arduino-based systems, and I noticed that this specific example is intended for a TFT touchscreen module, which is not exactly what I'm working on but it could be simillar.
I took a look at the code inside the showBMP_not_Uno.ino example, and I was looking for some clarification about how this works;
So it is my understanding that the showBMP function is responsible for most of the loading of the pixels of the image, and that you basically iterate through each one of the rows and collumns of the image, reading each one of the pixels, and attempting to get the respective colors of each pixel.
What I would like some clarification on, is where the lcdbuffer variable comes into play.
I notice that in the inner loop that iterates through the collumns of the image, increments it's tracker variable by the accured value of lcdbuffer after each loop iteration. I would assume that each pixel would be iterated through once, but here this incrementation is giving me the impression that you essentially treat multiple pixels as one, based off of how many pixels were put into lcdbuffer. Is this the correct way to think about this? Would it then be possible to essentially gather every single pixel in an image, without the use of lcdbuffer?
Another thing I would like some clarification on is the usage of the palette pointer variable.
From what I understand, a BMP image can have it's data saved into different format types, and one of those format types is having less than usual amounts of data in each pixel, and instead using a sort-of generalized color pattern that is applied globally to all the pixels in the image (please correct me if I'm wrong here, this is just me making educated guesses based off of what I can gather from the project and my own research).
I noticed that here in the your code, the pallete actually appears to be an array assigned for each collumn, and the palette appears to change for each collumn. Is that a fair way of interpreting how it works?
Another thing that I was likely going to look into is turning the image pixels into grayscale. I know that there are various formulas for converting color images into grayscale (such as this one), but that would only really work if I'm able to extract all the pixels out of an image...
Hi creator(s) of MCUFRIEND_kbv, This is quite a neat project!
Over the past few days I've been taking a look at some of the files in the
examples
folder of the this main branch, because I'm currently looking for a way of loading an image with it's pixel data on a Teensy 4.0 microntroller. This is the first GitHub project that has an example very simillar to what I'm looking for, and hence why the example fileshowBMP_not_Uno.ino
caught my attention.I'm a relative beginner with Arduino-based systems, and I noticed that this specific example is intended for a TFT touchscreen module, which is not exactly what I'm working on but it could be simillar.
I took a look at the code inside the
showBMP_not_Uno.ino
example, and I was looking for some clarification about how this works;So it is my understanding that the
showBMP
function is responsible for most of the loading of the pixels of the image, and that you basically iterate through each one of the rows and collumns of the image, reading each one of the pixels, and attempting to get the respective colors of each pixel.What I would like some clarification on, is where the
lcdbuffer
variable comes into play. I notice that in the inner loop that iterates through the collumns of the image, increments it's tracker variable by the accured value oflcdbuffer
after each loop iteration. I would assume that each pixel would be iterated through once, but here this incrementation is giving me the impression that you essentially treat multiple pixels as one, based off of how many pixels were put intolcdbuffer
. Is this the correct way to think about this? Would it then be possible to essentially gather every single pixel in an image, without the use oflcdbuffer
?Another thing I would like some clarification on is the usage of the
palette
pointer variable. From what I understand, a BMP image can have it's data saved into different format types, and one of those format types is having less than usual amounts of data in each pixel, and instead using a sort-of generalized color pattern that is applied globally to all the pixels in the image (please correct me if I'm wrong here, this is just me making educated guesses based off of what I can gather from the project and my own research). I noticed that here in the your code, the pallete actually appears to be an array assigned for each collumn, and the palette appears to change for each collumn. Is that a fair way of interpreting how it works?Another thing that I was likely going to look into is turning the image pixels into grayscale. I know that there are various formulas for converting color images into grayscale (such as this one), but that would only really work if I'm able to extract all the pixels out of an image...
Thank you for reading my posting! :)