28 #ifndef _NANO_GFX_TYPES_H_ 29 #define _NANO_GFX_TYPES_H_ 36 #define min(a,b) ((a)<(b)?(a):(b)) 41 #define max(a,b) ((a)>(b)?(a):(b)) 85 void setPos(uint8_t x, uint8_t y);
110 return (((uint8_t)(x-lx)<w) || ((uint8_t)(lx-x)<w)) &&
111 (((uint8_t)(y-ly)<8) || ((uint8_t)(ly-
y)<8));
124 uint8_t right = ((x + w - 1)>>3);
125 uint8_t bottom = ((y + 7)>>3);
126 uint8_t left = x>>3; left = left < right ? left: 0;
127 uint8_t top = y>>3; top = top < bottom ? top: 0;
142 uint8_t right = (uint8_t)(lx + w - 1);
143 uint8_t bottom = (uint8_t)(ly + 7);
144 left = left < right ? left: 0;
145 top = top < bottom ? top: 0;
157 uint8_t left =
min(x,lx);
158 uint8_t top =
min(y,ly);
159 uint8_t right =
max((uint8_t)(x + w - 1), (uint8_t)(lx + w - 1));
160 if (((uint8_t)(lx + w - 1) < w) && (right > 2*w))
162 right = (uint8_t)(lx + w - 1);
164 uint8_t bottom =
max((uint8_t)(y + 7), (uint8_t)(ly + 7));
165 if (((uint8_t)(ly + 7) < 8) && (bottom > 16))
167 bottom = (uint8_t)(ly + 7);
169 if ( left > right ) left = 0;
170 if ( top > bottom ) top = 0;
177 #endif // _NANO_GFX_TYPES_H_
const uint8_t * data
Pointer to PROGMEM data, representing sprite image.
void setPos(uint8_t x, uint8_t y)
uint8_t y
draw position Y on the screen
SSD1306_RECT getUpdateRect() const
uint8_t x
draw position X on the screen
SSD1306_RECT getRect() const
uint8_t lx
last draw position X on the screen
uint8_t ly
last draw position Y on the screen
SSD1306_RECT getLRect() const