MatrixMiniR4 1.1.5
Matrix Mini R4 Arduino Library API Documentation
Loading...
Searching...
No Matches
MiniR4_GFX.h
Go to the documentation of this file.
1
6/*
7The MIT License (MIT)
8
9Copyright (c) 2017 Adafruit Industries
10
11Permission is hereby granted, free of charge, to any person obtaining a copy
12of this software and associated documentation files (the "Software"), to deal
13in the Software without restriction, including without limitation the rights
14to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15copies of the Software, and to permit persons to whom the Software is
16furnished to do so, subject to the following conditions:
17
18The above copyright notice and this permission notice shall be included in all
19copies or substantial portions of the Software.
20
21THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27SOFTWARE.
28*/
29
30#ifndef _ADAFRUIT_GFX_H
31#define _ADAFRUIT_GFX_H
32
33#if ARDUINO >= 100
34# include "Arduino.h"
35# include "Print.h"
36#else
37# include "WProgram.h"
38#endif
39#include "MiniR4_gfxfont.h"
40
41#include "MiniR4_I2CDevice.h"
42
50class Adafruit_GFX : public Print
51{
52
53public:
54 Adafruit_GFX(int16_t w, int16_t h); // Constructor
55
56 /**********************************************************************/
64 /**********************************************************************/
65 virtual void drawPixel(int16_t x, int16_t y, uint16_t color) = 0;
66
67 // TRANSACTION API / CORE DRAW API
68 // These MAY be overridden by the subclass to provide device-specific
69 // optimized code. Otherwise 'generic' versions are used.
70 virtual void startWrite(void);
71 virtual void writePixel(int16_t x, int16_t y, uint16_t color);
72 virtual void writeFillRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color);
73 virtual void writeFastVLine(int16_t x, int16_t y, int16_t h, uint16_t color);
74 virtual void writeFastHLine(int16_t x, int16_t y, int16_t w, uint16_t color);
75 virtual void writeLine(int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint16_t color);
76 virtual void endWrite(void);
77
78 // CONTROL API
79 // These MAY be overridden by the subclass to provide device-specific
80 // optimized code. Otherwise 'generic' versions are used.
81 virtual void setRotation(uint8_t r);
82 virtual void invertDisplay(bool i);
83
84 // BASIC DRAW API
85 // These MAY be overridden by the subclass to provide device-specific
86 // optimized code. Otherwise 'generic' versions are used.
87
88 // It's good to implement those, even if using transaction API
89 virtual void drawFastVLine(int16_t x, int16_t y, int16_t h, uint16_t color);
90 virtual void drawFastHLine(int16_t x, int16_t y, int16_t w, uint16_t color);
91 virtual void fillRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color);
92 virtual void fillScreen(uint16_t color);
93 // Optional and probably not necessary to change
94 virtual void drawLine(int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint16_t color);
95 virtual void drawRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color);
96
97 // These exist only with Adafruit_GFX (no subclass overrides)
98 void drawCircle(int16_t x0, int16_t y0, int16_t r, uint16_t color);
99 void drawCircleHelper(int16_t x0, int16_t y0, int16_t r, uint8_t cornername, uint16_t color);
100 void fillCircle(int16_t x0, int16_t y0, int16_t r, uint16_t color);
101 void fillCircleHelper(
102 int16_t x0, int16_t y0, int16_t r, uint8_t cornername, int16_t delta, uint16_t color);
103 void drawTriangle(
104 int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint16_t color);
105 void fillTriangle(
106 int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint16_t color);
107 void drawRoundRect(
108 int16_t x0, int16_t y0, int16_t w, int16_t h, int16_t radius, uint16_t color);
109 void fillRoundRect(
110 int16_t x0, int16_t y0, int16_t w, int16_t h, int16_t radius, uint16_t color);
111 void drawBitmap(
112 int16_t x, int16_t y, const uint8_t bitmap[], int16_t w, int16_t h, uint16_t color);
113 void drawBitmap(
114 int16_t x, int16_t y, const uint8_t bitmap[], int16_t w, int16_t h, uint16_t color,
115 uint16_t bg);
116 void drawBitmap(int16_t x, int16_t y, uint8_t* bitmap, int16_t w, int16_t h, uint16_t color);
117 void drawBitmap(
118 int16_t x, int16_t y, uint8_t* bitmap, int16_t w, int16_t h, uint16_t color, uint16_t bg);
119 void drawXBitmap(
120 int16_t x, int16_t y, const uint8_t bitmap[], int16_t w, int16_t h, uint16_t color);
121 void drawGrayscaleBitmap(int16_t x, int16_t y, const uint8_t bitmap[], int16_t w, int16_t h);
122 void drawGrayscaleBitmap(int16_t x, int16_t y, uint8_t* bitmap, int16_t w, int16_t h);
124 int16_t x, int16_t y, const uint8_t bitmap[], const uint8_t mask[], int16_t w, int16_t h);
126 int16_t x, int16_t y, uint8_t* bitmap, uint8_t* mask, int16_t w, int16_t h);
127 void drawRGBBitmap(int16_t x, int16_t y, const uint16_t bitmap[], int16_t w, int16_t h);
128 void drawRGBBitmap(int16_t x, int16_t y, uint16_t* bitmap, int16_t w, int16_t h);
129 void drawRGBBitmap(
130 int16_t x, int16_t y, const uint16_t bitmap[], const uint8_t mask[], int16_t w, int16_t h);
131 void drawRGBBitmap(int16_t x, int16_t y, uint16_t* bitmap, uint8_t* mask, int16_t w, int16_t h);
132 void drawChar(int16_t x, int16_t y, unsigned char c, uint16_t color, uint16_t bg, uint8_t size);
133 void drawChar(
134 int16_t x, int16_t y, unsigned char c, uint16_t color, uint16_t bg, uint8_t size_x,
135 uint8_t size_y);
136 void getTextBounds(
137 const char* string, int16_t x, int16_t y, int16_t* x1, int16_t* y1, uint16_t* w,
138 uint16_t* h);
139 void getTextBounds(
140 const __FlashStringHelper* s, int16_t x, int16_t y, int16_t* x1, int16_t* y1, uint16_t* w,
141 uint16_t* h);
142 void getTextBounds(
143 const String& str, int16_t x, int16_t y, int16_t* x1, int16_t* y1, uint16_t* w,
144 uint16_t* h);
145 void setTextSize(uint8_t s);
146 void setTextSize(uint8_t sx, uint8_t sy);
147 void setFont(const GFXfont* f = NULL);
148
149 /**********************************************************************/
155 /**********************************************************************/
156 void setCursor(int16_t x, int16_t y)
157 {
158 cursor_x = x;
159 cursor_y = y;
160 }
161
162 /**********************************************************************/
169 /**********************************************************************/
170 void setTextColor(uint16_t c) { textcolor = textbgcolor = c; }
171
172 /**********************************************************************/
178 /**********************************************************************/
179 void setTextColor(uint16_t c, uint16_t bg)
180 {
181 textcolor = c;
182 textbgcolor = bg;
183 }
184
185 /**********************************************************************/
191 /**********************************************************************/
192 void setTextWrap(bool w) { wrap = w; }
193
194 /**********************************************************************/
207 /**********************************************************************/
208 void cp437(bool x = true) { _cp437 = x; }
209
210 using Print::write;
211#if ARDUINO >= 100
212 virtual size_t write(uint8_t);
213#else
214 virtual void write(uint8_t);
215#endif
216
217 /************************************************************************/
222 /************************************************************************/
223 int16_t width(void) const { return _width; };
224
225 /************************************************************************/
230 /************************************************************************/
231 int16_t height(void) const { return _height; }
232
233 /************************************************************************/
238 /************************************************************************/
239 uint8_t getRotation(void) const { return rotation; }
240
241 // get current cursor position (get rotation safe maximum values,
242 // using: width() for x, height() for y)
243 /************************************************************************/
248 /************************************************************************/
249 int16_t getCursorX(void) const { return cursor_x; }
250
251 /************************************************************************/
256 /************************************************************************/
257 int16_t getCursorY(void) const { return cursor_y; };
258
259protected:
260 void charBounds(
261 unsigned char c, int16_t* x, int16_t* y, int16_t* minx, int16_t* miny, int16_t* maxx,
262 int16_t* maxy);
263 int16_t WIDTH;
264 int16_t HEIGHT;
265 int16_t _width;
266 int16_t _height;
267 int16_t cursor_x;
268 int16_t cursor_y;
269 uint16_t textcolor;
270 uint16_t textbgcolor;
271 uint8_t textsize_x;
272 uint8_t textsize_y;
273 uint8_t rotation;
274 bool wrap;
275 bool _cp437;
277};
278
281{
282
283public:
285 // "Classic" initButton() uses center & size
286 void initButton(
287 Adafruit_GFX* gfx, int16_t x, int16_t y, uint16_t w, uint16_t h, uint16_t outline,
288 uint16_t fill, uint16_t textcolor, char* label, uint8_t textsize);
289 void initButton(
290 Adafruit_GFX* gfx, int16_t x, int16_t y, uint16_t w, uint16_t h, uint16_t outline,
291 uint16_t fill, uint16_t textcolor, char* label, uint8_t textsize_x, uint8_t textsize_y);
292 // New/alt initButton() uses upper-left corner & size
293 void initButtonUL(
294 Adafruit_GFX* gfx, int16_t x1, int16_t y1, uint16_t w, uint16_t h, uint16_t outline,
295 uint16_t fill, uint16_t textcolor, char* label, uint8_t textsize);
296 void initButtonUL(
297 Adafruit_GFX* gfx, int16_t x1, int16_t y1, uint16_t w, uint16_t h, uint16_t outline,
298 uint16_t fill, uint16_t textcolor, char* label, uint8_t textsize_x, uint8_t textsize_y);
299 void drawButton(bool inverted = false);
300 bool contains(int16_t x, int16_t y);
301
302 /**********************************************************************/
307 /**********************************************************************/
308 void press(bool p)
309 {
310 laststate = currstate;
311 currstate = p;
312 }
313
314 bool justPressed();
315 bool justReleased();
316
317 /**********************************************************************/
322 /**********************************************************************/
323 bool isPressed(void) { return currstate; };
324
325private:
326 Adafruit_GFX* _gfx;
327 int16_t _x1, _y1; // Coordinates of top-left corner
328 uint16_t _w, _h;
329 uint8_t _textsize_x;
330 uint8_t _textsize_y;
331 uint16_t _outlinecolor, _fillcolor, _textcolor;
332 char _label[10];
333
334 bool currstate, laststate;
335};
336
339{
340public:
341 GFXcanvas1(uint16_t w, uint16_t h);
342 ~GFXcanvas1(void);
343 void drawPixel(int16_t x, int16_t y, uint16_t color);
344 void fillScreen(uint16_t color);
345 void drawFastVLine(int16_t x, int16_t y, int16_t h, uint16_t color);
346 void drawFastHLine(int16_t x, int16_t y, int16_t w, uint16_t color);
347 bool getPixel(int16_t x, int16_t y) const;
348 /**********************************************************************/
353 /**********************************************************************/
354 uint8_t* getBuffer(void) const { return buffer; }
355
356protected:
357 bool getRawPixel(int16_t x, int16_t y) const;
358 void drawFastRawVLine(int16_t x, int16_t y, int16_t h, uint16_t color);
359 void drawFastRawHLine(int16_t x, int16_t y, int16_t w, uint16_t color);
360 uint8_t* buffer;
361
362private:
363#ifdef __AVR__
364 // Bitmask tables of 0x80>>X and ~(0x80>>X), because X>>Y is slow on AVR
365 static const uint8_t PROGMEM GFXsetBit[], GFXclrBit[];
366#endif
367};
368
371{
372public:
373 GFXcanvas8(uint16_t w, uint16_t h);
374 ~GFXcanvas8(void);
375 void drawPixel(int16_t x, int16_t y, uint16_t color);
376 void fillScreen(uint16_t color);
377 void drawFastVLine(int16_t x, int16_t y, int16_t h, uint16_t color);
378 void drawFastHLine(int16_t x, int16_t y, int16_t w, uint16_t color);
379 uint8_t getPixel(int16_t x, int16_t y) const;
380 /**********************************************************************/
385 /**********************************************************************/
386 uint8_t* getBuffer(void) const { return buffer; }
387
388protected:
389 uint8_t getRawPixel(int16_t x, int16_t y) const;
390 void drawFastRawVLine(int16_t x, int16_t y, int16_t h, uint16_t color);
391 void drawFastRawHLine(int16_t x, int16_t y, int16_t w, uint16_t color);
392 uint8_t* buffer;
393};
394
397{
398public:
399 GFXcanvas16(uint16_t w, uint16_t h);
400 ~GFXcanvas16(void);
401 void drawPixel(int16_t x, int16_t y, uint16_t color);
402 void fillScreen(uint16_t color);
403 void byteSwap(void);
404 void drawFastVLine(int16_t x, int16_t y, int16_t h, uint16_t color);
405 void drawFastHLine(int16_t x, int16_t y, int16_t w, uint16_t color);
406 uint16_t getPixel(int16_t x, int16_t y) const;
407 /**********************************************************************/
412 /**********************************************************************/
413 uint16_t* getBuffer(void) const { return buffer; }
414
415protected:
416 uint16_t getRawPixel(int16_t x, int16_t y) const;
417 void drawFastRawVLine(int16_t x, int16_t y, int16_t h, uint16_t color);
418 void drawFastRawHLine(int16_t x, int16_t y, int16_t w, uint16_t color);
419 uint16_t* buffer;
420};
421
422#endif // _ADAFRUIT_GFX_H
Adafruit SSD1306 dependency code for I2C.
Adafruit SSD1306 dependency code.
#define PROGMEM
A simple drawn button UI element.
Definition MiniR4_GFX.h:281
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.
Definition MiniR4_GFX.h:308
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.
Definition MiniR4_GFX.h:323
A generic graphics superclass that can handle all sorts of drawing. At a.
Definition MiniR4_GFX.h:51
int16_t getCursorX(void) const
Get text cursor X location.
Definition MiniR4_GFX.h:249
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()
Definition MiniR4_GFX.h:270
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.
Definition MiniR4_GFX.h:264
void setTextWrap(bool w)
Set whether text that is too long for the screen width should automatically wrap around to the next l...
Definition MiniR4_GFX.h:192
int16_t width(void) const
Get width of the display, accounting for current rotation.
Definition MiniR4_GFX.h:223
uint8_t rotation
Display rotation (0 thru 3)
Definition MiniR4_GFX.h:273
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.
Definition MiniR4_GFX.h:231
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.
Definition MiniR4_GFX.h:170
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)
Definition MiniR4_GFX.h:275
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...
int16_t getCursorY(void) const
Get text cursor Y location.
Definition MiniR4_GFX.h:257
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.
Definition MiniR4_GFX.h:274
uint16_t textcolor
16-bit background color for print()
Definition MiniR4_GFX.h:269
int16_t cursor_x
x location to start print()ing text
Definition MiniR4_GFX.h:267
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()
Definition MiniR4_GFX.h:271
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()
Definition MiniR4_GFX.h:272
virtual void startWrite(void)
Start a display-writing routine, overwrite in subclasses.
void setCursor(int16_t x, int16_t y)
Set text cursor location.
Definition MiniR4_GFX.h:156
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.
Definition MiniR4_GFX.h:265
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.
Definition MiniR4_GFX.h:179
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.
Definition MiniR4_GFX.h:239
int16_t _height
Display height as modified by current rotation.
Definition MiniR4_GFX.h:266
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....
Definition MiniR4_GFX.h:208
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.
Definition MiniR4_GFX.h:263
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
Definition MiniR4_GFX.h:268
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.
Definition MiniR4_GFX.h:276
A GFX 16-bit canvas context for graphics.
Definition MiniR4_GFX.h:397
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.
Definition MiniR4_GFX.h:419
~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.
Definition MiniR4_GFX.h:413
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...
A GFX 1-bit canvas context for graphics.
Definition MiniR4_GFX.h:339
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.
Definition MiniR4_GFX.h:360
uint8_t * getBuffer(void) const
Get a pointer to the internal buffer memory.
Definition MiniR4_GFX.h:354
A GFX 8-bit canvas context for graphics.
Definition MiniR4_GFX.h:371
~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.
uint8_t * getBuffer(void) const
Get a pointer to the internal buffer memory.
Definition MiniR4_GFX.h:386
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.
Definition MiniR4_GFX.h:392
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.