ERIS CORE

◆ getPixel()

uint16_t AppWren::getPixel ( int16_t  x,
int16_t  y 
)
inline

get a pixel from the render target

Parameters
x
y
Returns
uint16_t

Definition at line 424 of file AppWren.h.

424  {
425  if (x < 0 || y < 0) return ILI9341_MAGENTA;
426  if (draw){
427  if (has_pop){
428  if(y > SCREEN_HEIGHT || x > SCREEN_WIDTH) return ILI9341_MAGENTA;
429  return draw->getFrameBuffer()[(SCREEN_WIDTH * y)+x];
430  }else{
431  if (!surface_cache) return ILI9341_MAGENTA;
432  if (x >= surface_cache->getWidth()) return ILI9341_MAGENTA;
433  if (y >= surface_cache->getHeight()) return ILI9341_MAGENTA;
434 
436  }
437  }
438  return 0;
439  }
ILI9341_t3_ERIS * draw
Definition: AppBaseClass.h:41
Surface * surface_cache
Definition: AppWren.h:770
uint16_t readSurfacePixel(Surface *source, int16_t x, int16_t y)
reads the pixel data from the surface object note the data is packed in the 565 RGB format
uint16_t getHeight()
uint16_t getWidth()

References AppBaseClass::draw, Surface::getHeight(), Surface::getWidth(), AppBaseClass::has_pop, ILI9341_t3_ERIS::readSurfacePixel(), surface_cache, AppBaseClass::x, and AppBaseClass::y.

Referenced by getPixelCallback().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: