66# include <avr/pgmspace.h>
67#elif defined(ESP8266) || defined(ESP32)
76# define pgm_read_byte(addr) (*(const unsigned char*)(addr))
79# define pgm_read_word(addr) (*(const unsigned short*)(addr))
82# define pgm_read_dword(addr) (*(const unsigned long*)(addr))
88#if !defined(__INT_MAX__) || (__INT_MAX__ > 0xFFFF)
89# define pgm_read_pointer(addr) ((void*)pgm_read_dword(addr))
91# define pgm_read_pointer(addr) ((void*)pgm_read_word(addr))
103 return gfxFont->
glyph + c;
121# define min(a, b) (((a) < (b)) ? (a) : (b))
125# define _swap_int16_t(a, b) \
171 int16_t steep = abs(y1 - y0) > abs(x1 - x0);
186 int16_t err = dx / 2;
195 for (; x0 <= x1; x0++) {
338 for (int16_t i = x; i < x + w; i++) {
372 }
else if (y0 == y1) {
398 int16_t ddF_y = -2 * r;
442 int16_t x0, int16_t y0, int16_t r, uint8_t cornername, uint16_t color)
446 int16_t ddF_y = -2 * r;
459 if (cornername & 0x4) {
463 if (cornername & 0x2) {
467 if (cornername & 0x8) {
471 if (cornername & 0x1) {
507 int16_t x0, int16_t y0, int16_t r, uint8_t corners, int16_t delta, uint16_t color)
512 int16_t ddF_y = -2 * r;
532 if (corners & 1)
writeFastVLine(x0 + x, y0 - y, 2 * y + delta, color);
533 if (corners & 2)
writeFastVLine(x0 - x, y0 - y, 2 * y + delta, color);
536 if (corners & 1)
writeFastVLine(x0 + py, y0 - px, 2 * px + delta, color);
537 if (corners & 2)
writeFastVLine(x0 - py, y0 - px, 2 * px + delta, color);
576 int16_t x, int16_t y, int16_t w, int16_t h, int16_t r, uint16_t color)
578 int16_t max_radius = ((w < h) ? w : h) / 2;
579 if (r > max_radius) r = max_radius;
606 int16_t x, int16_t y, int16_t w, int16_t h, int16_t r, uint16_t color)
608 int16_t max_radius = ((w < h) ? w : h) / 2;
609 if (r > max_radius) r = max_radius;
632 int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint16_t color)
652 int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint16_t color)
655 int16_t a, b, y, last;
687 int16_t dx01 = x1 - x0, dy01 = y1 - y0, dx02 = x2 - x0, dy02 = y2 - y0, dx12 = x2 - x1,
689 int32_t sa = 0, sb = 0;
702 for (y = y0; y <= last; y++) {
717 sa = (int32_t)dx12 * (y - y1);
718 sb = (int32_t)dx02 * (y - y0);
719 for (; y <= y2; y++) {
749 int16_t x, int16_t y,
const uint8_t bitmap[], int16_t w, int16_t h, uint16_t color)
752 int16_t byteWidth = (w + 7) / 8;
756 for (int16_t j = 0; j < h; j++, y++) {
757 for (int16_t i = 0; i < w; i++) {
783 int16_t x, int16_t y,
const uint8_t bitmap[], int16_t w, int16_t h, uint16_t color, uint16_t bg)
786 int16_t byteWidth = (w + 7) / 8;
790 for (int16_t j = 0; j < h; j++, y++) {
791 for (int16_t i = 0; i < w; i++) {
796 writePixel(x + i, y, (b & 0x80) ? color : bg);
815 int16_t x, int16_t y, uint8_t* bitmap, int16_t w, int16_t h, uint16_t color)
818 int16_t byteWidth = (w + 7) / 8;
822 for (int16_t j = 0; j < h; j++, y++) {
823 for (int16_t i = 0; i < w; i++) {
827 b = bitmap[j * byteWidth + i / 8];
849 int16_t x, int16_t y, uint8_t* bitmap, int16_t w, int16_t h, uint16_t color, uint16_t bg)
852 int16_t byteWidth = (w + 7) / 8;
856 for (int16_t j = 0; j < h; j++, y++) {
857 for (int16_t i = 0; i < w; i++) {
861 b = bitmap[j * byteWidth + i / 8];
862 writePixel(x + i, y, (b & 0x80) ? color : bg);
884 int16_t x, int16_t y,
const uint8_t bitmap[], int16_t w, int16_t h, uint16_t color)
887 int16_t byteWidth = (w + 7) / 8;
891 for (int16_t j = 0; j < h; j++, y++) {
892 for (int16_t i = 0; i < w; i++) {
918 int16_t x, int16_t y,
const uint8_t bitmap[], int16_t w, int16_t h)
921 for (int16_t j = 0; j < h; j++, y++) {
922 for (int16_t i = 0; i < w; i++) {
944 for (int16_t j = 0; j < h; j++, y++) {
945 for (int16_t i = 0; i < w; i++) {
968 int16_t x, int16_t y,
const uint8_t bitmap[],
const uint8_t mask[], int16_t w, int16_t h)
970 int16_t bw = (w + 7) / 8;
973 for (int16_t j = 0; j < h; j++, y++) {
974 for (int16_t i = 0; i < w; i++) {
1003 int16_t x, int16_t y, uint8_t* bitmap, uint8_t* mask, int16_t w, int16_t h)
1005 int16_t bw = (w + 7) / 8;
1008 for (int16_t j = 0; j < h; j++, y++) {
1009 for (int16_t i = 0; i < w; i++) {
1013 b = mask[j * bw + i / 8];
1034 int16_t x, int16_t y,
const uint16_t bitmap[], int16_t w, int16_t h)
1037 for (int16_t j = 0; j < h; j++, y++) {
1038 for (int16_t i = 0; i < w; i++) {
1059 for (int16_t j = 0; j < h; j++, y++) {
1060 for (int16_t i = 0; i < w; i++) {
1082 int16_t x, int16_t y,
const uint16_t bitmap[],
const uint8_t mask[], int16_t w, int16_t h)
1084 int16_t bw = (w + 7) / 8;
1087 for (int16_t j = 0; j < h; j++, y++) {
1088 for (int16_t i = 0; i < w; i++) {
1116 int16_t x, int16_t y, uint16_t* bitmap, uint8_t* mask, int16_t w, int16_t h)
1118 int16_t bw = (w + 7) / 8;
1121 for (int16_t j = 0; j < h; j++, y++) {
1122 for (int16_t i = 0; i < w; i++) {
1126 b = mask[j * bw + i / 8];
1151 int16_t x, int16_t y,
unsigned char c, uint16_t color, uint16_t bg, uint8_t size)
1153 drawChar(x, y, c, color, bg, size, size);
1171 int16_t x, int16_t y,
unsigned char c, uint16_t color, uint16_t bg, uint8_t size_x,
1179 ((x + 6 * size_x - 1) < 0) ||
1180 ((y + 8 * size_y - 1) < 0))
1183 if (!
_cp437 && (c >= 176)) c++;
1186 for (int8_t i = 0; i < 5; i++) {
1188 for (int8_t j = 0; j < 8; j++, line >>= 1) {
1190 if (size_x == 1 && size_y == 1)
1193 writeFillRect(x + i * size_x, y + j * size_y, size_x, size_y, color);
1194 }
else if (bg != color) {
1195 if (size_x == 1 && size_y == 1)
1198 writeFillRect(x + i * size_x, y + j * size_y, size_x, size_y, bg);
1203 if (size_x == 1 && size_y == 1)
1223 uint8_t xx, yy, bits = 0, bit = 0;
1224 int16_t xo16 = 0, yo16 = 0;
1226 if (size_x > 1 || size_y > 1) {
1250 for (yy = 0; yy < h; yy++) {
1251 for (xx = 0; xx < w; xx++) {
1256 if (size_x == 1 && size_y == 1) {
1260 x + (xo16 + xx) * size_x,
1261 y + (yo16 + yy) * size_y,
1287 }
else if (c !=
'\r') {
1301 }
else if (c !=
'\r') {
1306 if ((w > 0) && (h > 0)) {
1412 unsigned char c, int16_t* x, int16_t* y, int16_t* minx, int16_t* miny, int16_t* maxx,
1421 }
else if (c !=
'\r') {
1423 if ((c >= first) && (c <= last)) {
1433 y1 = *y + yo * tsy, x2 = x1 + gw * tsx - 1, y2 = y1 + gh * tsy - 1;
1434 if (x1 < *minx) *minx = x1;
1435 if (y1 < *miny) *miny = y1;
1436 if (x2 > *maxx) *maxx = x2;
1437 if (y2 > *maxy) *maxy = y2;
1448 }
else if (c !=
'\r') {
1455 if (x2 > *maxx) *maxx = x2;
1456 if (y2 > *maxy) *maxy = y2;
1457 if (*x < *minx) *minx = *x;
1458 if (*y < *miny) *miny = *y;
1478 const char* str, int16_t x, int16_t y, int16_t* x1, int16_t* y1, uint16_t* w, uint16_t* h)
1482 int16_t minx = 0x7FFF, miny = 0x7FFF, maxx = -1, maxy = -1;
1489 while ((c = *str++)) {
1492 charBounds(c, &x, &y, &minx, &miny, &maxx, &maxy);
1497 *w = maxx - minx + 1;
1501 *h = maxy - miny + 1;
1519 const String& str, int16_t x, int16_t y, int16_t* x1, int16_t* y1, uint16_t* w, uint16_t* h)
1521 if (str.length() != 0) {
1522 getTextBounds(
const_cast<char*
>(str.c_str()), x, y, x1, y1, w, h);
1540 const __FlashStringHelper* str, int16_t x, int16_t y, int16_t* x1, int16_t* y1, uint16_t* w,
1543 uint8_t *s = (uint8_t*)str, c;
1549 int16_t minx =
_width, miny =
_height, maxx = -1, maxy = -1;
1555 *w = maxx - minx + 1;
1559 *h = maxy - miny + 1;
1604 Adafruit_GFX* gfx, int16_t x, int16_t y, uint16_t w, uint16_t h, uint16_t outline,
1605 uint16_t fill, uint16_t textcolor,
char* label, uint8_t textsize)
1608 initButtonUL(gfx, x - (w / 2), y - (h / 2), w, h, outline, fill, textcolor, label, textsize);
1629 Adafruit_GFX* gfx, int16_t x, int16_t y, uint16_t w, uint16_t h, uint16_t outline,
1630 uint16_t fill, uint16_t textcolor,
char* label, uint8_t textsize_x, uint8_t textsize_y)
1664 Adafruit_GFX* gfx, int16_t x1, int16_t y1, uint16_t w, uint16_t h, uint16_t outline,
1665 uint16_t fill, uint16_t textcolor,
char* label, uint8_t textsize)
1667 initButtonUL(gfx, x1, y1, w, h, outline, fill, textcolor, label, textsize, textsize);
1688 Adafruit_GFX* gfx, int16_t x1, int16_t y1, uint16_t w, uint16_t h, uint16_t outline,
1689 uint16_t fill, uint16_t textcolor,
char* label, uint8_t textsize_x, uint8_t textsize_y)
1695 _outlinecolor = outline;
1697 _textcolor = textcolor;
1698 _textsize_x = textsize_x;
1699 _textsize_y = textsize_y;
1701 strncpy(_label, label, 9);
1715 uint16_t fill, outline, text;
1719 outline = _outlinecolor;
1723 outline = _outlinecolor;
1727 uint8_t r =
min(_w, _h) / 4;
1732 _x1 + (_w / 2) - (strlen(_label) * 3 * _textsize_x), _y1 + (_h / 2) - (4 * _textsize_y));
1735 _gfx->print(_label);
1749 return ((x >= _x1) && (x < (int16_t)(_x1 + _w)) && (y >= _y1) && (y < (int16_t)(_y1 + _h)));
1760 return (currstate && !laststate);
1771 return (!currstate && laststate);
1795const uint8_t
PROGMEM GFXcanvas1::GFXsetBit[] = {0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01};
1796const uint8_t
PROGMEM GFXcanvas1::GFXclrBit[] = {0x7F, 0xBF, 0xDF, 0xEF, 0xF7, 0xFB, 0xFD, 0xFE};
1809 uint32_t bytes = ((w + 7) / 8) * h;
1810 if ((
buffer = (uint8_t*)malloc(bytes))) {
1811 memset(
buffer, 0, bytes);
1836 if ((x < 0) || (y < 0) || (x >=
_width) || (y >=
_height))
return;
1856 uint8_t* ptr = &
buffer[(x / 8) + y * ((
WIDTH + 7) / 8)];
1864 *ptr |= 0x80 >> (x & 7);
1866 *ptr &= ~(0x80 >> (x & 7));
1915 if ((x < 0) || (y < 0) || (x >=
WIDTH) || (y >=
HEIGHT))
return 0;
1917 uint8_t* ptr = &
buffer[(x / 8) + y * ((
WIDTH + 7) / 8)];
1922 return ((*ptr) & (0x80 >> (x & 7))) != 0;
1938 memset(
buffer, color ? 0xFF : 0x00, bytes);
1964 if ((x < 0) || (x >=
width()) || (y >=
height()) || ((y + h - 1) < 0)) {
2019 if ((y < 0) || (y >=
height()) || (x >=
width()) || ((x + w - 1) < 0)) {
2027 if (x + w >=
width()) {
2065 int16_t row_bytes = ((
WIDTH + 7) / 8);
2066 uint8_t* ptr = &
buffer[(x / 8) + y * row_bytes];
2072 uint8_t bit_mask = (0x80 >> (x & 7));
2074 for (int16_t i = 0; i < h; i++) {
2082 uint8_t bit_mask = ~(0x80 >> (x & 7));
2084 for (int16_t i = 0; i < h; i++) {
2103 int16_t rowBytes = ((
WIDTH + 7) / 8);
2104 uint8_t* ptr = &
buffer[(x / 8) + y * rowBytes];
2105 size_t remainingWidthBits = w;
2110 uint8_t startByteBitMask = 0x00;
2111 for (int8_t i = (x & 7); ((i < 8) && (remainingWidthBits > 0)); i++) {
2115 startByteBitMask |= (0x80 >> i);
2117 remainingWidthBits--;
2120 *ptr |= startByteBitMask;
2122 *ptr &= ~startByteBitMask;
2129 if (remainingWidthBits > 0) {
2130 size_t remainingWholeBytes = remainingWidthBits / 8;
2131 size_t lastByteBits = remainingWidthBits % 8;
2132 uint8_t wholeByteColor = color > 0 ? 0xFF : 0x00;
2134 memset(ptr, wholeByteColor, remainingWholeBytes);
2136 if (lastByteBits > 0) {
2137 uint8_t lastByteBitMask = 0x00;
2138 for (
size_t i = 0; i < lastByteBits; i++) {
2142 lastByteBitMask |= (0x80 >> i);
2145 ptr += remainingWholeBytes;
2148 *ptr |= lastByteBitMask;
2150 *ptr &= ~lastByteBitMask;
2166 uint32_t bytes = w * h;
2167 if ((
buffer = (uint8_t*)malloc(bytes))) {
2168 memset(
buffer, 0, bytes);
2193 if ((x < 0) || (y < 0) || (x >=
_width) || (y >=
_height))
return;
2259 if ((x < 0) || (y < 0) || (x >=
WIDTH) || (y >=
HEIGHT))
return 0;
2301 if ((x < 0) || (x >=
width()) || (y >=
height()) || ((y + h - 1) < 0)) {
2358 if ((y < 0) || (y >=
height()) || (x >=
width()) || ((x + w - 1) < 0)) {
2366 if (x + w >=
width()) {
2406 for (int16_t i = 0; i < h; i++) {
2407 (*buffer_ptr) = color;
2408 buffer_ptr +=
WIDTH;
2438 uint32_t bytes = w * h * 2;
2439 if ((
buffer = (uint16_t*)malloc(bytes))) {
2440 memset(
buffer, 0, bytes);
2465 if ((x < 0) || (y < 0) || (x >=
_width) || (y >=
_height))
return;
2531 if ((x < 0) || (y < 0) || (x >=
WIDTH) || (y >=
HEIGHT))
return 0;
2547 uint8_t hi = color >> 8, lo = color & 0xFF;
2552 for (i = 0; i < pixels; i++)
buffer[i] = color;
2574 for (i = 0; i < pixels; i++)
buffer[i] = __builtin_bswap16(
buffer[i]);
2599 if ((x < 0) || (x >=
width()) || (y >=
height()) || ((y + h - 1) < 0)) {
2654 if ((y < 0) || (y >=
height()) || (x >=
width()) || ((x + w - 1) < 0)) {
2662 if (x + w >=
width()) {
2701 for (int16_t i = 0; i < h; i++) {
2702 (*buffer_ptr) = color;
2703 buffer_ptr +=
WIDTH;
2719 uint32_t buffer_index = y *
WIDTH + x;
2720 for (uint32_t i = buffer_index; i < buffer_index + w; i++) {
#define pgm_read_pointer(addr)
#define pgm_read_byte(addr)
#define _swap_int16_t(a, b)
#define pgm_read_word(addr)
uint8_t * pgm_read_bitmap_ptr(const GFXfont *gfxFont)
GFXglyph * pgm_read_glyph_ptr(const GFXfont *gfxFont, uint8_t c)
Adafruit SSD1306 dependency code.
Adafruit SSD1306 dependency code.
A generic graphics superclass that can handle all sorts of drawing. At a.
virtual void drawFastVLine(int16_t x, int16_t y, int16_t h, uint16_t color)
Draw a perfectly vertical line (this is often optimized in a subclass!)
void fillCircleHelper(int16_t x0, int16_t y0, int16_t r, uint8_t cornername, int16_t delta, uint16_t color)
Quarter-circle drawer with fill, used for circles and roundrects.
uint16_t textbgcolor
16-bit text color for print()
virtual void fillScreen(uint16_t color)
Fill the screen completely with one color. Update in subclasses if desired!
int16_t HEIGHT
This is the 'raw' display height - never changes.
int16_t width(void) const
Get width of the display, accounting for current rotation.
uint8_t rotation
Display rotation (0 thru 3)
void setTextSize(uint8_t s)
Set text 'magnification' size. Each increase in s makes 1 pixel that much bigger.
void drawCircleHelper(int16_t x0, int16_t y0, int16_t r, uint8_t cornername, uint16_t color)
Quarter-circle drawer, used to do circles and roundrects.
virtual void invertDisplay(bool i)
Invert the display (ideally using built-in hardware command)
void drawTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint16_t color)
Draw a triangle with no fill color.
int16_t height(void) const
Get height of the display, accounting for current rotation.
void fillTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint16_t color)
Draw a triangle with color-fill.
virtual void drawFastHLine(int16_t x, int16_t y, int16_t w, uint16_t color)
Draw a perfectly horizontal line (this is often optimized in a subclass!)
void setTextColor(uint16_t c)
Set text font color with transparant background.
virtual void writeFillRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color)
Write a rectangle completely with one color, overwrite in subclasses if startWrite is defined!
void fillCircle(int16_t x0, int16_t y0, int16_t r, uint16_t color)
Draw a circle with filled color.
void drawCircle(int16_t x0, int16_t y0, int16_t r, uint16_t color)
Draw a circle outline.
void charBounds(unsigned char c, int16_t *x, int16_t *y, int16_t *minx, int16_t *miny, int16_t *maxx, int16_t *maxy)
Helper to determine size of a character with current font/size. Broke this out as it's used by both t...
virtual void setRotation(uint8_t r)
Set rotation setting for display.
Adafruit_GFX(int16_t w, int16_t h)
Instatiate a GFX context for graphics! Can only be done by a superclass.
bool _cp437
If set, use correct CP437 charset (default is off)
void fillRoundRect(int16_t x0, int16_t y0, int16_t w, int16_t h, int16_t radius, uint16_t color)
Draw a rounded rectangle with fill color.
void drawBitmap(int16_t x, int16_t y, const uint8_t bitmap[], int16_t w, int16_t h, uint16_t color)
Draw a PROGMEM-resident 1-bit image at the specified (x,y) position, using the specified foreground c...
virtual void write(uint8_t)
Print one byte/character of data, used to support print()
bool wrap
If set, 'wrap' text at right edge of display.
uint16_t textcolor
16-bit background color for print()
int16_t cursor_x
x location to start print()ing text
void getTextBounds(const char *string, int16_t x, int16_t y, int16_t *x1, int16_t *y1, uint16_t *w, uint16_t *h)
Helper to determine size of a string with current font/size. Pass string and a cursor position,...
uint8_t textsize_x
Desired magnification in X-axis of text to print()
virtual void drawRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color)
Draw a rectangle with no fill color.
virtual void drawLine(int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint16_t color)
Draw a line.
virtual void fillRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color)
Fill a rectangle completely with one color. Update in subclasses if desired!
void drawXBitmap(int16_t x, int16_t y, const uint8_t bitmap[], int16_t w, int16_t h, uint16_t color)
Draw PROGMEM-resident XBitMap Files (*.xbm), exported from GIMP. Usage: Export from GIMP to *....
uint8_t textsize_y
Desired magnification in Y-axis of text to print()
virtual void startWrite(void)
Start a display-writing routine, overwrite in subclasses.
void setCursor(int16_t x, int16_t y)
Set text cursor location.
void setFont(const GFXfont *f=NULL)
Set the font to display when print()ing, either custom or default.
int16_t _width
Display width as modified by current rotation.
void drawRoundRect(int16_t x0, int16_t y0, int16_t w, int16_t h, int16_t radius, uint16_t color)
Draw a rounded rectangle with no fill color.
virtual void writePixel(int16_t x, int16_t y, uint16_t color)
Write a pixel, overwrite in subclasses if startWrite is defined!
void drawChar(int16_t x, int16_t y, unsigned char c, uint16_t color, uint16_t bg, uint8_t size)
Draw a single character.
virtual void drawPixel(int16_t x, int16_t y, uint16_t color)=0
Draw to the screen/framebuffer/etc. Must be overridden in subclass.
uint8_t getRotation(void) const
Get rotation setting for display.
int16_t _height
Display height as modified by current rotation.
virtual void endWrite(void)
End a display-writing routine, overwrite in subclasses if startWrite is defined!
virtual void writeFastHLine(int16_t x, int16_t y, int16_t w, uint16_t color)
Write a perfectly horizontal line, overwrite in subclasses if startWrite is defined!
int16_t WIDTH
This is the 'raw' display width - never changes.
virtual void writeFastVLine(int16_t x, int16_t y, int16_t h, uint16_t color)
Write a perfectly vertical line, overwrite in subclasses if startWrite is defined!
virtual void writeLine(int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint16_t color)
Write a line. Bresenham's algorithm - thx wikpedia.
int16_t cursor_y
y location to start print()ing text
void drawGrayscaleBitmap(int16_t x, int16_t y, const uint8_t bitmap[], int16_t w, int16_t h)
Draw a PROGMEM-resident 8-bit image (grayscale) at the specified (x,y) pos. Specifically for 8-bit di...
void drawRGBBitmap(int16_t x, int16_t y, const uint16_t bitmap[], int16_t w, int16_t h)
Draw a PROGMEM-resident 16-bit image (RGB 5/6/5) at the specified (x,y) position. For 16-bit display ...
GFXfont * gfxFont
Pointer to special font.
GFXcanvas16(uint16_t w, uint16_t h)
Instatiate a GFX 16-bit canvas context for graphics.
void drawFastRawHLine(int16_t x, int16_t y, int16_t w, uint16_t color)
Speed optimized horizontal line drawing into the raw canvas buffer.
uint16_t * buffer
Raster data: no longer private, allow subclass access.
~GFXcanvas16(void)
Delete the canvas, free memory.
void drawFastVLine(int16_t x, int16_t y, int16_t h, uint16_t color)
Speed optimized vertical line drawing.
void byteSwap(void)
Reverses the "endian-ness" of each 16-bit pixel within the canvas; little-endian to big-endian,...
void drawFastRawVLine(int16_t x, int16_t y, int16_t h, uint16_t color)
Speed optimized vertical line drawing into the raw canvas buffer.
uint16_t getPixel(int16_t x, int16_t y) const
Get the pixel color value at a given coordinate.
void drawFastHLine(int16_t x, int16_t y, int16_t w, uint16_t color)
Speed optimized horizontal line drawing.
void drawPixel(int16_t x, int16_t y, uint16_t color)
Draw a pixel to the canvas framebuffer.
void fillScreen(uint16_t color)
Fill the framebuffer completely with one color.
uint16_t getRawPixel(int16_t x, int16_t y) const
Get the pixel color value at a given, unrotated coordinate. This method is intended for hardware driv...
void drawPixel(int16_t x, int16_t y, uint16_t color)
Draw a pixel to the canvas framebuffer.
GFXcanvas1(uint16_t w, uint16_t h)
Instatiate a GFX 1-bit canvas context for graphics.
void drawFastVLine(int16_t x, int16_t y, int16_t h, uint16_t color)
Speed optimized vertical line drawing.
void drawFastRawVLine(int16_t x, int16_t y, int16_t h, uint16_t color)
Speed optimized vertical line drawing into the raw canvas buffer.
bool getRawPixel(int16_t x, int16_t y) const
void drawFastRawHLine(int16_t x, int16_t y, int16_t w, uint16_t color)
Speed optimized horizontal line drawing into the raw canvas buffer.
void drawFastHLine(int16_t x, int16_t y, int16_t w, uint16_t color)
Speed optimized horizontal line drawing.
~GFXcanvas1(void)
Delete the canvas, free memory.
bool getPixel(int16_t x, int16_t y) const
void fillScreen(uint16_t color)
Fill the framebuffer completely with one color.
uint8_t * buffer
Raster data: no longer private, allow subclass access.
~GFXcanvas8(void)
Delete the canvas, free memory.
uint8_t getRawPixel(int16_t x, int16_t y) const
Get the pixel color value at a given, unrotated coordinate. This method is intended for hardware driv...
GFXcanvas8(uint16_t w, uint16_t h)
Instatiate a GFX 8-bit canvas context for graphics.
void drawPixel(int16_t x, int16_t y, uint16_t color)
Draw a pixel to the canvas framebuffer.
uint8_t getPixel(int16_t x, int16_t y) const
Get the pixel color value at a given coordinate.
void drawFastRawHLine(int16_t x, int16_t y, int16_t w, uint16_t color)
Speed optimized horizontal line drawing into the raw canvas buffer.
void drawFastVLine(int16_t x, int16_t y, int16_t h, uint16_t color)
Speed optimized vertical line drawing.
void fillScreen(uint16_t color)
Fill the framebuffer completely with one color.
uint8_t * buffer
Raster data: no longer private, allow subclass access.
void drawFastRawVLine(int16_t x, int16_t y, int16_t h, uint16_t color)
Speed optimized vertical line drawing into the raw canvas buffer.
void drawFastHLine(int16_t x, int16_t y, int16_t w, uint16_t color)
Speed optimized horizontal line drawing.
Data stored for FONT AS A WHOLE.
uint16_t first
ASCII extents (first char)
uint8_t * bitmap
Glyph bitmaps, concatenated.
uint16_t last
ASCII extents (last char)
uint8_t yAdvance
Newline distance (y axis)
GFXglyph * glyph
Glyph array.
Font data stored PER GLYPH.
uint8_t width
Bitmap dimensions in pixels.
uint8_t height
Bitmap dimensions in pixels.
uint16_t bitmapOffset
Pointer into GFXfont->bitmap.
int8_t yOffset
Y dist from cursor pos to UL corner.
uint8_t xAdvance
Distance to advance cursor (x axis)
int8_t xOffset
X dist from cursor pos to UL corner.