10 #ifndef _ERM19264_GRAPHICS_H
11 #define _ERM19264_GRAPHICS_H
20 #define ERM19264_swap(a, b) { int16_t t = a; a = b; b = t; }
71 virtual void drawPixel(int16_t x, int16_t y, uint8_t color) = 0;
74 void drawLine(int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint8_t color);
75 void drawFastVLine(int16_t x, int16_t y, int16_t h, uint8_t color);
76 void drawFastHLine(int16_t x, int16_t y, int16_t w, uint8_t color);
77 void drawRect(int16_t x, int16_t y, int16_t w, int16_t h, uint8_t color);
78 void fillRect(int16_t x, int16_t y, int16_t w, int16_t h, uint8_t color);
81 void drawCircle(int16_t x0, int16_t y0, int16_t r, uint8_t color);
84 void fillCircle(int16_t x0, int16_t y0, int16_t r, uint8_t color);
86 int16_t delta, uint8_t color);
87 void drawTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1,
88 int16_t x2, int16_t y2, uint8_t color);
89 void fillTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1,
90 int16_t x2, int16_t y2, uint8_t color);
91 void drawRoundRect(int16_t x0, int16_t y0, int16_t w, int16_t h,
92 int16_t radius, uint8_t color);
93 void fillRoundRect(int16_t x0, int16_t y0, int16_t w, int16_t h,
94 int16_t radius, uint8_t color);
98 int16_t w, int16_t h, uint8_t color, uint8_t bg);
114 virtual size_t write(uint8_t);
116 virtual void write(uint8_t);
120 int16_t
height(
void)
const;
121 int16_t
width(
void)
const;
LCD_rotate_e
Definition: ERM19264_graphics.h:24
@ LCD_Degrees_270
Definition: ERM19264_graphics.h:28
@ LCD_Degrees_90
Definition: ERM19264_graphics.h:26
@ LCD_Degrees_180
Definition: ERM19264_graphics.h:27
@ LCD_Degrees_0
Definition: ERM19264_graphics.h:25
LCD_Font_Type_e
Definition: ERM19264_graphics.h:48
@ UC1609Font_ArialRound
Definition: ERM19264_graphics.h:57
@ UC1609Font_Default
Definition: ERM19264_graphics.h:49
@ UC1609Font_Thick
Definition: ERM19264_graphics.h:50
@ UC1609Font_Seven_Seg
Definition: ERM19264_graphics.h:51
@ UC1609Font_Tiny
Definition: ERM19264_graphics.h:53
@ UC1609Font_Dedica
Definition: ERM19264_graphics.h:60
@ UC1609Font_Wide
Definition: ERM19264_graphics.h:52
@ UC1609Font_Mia
Definition: ERM19264_graphics.h:59
@ UC1609Font_ArialBold
Definition: ERM19264_graphics.h:58
@ UC1609Font_Mednum
Definition: ERM19264_graphics.h:56
@ UC1609Font_Homespun
Definition: ERM19264_graphics.h:54
@ UC1609Font_Bignum
Definition: ERM19264_graphics.h:55
LCD_Return_Codes_e
Definition: ERM19264_graphics.h:33
@ LCD_BitmapNullptr
Definition: ERM19264_graphics.h:39
@ LCD_WrongFont
Definition: ERM19264_graphics.h:35
@ LCD_BitmapScreenBounds
Definition: ERM19264_graphics.h:40
@ LCD_CharFontASCIIRange
Definition: ERM19264_graphics.h:37
@ LCD_Success
Definition: ERM19264_graphics.h:34
@ LCD_CharScreenBounds
Definition: ERM19264_graphics.h:36
@ LCD_BitmapLargerThanScreen
Definition: ERM19264_graphics.h:41
@ LCD_BitmapVerticalSize
Definition: ERM19264_graphics.h:42
@ LCD_CharArrayNullptr
Definition: ERM19264_graphics.h:38
@ LCD_BitmapHorizontalSize
Definition: ERM19264_graphics.h:43
Graphics class to hold graphic related functions.
Definition: ERM19264_graphics.h:64
uint8_t _FontNumber
Definition: ERM19264_graphics.h:183
void fillTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint8_t color)
Fills a triangle of coordinates (x0,y0), (x1,y1) and (x2,y2).
Definition: ERM19264_graphics.cpp:345
virtual void write(uint8_t)
: called by the print class after it converts the data to a character
Definition: ERM19264_graphics.cpp:494
ERM19264_graphics(int16_t w, int16_t h)
init the LCD Graphics class object
Definition: ERM19264_graphics.cpp:26
void setRotation(LCD_rotate_e)
Sets the rotation of the display.
Definition: ERM19264_graphics.cpp:961
LCD_Font_height_e
Definition: ERM19264_graphics.h:165
@ UC1609Font_height_8
Definition: ERM19264_graphics.h:166
@ UC1609Font_height_32
Definition: ERM19264_graphics.h:170
@ UC1609Font_height_24
Definition: ERM19264_graphics.h:169
@ UC1609Font_height_16
Definition: ERM19264_graphics.h:168
@ UC1609Font_height_12
Definition: ERM19264_graphics.h:167
void drawFastVLine(int16_t x, int16_t y, int16_t h, uint8_t color)
Draws a vertical line starting at (x,y) with height h.
Definition: ERM19264_graphics.cpp:239
void setDrawBitmapAddr(boolean mode)
sets the data addressing mode in drawBitmap function.
Definition: ERM19264_graphics.cpp:674
boolean drawBitmapAddr
Definition: ERM19264_graphics.h:140
void drawCircle(int16_t x0, int16_t y0, int16_t r, uint8_t color)
draws a circle where (x0,y0) are center coordinates an r is circle radius.
Definition: ERM19264_graphics.cpp:47
void drawCircleHelper(int16_t x0, int16_t y0, int16_t r, uint8_t cornername, uint8_t color)
Used internally by drawRoundRect.
Definition: ERM19264_graphics.cpp:84
boolean _textWrap
Definition: ERM19264_graphics.h:138
void drawLine(int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint8_t color)
draws a line from (x0,y0) to (x1,y1).
Definition: ERM19264_graphics.cpp:174
LCD_Return_Codes_e drawBitmap(int16_t x, int16_t y, const uint8_t *bitmap, int16_t w, int16_t h, uint8_t color, uint8_t bg)
Draw a 1-bit color bitmap.
Definition: ERM19264_graphics.cpp:425
int16_t _height
Definition: ERM19264_graphics.h:130
void setTextColor(uint8_t c)
set the text color
Definition: ERM19264_graphics.cpp:646
LCD_Font_width_e
Definition: ERM19264_graphics.h:144
@ UC1609Font_width_16
Definition: ERM19264_graphics.h:151
@ UC1609Font_width_6
Definition: ERM19264_graphics.h:148
@ UC1609Font_width_8
Definition: ERM19264_graphics.h:150
@ UC1609Font_width_4
Definition: ERM19264_graphics.h:146
@ UC1609Font_width_7
Definition: ERM19264_graphics.h:149
@ UC1609Font_width_5
Definition: ERM19264_graphics.h:147
@ UC1609Font_width_3
Definition: ERM19264_graphics.h:145
void fillCircle(int16_t x0, int16_t y0, int16_t r, uint8_t color)
fills a circle where (x0,y0) are center coordinates an r is circle radius.
Definition: ERM19264_graphics.cpp:127
LCD_rotate_e getRotation(void)
Gets the _rotation of the display.
Definition: ERM19264_graphics.cpp:954
LCD_Return_Codes_e drawChar(uint8_t x, uint8_t y, uint8_t c, uint8_t color, uint8_t bg)
writes a char (c) on the LCD
Definition: ERM19264_graphics.cpp:793
void setTextWrap(boolean w)
turn on or off screen _textWrap of the text (fonts 1-6)
Definition: ERM19264_graphics.cpp:664
LCD_rotate_e LCD_rotate
Definition: ERM19264_graphics.h:133
void drawRoundRect(int16_t x0, int16_t y0, int16_t w, int16_t h, int16_t radius, uint8_t color)
draws a rectangle with rounded edges
Definition: ERM19264_graphics.cpp:288
void drawFastHLine(int16_t x, int16_t y, int16_t w, uint8_t color)
Draws a horizontal line starting at (x,y) with width w.
Definition: ERM19264_graphics.cpp:251
uint8_t _CurrentFontoffset
Definition: ERM19264_graphics.h:185
void drawRect(int16_t x, int16_t y, int16_t w, int16_t h, uint8_t color)
draws rectangle at (x,y) where h is height and w is width of the rectangle.
Definition: ERM19264_graphics.cpp:223
int16_t _width
Definition: ERM19264_graphics.h:129
int16_t height(void) const
Gets the height of the display (per current rotation)
Definition: ERM19264_graphics.cpp:688
void fillRoundRect(int16_t x0, int16_t y0, int16_t w, int16_t h, int16_t radius, uint8_t color)
Fills a rectangle with rounded edges.
Definition: ERM19264_graphics.cpp:310
const int16_t WIDTH
Definition: ERM19264_graphics.h:127
void fillCircleHelper(int16_t x0, int16_t y0, int16_t r, uint8_t cornername, int16_t delta, uint8_t color)
Used internally by fill circle fillRoundRect and fillcircle.
Definition: ERM19264_graphics.cpp:136
uint8_t _textBgColor
Definition: ERM19264_graphics.h:136
void setTextSize(uint8_t s)
set the text size , starts at 1
Definition: ERM19264_graphics.cpp:638
uint8_t _CurrentFontWidth
Definition: ERM19264_graphics.h:184
uint8_t _CurrentFontheight
Definition: ERM19264_graphics.h:186
void setFontNum(LCD_Font_Type_e FontNumber)
Set the font type.
Definition: ERM19264_graphics.cpp:694
const int16_t HEIGHT
Definition: ERM19264_graphics.h:128
int16_t width(void) const
Gets the width of the display (per current rotation)
Definition: ERM19264_graphics.cpp:682
LCD_Return_Codes_e drawText(uint8_t x, uint8_t y, char *pText, uint8_t color, uint8_t bg)
Writes text string (*ptext) on the LCD.
Definition: ERM19264_graphics.cpp:884
LCD_Font_offset_e
Definition: ERM19264_graphics.h:156
@ UC1609Font_offset_none
Definition: ERM19264_graphics.h:157
@ UC1609Font_offset_zero
Definition: ERM19264_graphics.h:160
@ UC1609Font_offset_minus
Definition: ERM19264_graphics.h:159
@ UC1609Font_offset_space
Definition: ERM19264_graphics.h:158
uint8_t _CurrentFontLength
Definition: ERM19264_graphics.h:187
void drawTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint8_t color)
draws a triangle of coordinates (x0,y0), (x1,y1) and (x2,y2).
Definition: ERM19264_graphics.cpp:327
uint8_t _textSize
Definition: ERM19264_graphics.h:137
void fillScreen(uint8_t color)
Fills the whole screen with a given color.
Definition: ERM19264_graphics.cpp:275
LCD_Font_Length_e
Definition: ERM19264_graphics.h:175
@ UC1609FontLenNumeric
Definition: ERM19264_graphics.h:176
@ UC1609FontLenAlphaNumNoLCase
Definition: ERM19264_graphics.h:177
@ UC1609FontLenAlphaNum
Definition: ERM19264_graphics.h:178
@ UC1609FontLenAll
Definition: ERM19264_graphics.h:180
@ UC1609FontLenHalf
Definition: ERM19264_graphics.h:179
void fillRect(int16_t x, int16_t y, int16_t w, int16_t h, uint8_t color)
fills a rectangle starting from coordinates (x,y) with width of w and height of h.
Definition: ERM19264_graphics.cpp:264
int16_t _cursorX
Definition: ERM19264_graphics.h:131
uint8_t _textColor
Definition: ERM19264_graphics.h:135
void setCursor(int16_t x, int16_t y)
set the cursor position
Definition: ERM19264_graphics.cpp:629
int16_t _cursorY
Definition: ERM19264_graphics.h:132