cbm80amiga / ILI9341_Fast

Fast ILI9341 Arduino library optimized for AVR
GNU General Public License v3.0
37 stars 7 forks source link

Support for readPixel function? #2

Open hmarkl opened 3 years ago

hmarkl commented 3 years ago

Some TFT libraries support a "uint16_t readPixel(uint16_t x , uint16_t y )" function aimed at returning the color of the pixel at location (x,y). I appreciate that not all TFT controllers or shields support 2 ways communication so such a function may not always work but when it does work, it would be a great help on some programs. Is there any chance to have this function added to the ILI9341_Fast library?

cbm80amiga commented 3 years ago

If ILI9341 supports readPixel it could be possible, but I remember from other displays that such functionality is very slow and not useful for anything serious. If you need to modify frame buffer directly it is better to use MCU with much more RAM.

hmarkl commented 3 years ago

The ILI9341 controller does support the readPixel function. I eventually found 2 libraries with it: /1/ https://github.com/PaulStoffregen/ILI9341_t3 : Offers readPixel but not PushColors (only pushColor) /2/ https://marekburiak.github.io/ILI9341_due/ : Quite a fast library that supports both readPixel & pushColors.

I agree with you that readPixel is not a fast function, therefore I only use it for specific scenarios when this makes coding easier. The pushColors is nice/helpful to display bitmaps.

cbm80amiga commented 3 years ago

Instead slow pushColors I use drawImageF() and drawImage() for fast bitmap transfers.

hmarkl commented 3 years ago

Thanks for the advice!!! Have a great WE.