28 #ifndef _NANO_GFX_TYPES_H_ 29 #define _NANO_GFX_TYPES_H_ 35 #define min(a,b) ((a)<(b)?(a):(b)) 40 #define max(a,b) ((a)>(b)?(a):(b)) 44 #define RGB_COLOR8(r,g,b) ( (r & 0xE0) | ((g >> 3)&0x1C) | (b>>6) ) 47 #define RGB_COLOR16(r,g,b) ( ((r<<8) & 0xF800) | ((g << 3)&0x07E0) | (b>>3) ) 50 #define RGB8_TO_RGB16(c) ( (((uint16_t)c & 0b11100000) << 8) | \ 51 (((uint16_t)c & 0b00011100) << 6) | \ 52 (((uint16_t)c & 0b00000011) << 3) ) 55 #define RGB8_TO_GRAY4(rgb) ( (rgb >> 6) + ((rgb >> 2) & 0x07) + (rgb & 0x03) ) 58 #define GRAY_COLOR4(gray) ( ((gray >> 4) & 0x0F) | (gray & 0xF0) ) 61 #define RGB16_TO_RGB8(c) ( ((uint16_t)(c >> 8) & 0b11100000) | \ 62 ((uint16_t)(c >> 6) & 0b00011100) | \ 63 ((uint16_t)(c >> 3) & 0b00000011) ) 112 #ifdef CONFIG_SSD1306_UNICODE_ENABLE 169 void setPos(uint8_t x, uint8_t y);
194 return (((uint8_t)(x-lx)<w) || ((uint8_t)(lx-x)<w)) &&
195 (((uint8_t)(y-ly)<8) || ((uint8_t)(ly-
y)<8));
208 uint8_t right = ((x + w - 1)>>3);
209 uint8_t bottom = ((y + 7)>>3);
210 uint8_t left = x>>3; left = left < right ? left: 0;
211 uint8_t top = y>>3; top = top < bottom ? top: 0;
226 uint8_t right = (uint8_t)(lx + w - 1);
227 uint8_t bottom = (uint8_t)(ly + 7);
228 left = left < right ? left: 0;
229 top = top < bottom ? top: 0;
241 uint8_t left =
min(x,lx);
242 uint8_t top =
min(y,ly);
243 uint8_t right =
max((uint8_t)(x + w - 1), (uint8_t)(lx + w - 1));
244 if (((uint8_t)(lx + w - 1) < w) && (right > 2*w))
246 right = (uint8_t)(lx + w - 1);
248 uint8_t bottom =
max((uint8_t)(y + 7), (uint8_t)(ly + 7));
249 if (((uint8_t)(ly + 7) < 8) && (bottom > 16))
251 bottom = (uint8_t)(ly + 7);
253 if ( left > right ) left = 0;
254 if ( top > bottom ) top = 0;
261 #endif // _NANO_GFX_TYPES_H_
uint8_t height
char height in pixels
const uint8_t * data
Pointer to PROGMEM data, representing sprite image.
const uint8_t * primary_table
font chars bits
uint16_t start_code
unicode start code
const uint8_t * transparentMask
Pointer to PROGMEM data, representing sprite transparencyMask (can be nullptr)
void(* InitFunction)(void)
void setPos(uint8_t x, uint8_t y)
uint8_t y
draw position Y on the screen
uint8_t count
count of unicode chars in block
uint8_t width
char width in pixels
const uint8_t * secondary_table
font chars bits
SSD1306_RECT getUpdateRect() const
SFontHeaderRecord h
record, containing information on font
uint8_t x
draw position X on the screen
const uint8_t * glyph
char data, located in progmem.
SSD1306_RECT getRect() const
uint8_t spacing
additional spaces after char in pixels
uint8_t lx
last draw position X on the screen
uint8_t glyph_size
glyph size in bytes
uint8_t pages
height in pages (each page height is 8-pixels)
uint8_t count
count of characters
uint8_t ly
last draw position Y on the screen
SSD1306_RECT getLRect() const