F439_CPP_SPI_RA8875_TFT_LCD_03 1.0
STM32F439 SPI RA8875 7-inch TFT display demo built on the STM32_GFX and STM32_RA8875 libraries
Loading...
Searching...
No Matches
Adafruit_GFX.h
1#ifndef _ADAFRUIT_GFX_H
2#define _ADAFRUIT_GFX_H
3
5#include "Print.h"
6#include "gfxfont.h"
7
11class Adafruit_GFX : public Print {
12
13public:
14 Adafruit_GFX(int16_t w, int16_t h); // Constructor
15
16 /**********************************************************************/
24 /**********************************************************************/
25 virtual void drawPixel(int16_t x, int16_t y, uint16_t color) = 0;
26
27 // TRANSACTION API / CORE DRAW API
28 // These MAY be overridden by the subclass to provide device-specific
29 // optimized code. Otherwise 'generic' versions are used.
30 virtual void startWrite(void);
31 virtual void writePixel(int16_t x, int16_t y, uint16_t color);
32 virtual void writeFillRect(int16_t x, int16_t y, int16_t w, int16_t h,
33 uint16_t color);
34 virtual void writeFastVLine(int16_t x, int16_t y, int16_t h, uint16_t color);
35 virtual void writeFastHLine(int16_t x, int16_t y, int16_t w, uint16_t color);
36 virtual void writeLine(int16_t x0, int16_t y0, int16_t x1, int16_t y1,
37 uint16_t color);
38 virtual void endWrite(void);
39
40 // CONTROL API
41 // These MAY be overridden by the subclass to provide device-specific
42 // optimized code. Otherwise 'generic' versions are used.
43 virtual void setRotation(uint8_t r);
44 virtual void invertDisplay(bool i);
45
46 // BASIC DRAW API
47 // These MAY be overridden by the subclass to provide device-specific
48 // optimized code. Otherwise 'generic' versions are used.
49
50 // It's good to implement those, even if using transaction API
51 virtual void drawFastVLine(int16_t x, int16_t y, int16_t h, uint16_t color);
52 virtual void drawFastHLine(int16_t x, int16_t y, int16_t w, uint16_t color);
53 virtual void fillRect(int16_t x, int16_t y, int16_t w, int16_t h,
54 uint16_t color);
55 virtual void fillScreen(uint16_t color);
56 // Optional and probably not necessary to change
57 virtual void drawLine(int16_t x0, int16_t y0, int16_t x1, int16_t y1,
58 uint16_t color);
59 virtual void drawRect(int16_t x, int16_t y, int16_t w, int16_t h,
60 uint16_t color);
61
62 // These exist only with Adafruit_GFX (no subclass overrides)
63 void drawCircle(int16_t x0, int16_t y0, int16_t r, uint16_t color);
64 void drawCircleHelper(int16_t x0, int16_t y0, int16_t r, uint8_t cornername,
65 uint16_t color);
66 void fillCircle(int16_t x0, int16_t y0, int16_t r, uint16_t color);
67 void fillCircleHelper(int16_t x0, int16_t y0, int16_t r, uint8_t cornername,
68 int16_t delta, uint16_t color);
69 void drawEllipse(int16_t x0, int16_t y0, int16_t rw, int16_t rh,
70 uint16_t color);
71 void fillEllipse(int16_t x0, int16_t y0, int16_t rw, int16_t rh,
72 uint16_t color);
73 void drawTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2,
74 int16_t y2, uint16_t color);
75 void fillTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2,
76 int16_t y2, uint16_t color);
77 void drawRoundRect(int16_t x0, int16_t y0, int16_t w, int16_t h,
78 int16_t radius, uint16_t color);
79 void fillRoundRect(int16_t x0, int16_t y0, int16_t w, int16_t h,
80 int16_t radius, uint16_t color);
81 void drawRotatedRect(int16_t cenX, int16_t cenY, int16_t w, int16_t h,
82 int16_t angleDeg, uint16_t color);
83 void fillRotatedRect(int16_t cenX, int16_t cenY, int16_t w, int16_t h,
84 int16_t angleDeg, uint16_t color);
85 void rotatePoint(int16_t &x0, int16_t &y0, int16_t angleDeg);
86 void drawBitmap(int16_t x, int16_t y, const uint8_t bitmap[], int16_t w,
87 int16_t h, uint16_t color);
88 void drawBitmap(int16_t x, int16_t y, const uint8_t bitmap[], int16_t w,
89 int16_t h, uint16_t color, uint16_t bg);
90 void drawBitmap(int16_t x, int16_t y, uint8_t *bitmap, int16_t w, int16_t h,
91 uint16_t color);
92 void drawBitmap(int16_t x, int16_t y, uint8_t *bitmap, int16_t w, int16_t h,
93 uint16_t color, uint16_t bg);
94 void drawXBitmap(int16_t x, int16_t y, const uint8_t bitmap[], int16_t w,
95 int16_t h, uint16_t color);
96 void drawGrayscaleBitmap(int16_t x, int16_t y, const uint8_t bitmap[],
97 int16_t w, int16_t h);
98 void drawGrayscaleBitmap(int16_t x, int16_t y, uint8_t *bitmap, int16_t w,
99 int16_t h);
100 void drawGrayscaleBitmap(int16_t x, int16_t y, const uint8_t bitmap[],
101 const uint8_t mask[], int16_t w, int16_t h);
102 void drawGrayscaleBitmap(int16_t x, int16_t y, uint8_t *bitmap, uint8_t *mask,
103 int16_t w, int16_t h);
104 void drawRGBBitmap(int16_t x, int16_t y, const uint16_t bitmap[], int16_t w,
105 int16_t h);
106 void drawRGBBitmap(int16_t x, int16_t y, uint16_t *bitmap, int16_t w,
107 int16_t h);
108 void drawRGBBitmap(int16_t x, int16_t y, const uint16_t bitmap[],
109 const uint8_t mask[], int16_t w, int16_t h);
110 void drawRGBBitmap(int16_t x, int16_t y, uint16_t *bitmap, uint8_t *mask,
111 int16_t w, int16_t h);
112 void drawChar(int16_t x, int16_t y, unsigned char c, uint16_t color,
113 uint16_t bg, uint8_t size);
114 void drawChar(int16_t x, int16_t y, unsigned char c, uint16_t color,
115 uint16_t bg, uint8_t size_x, uint8_t size_y);
116 void getTextBounds(const char *string, int16_t x, int16_t y, int16_t *x1,
117 int16_t *y1, uint16_t *w, uint16_t *h);
118 void getTextBounds(const __FlashStringHelper *s, int16_t x, int16_t y,
119 int16_t *x1, int16_t *y1, uint16_t *w, uint16_t *h);
120 void getTextBounds(const String &str, int16_t x, int16_t y, int16_t *x1,
121 int16_t *y1, uint16_t *w, uint16_t *h);
122 void setTextSize(uint8_t s);
123 void setTextSize(uint8_t sx, uint8_t sy);
124 void setFont(const GFXfont *f = NULL);
125
126 /**********************************************************************/
132 /**********************************************************************/
133 void setCursor(int16_t x, int16_t y) {
134 cursor_x = x;
135 cursor_y = y;
136 }
137
138 /**********************************************************************/
145 /**********************************************************************/
146 void setTextColor(uint16_t c) { textcolor = textbgcolor = c; }
147
148 /**********************************************************************/
154 /**********************************************************************/
155 void setTextColor(uint16_t c, uint16_t bg) {
156 textcolor = c;
157 textbgcolor = bg;
158 }
159
160 /**********************************************************************/
166 /**********************************************************************/
167 void setTextWrap(bool w) { wrap = w; }
168
169 /**********************************************************************/
182 /**********************************************************************/
183 void cp437(bool x = true) { _cp437 = x; }
184
185 using Print::write;
186#if ARDUINO >= 100
187 virtual size_t write(uint8_t);
188#else
189 virtual void write(uint8_t);
190#endif
191
192 /************************************************************************/
197 /************************************************************************/
198 int16_t width(void) const { return _width; };
199
200 /************************************************************************/
205 /************************************************************************/
206 int16_t height(void) const { return _height; }
207
208 /************************************************************************/
213 /************************************************************************/
214 uint8_t getRotation(void) const { return rotation; }
215
216 // get current cursor position (get rotation safe maximum values,
217 // using: width() for x, height() for y)
218 /************************************************************************/
223 /************************************************************************/
224 int16_t getCursorX(void) const { return cursor_x; }
225
226 /************************************************************************/
231 /************************************************************************/
232 int16_t getCursorY(void) const { return cursor_y; };
233
234protected:
235 void charBounds(unsigned char c, int16_t *x, int16_t *y, int16_t *minx,
236 int16_t *miny, int16_t *maxx, int16_t *maxy);
237 int16_t WIDTH;
238 int16_t HEIGHT;
239 int16_t _width;
240 int16_t _height;
241 int16_t cursor_x;
242 int16_t cursor_y;
243 uint16_t textcolor;
244 uint16_t textbgcolor;
245 uint8_t textsize_x;
246 uint8_t textsize_y;
247 uint8_t rotation;
248 bool wrap;
249 bool _cp437;
250 GFXfont *gfxFont;
251};
252
255
256public:
258 // "Classic" initButton() uses center & size
259 void initButton(Adafruit_GFX *gfx, int16_t x, int16_t y, uint16_t w,
260 uint16_t h, uint16_t outline, uint16_t fill,
261 uint16_t textcolor, char *label, uint8_t textsize);
262 void initButton(Adafruit_GFX *gfx, int16_t x, int16_t y, uint16_t w,
263 uint16_t h, uint16_t outline, uint16_t fill,
264 uint16_t textcolor, char *label, uint8_t textsize_x,
265 uint8_t textsize_y);
266 // New/alt initButton() uses upper-left corner & size
267 void initButtonUL(Adafruit_GFX *gfx, int16_t x1, int16_t y1, uint16_t w,
268 uint16_t h, uint16_t outline, uint16_t fill,
269 uint16_t textcolor, char *label, uint8_t textsize);
270 void initButtonUL(Adafruit_GFX *gfx, int16_t x1, int16_t y1, uint16_t w,
271 uint16_t h, uint16_t outline, uint16_t fill,
272 uint16_t textcolor, char *label, uint8_t textsize_x,
273 uint8_t textsize_y);
274 void drawButton(bool inverted = false);
275 bool contains(int16_t x, int16_t y);
276
277 /**********************************************************************/
282 /**********************************************************************/
283 void press(bool p) {
284 laststate = currstate;
285 currstate = p;
286 }
287
288 bool justPressed();
289 bool justReleased();
290
291 /**********************************************************************/
296 /**********************************************************************/
297 bool isPressed(void) { return currstate; };
298
299private:
300 Adafruit_GFX *_gfx;
301 int16_t _x1, _y1; // Coordinates of top-left corner
302 uint16_t _w, _h;
303 uint8_t _textsize_x;
304 uint8_t _textsize_y;
305 uint16_t _outlinecolor, _fillcolor, _textcolor;
306 char _label[10];
307
308 bool currstate, laststate;
309};
310
312class GFXcanvas1 : public Adafruit_GFX {
313public:
314 GFXcanvas1(uint16_t w, uint16_t h, bool allocate_buffer = true);
315 ~GFXcanvas1(void);
316 void drawPixel(int16_t x, int16_t y, uint16_t color);
317 void fillScreen(uint16_t color);
318 void drawFastVLine(int16_t x, int16_t y, int16_t h, uint16_t color);
319 void drawFastHLine(int16_t x, int16_t y, int16_t w, uint16_t color);
320 bool getPixel(int16_t x, int16_t y) const;
321 /**********************************************************************/
326 /**********************************************************************/
327 uint8_t *getBuffer(void) const { return buffer; }
328
329protected:
330 bool getRawPixel(int16_t x, int16_t y) const;
331 void drawFastRawVLine(int16_t x, int16_t y, int16_t h, uint16_t color);
332 void drawFastRawHLine(int16_t x, int16_t y, int16_t w, uint16_t color);
333 uint8_t *buffer;
336
337private:
338#ifdef __AVR__
339 // Bitmask tables of 0x80>>X and ~(0x80>>X), because X>>Y is slow on AVR
340 static const uint8_t PROGMEM GFXsetBit[], GFXclrBit[];
341#endif
342};
343
345class GFXcanvas8 : public Adafruit_GFX {
346public:
347 GFXcanvas8(uint16_t w, uint16_t h, bool allocate_buffer = true);
348 ~GFXcanvas8(void);
349 void drawPixel(int16_t x, int16_t y, uint16_t color);
350 void fillScreen(uint16_t color);
351 void drawFastVLine(int16_t x, int16_t y, int16_t h, uint16_t color);
352 void drawFastHLine(int16_t x, int16_t y, int16_t w, uint16_t color);
353 uint8_t getPixel(int16_t x, int16_t y) const;
354 /**********************************************************************/
359 /**********************************************************************/
360 uint8_t *getBuffer(void) const { return buffer; }
361
362protected:
363 uint8_t getRawPixel(int16_t x, int16_t y) const;
364 void drawFastRawVLine(int16_t x, int16_t y, int16_t h, uint16_t color);
365 void drawFastRawHLine(int16_t x, int16_t y, int16_t w, uint16_t color);
366 uint8_t *buffer;
369};
370
372class GFXcanvas16 : public Adafruit_GFX {
373public:
374 GFXcanvas16(uint16_t w, uint16_t h, bool allocate_buffer = true);
375 ~GFXcanvas16(void);
376 void drawPixel(int16_t x, int16_t y, uint16_t color);
377 void fillScreen(uint16_t color);
378 void byteSwap(void);
379 void drawFastVLine(int16_t x, int16_t y, int16_t h, uint16_t color);
380 void drawFastHLine(int16_t x, int16_t y, int16_t w, uint16_t color);
381 uint16_t getPixel(int16_t x, int16_t y) const;
382 /**********************************************************************/
387 /**********************************************************************/
388 uint16_t *getBuffer(void) const { return buffer; }
389
390protected:
391 uint16_t getRawPixel(int16_t x, int16_t y) const;
392 void drawFastRawVLine(int16_t x, int16_t y, int16_t h, uint16_t color);
393 void drawFastRawHLine(int16_t x, int16_t y, int16_t w, uint16_t color);
394 uint16_t *buffer;
397};
398
399#endif // _ADAFRUIT_GFX_H
Arduino-compatible Print base class (independent implementation).
Minimal Arduino-API compatibility layer for the STM32 port of Adafruit_GFX (and libraries built on it...
A simple drawn button UI element.
void initButton(Adafruit_GFX *gfx, int16_t x, int16_t y, uint16_t w, uint16_t h, uint16_t outline, uint16_t fill, uint16_t textcolor, char *label, uint8_t textsize)
Initialize button with our desired color/size/settings.
Adafruit_GFX_Button(void)
Create a simple drawn button UI element.
void initButtonUL(Adafruit_GFX *gfx, int16_t x1, int16_t y1, uint16_t w, uint16_t h, uint16_t outline, uint16_t fill, uint16_t textcolor, char *label, uint8_t textsize)
Initialize button with our desired color/size/settings, with upper-left coordinates.
void drawButton(bool inverted=false)
Draw the button on the screen.
void press(bool p)
Sets button state, should be done by some touch function.
bool justReleased()
Query whether the button was released since we last checked state.
bool justPressed()
Query whether the button was pressed since we last checked state.
bool contains(int16_t x, int16_t y)
Helper to let us know if a coordinate is within the bounds of the button.
bool isPressed(void)
Query whether the button is currently pressed.
int16_t getCursorX(void) const
Get text cursor X location.
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)
Half-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.
void setTextWrap(bool w)
Set whether text that is too long for the screen width should automatically wrap around to the next l...
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 rotatePoint(int16_t &x0, int16_t &y0, int16_t angleDeg)
Rotate a point in standard position.
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.
void fillRotatedRect(int16_t cenX, int16_t cenY, int16_t w, int16_t h, int16_t angleDeg, uint16_t color)
Draw a filled rotated rectangle.
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 fillEllipse(int16_t x0, int16_t y0, int16_t rw, int16_t rh, uint16_t color)
Draw an ellipse with filled colour.
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...
int16_t getCursorY(void) const
Get text cursor Y location.
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 drawEllipse(int16_t x0, int16_t y0, int16_t rw, int16_t rh, uint16_t color)
Draw an ellipse outline.
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 setTextColor(uint16_t c, uint16_t bg)
Set text font color with custom background color.
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!
void cp437(bool x=true)
Enable (or disable) Code Page 437-compatible charset. There was an error in glcdfont....
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 ...
void drawRotatedRect(int16_t cenX, int16_t cenY, int16_t w, int16_t h, int16_t angleDeg, uint16_t color)
Draw a rotated rectangle.
GFXfont * gfxFont
Pointer to special font.
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 * getBuffer(void) const
Get a pointer to the internal buffer memory.
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...
GFXcanvas16(uint16_t w, uint16_t h, bool allocate_buffer=true)
Instatiate a GFX 16-bit canvas context for graphics.
A GFX 1-bit canvas context for graphics.
void drawPixel(int16_t x, int16_t y, uint16_t color)
Draw a pixel to the canvas framebuffer.
bool buffer_owned
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.
GFXcanvas1(uint16_t w, uint16_t h, bool allocate_buffer=true)
Instatiate a GFX 1-bit canvas context for graphics.
bool 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 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
Get the pixel color value at a given coordinate.
void fillScreen(uint16_t color)
Fill the framebuffer completely with one color.
uint8_t * buffer
Raster data: no longer private, allow subclass access.
uint8_t * getBuffer(void) const
Get a pointer to the internal buffer memory.
A GFX 8-bit canvas context for graphics.
~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...
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.
uint8_t * getBuffer(void) const
Get a pointer to the internal buffer memory.
GFXcanvas8(uint16_t w, uint16_t h, bool allocate_buffer=true)
Instatiate a GFX 8-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.
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.
bool buffer_owned
void drawFastHLine(int16_t x, int16_t y, int16_t w, uint16_t color)
Speed optimized horizontal line drawing.
Arduino-compatible text output base class. A subclass provides write(uint8_t); everything else is bui...
Definition Print.h:38
virtual size_t write(uint8_t c)=0
Minimal Arduino-String stand-in (see file description).
Definition WString.h:22