GFX helper class.
More...
This file used by the screen.
|
| | GFX (int width, int height, uint8_t *screenBuffer, const unsigned char *font) |
| |
| | ~GFX () |
| |
| virtual void | setAddrWindow (uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1)=0 |
| |
| virtual void | drawPixel (int16_t x, int16_t y, uint16_t color)=0 |
| |
| virtual void | refresh ()=0 |
| |
| void | drawChar (int16_t x, int16_t y, uint8_t data, uint16_t color, uint16_t bg, uint8_t size) |
| |
| void | print (std::string msg) |
| |
| mraa_result_t | setPixel (int x, int y, uint16_t color) |
| |
| void | fillScreen (uint16_t color) |
| |
| void | fillRect (int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color) |
| |
| void | drawFastVLine (int16_t x, int16_t y, int16_t h, uint16_t color) |
| |
| void | drawLine (int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint16_t color) |
| |
| void | drawTriangle (int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint16_t color) |
| |
| void | drawCircle (int16_t x, int16_t y, int16_t r, uint16_t color) |
| |
| void | setCursor (int16_t x, int16_t y) |
| |
| void | setTextColor (uint16_t textColor, uint16_t textBGColor) |
| |
| void | setTextSize (uint8_t size) |
| |
| void | setTextWrap (uint8_t wrap) |
| |
|
|
const int16_t | WIDTH |
| |
|
const int16_t | HEIGHT |
| |
|
const unsigned char * | m_font |
| |
| GFX |
( |
int |
width, |
|
|
int |
height, |
|
|
uint8_t * |
screenBuffer, |
|
|
const unsigned char * |
font |
|
) |
| |
Instanciates a GFX object
- Parameters
-
| width | screen width |
| height | screen height |
| screenBuffer | pointer to screen buffer |
| font | pointer to font map |
| virtual void setAddrWindow |
( |
uint8_t |
x0, |
|
|
uint8_t |
y0, |
|
|
uint8_t |
x1, |
|
|
uint8_t |
y1 |
|
) |
| |
|
pure virtual |
Set the window address
- Parameters
-
| x0 | first coordinate |
| y0 | first coordinate |
| x1 | second coordinate |
| y1 | second coordinate |
Implemented in ST7735.
| virtual void drawPixel |
( |
int16_t |
x, |
|
|
int16_t |
y, |
|
|
uint16_t |
color |
|
) |
| |
|
pure virtual |
Send pixel collor (RGB) to the chip. Must be implemented by inherited class.
- Parameters
-
| x | axis on horizontal scale |
| y | axis on vertical scale |
| color | rgb value |
Implemented in ST7735.
Copy the buffer to the chip via SPI interface.
Implemented in ST7735.
| void drawChar |
( |
int16_t |
x, |
|
|
int16_t |
y, |
|
|
uint8_t |
data, |
|
|
uint16_t |
color, |
|
|
uint16_t |
bg, |
|
|
uint8_t |
size |
|
) |
| |
- Parameters
-
| x | axis on horizontal scale |
| y | axis on vertical scale |
| data | character to write |
| color | character's color |
| bg | character's background color |
| size | size of the font |
| void print |
( |
std::string |
msg | ) |
|
Print the message to the screen
- Parameters
-
| msg | message which will be printed |
| mraa_result_t setPixel |
( |
int |
x, |
|
|
int |
y, |
|
|
uint16_t |
color |
|
) |
| |
Print the message to the screen
- Parameters
-
| x | axis on horizontal scale |
| y | axis on vertical scale |
| color | pixel's color |
| void fillScreen |
( |
uint16_t |
color | ) |
|
Fill screen with selected color
- Parameters
-
| void fillRect |
( |
int16_t |
x, |
|
|
int16_t |
y, |
|
|
int16_t |
w, |
|
|
int16_t |
h, |
|
|
uint16_t |
color |
|
) |
| |
Fill rectangle with selected color
- Parameters
-
| x | axis on horizontal scale (top left corner) |
| y | axis on vertical scale (top left corner) |
| w | distanse from x |
| h | distanse from y |
| color | selected color |
| void drawFastVLine |
( |
int16_t |
x, |
|
|
int16_t |
y, |
|
|
int16_t |
h, |
|
|
uint16_t |
color |
|
) |
| |
Draw line in vertical scale.
- Parameters
-
| x | axis on horizontal scale |
| y | axis on vertical scale |
| h | distanse from y |
| color | selected color |
| void drawLine |
( |
int16_t |
x0, |
|
|
int16_t |
y0, |
|
|
int16_t |
x1, |
|
|
int16_t |
y1, |
|
|
uint16_t |
color |
|
) |
| |
Draw line from coordinate C0 to coordinate C1
- Parameters
-
| x0 | first coordinate |
| y0 | first coordinate |
| x1 | second coordinate |
| y1 | second coordinate |
| color | selected color |
| 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
- Parameters
-
| x0 | first coordinate |
| y0 | first coordinate |
| x1 | second coordinate |
| y1 | second coordinate |
| x2 | third coordinate |
| y2 | third coordinate |
| color | selected color |
| void drawCircle |
( |
int16_t |
x, |
|
|
int16_t |
y, |
|
|
int16_t |
r, |
|
|
uint16_t |
color |
|
) |
| |
Draw a circle
- Parameters
-
| x | center of circle on X scale |
| y | center of circle on Y scale |
| r | radius of circle |
| color | color of circle |
| void setCursor |
( |
int16_t |
x, |
|
|
int16_t |
y |
|
) |
| |
Set cursor for text message
- Parameters
-
| x | axis on horizontal scale |
| y | axis on vertical scale |
| void setTextColor |
( |
uint16_t |
textColor, |
|
|
uint16_t |
textBGColor |
|
) |
| |
Set text color for the message
- Parameters
-
| textColor | font color |
| textBGColor | background color |
| void setTextSize |
( |
uint8_t |
size | ) |
|
Set the size of the font
- Parameters
-
| void setTextWrap |
( |
uint8_t |
wrap | ) |
|
Wrap printed message.
- Parameters
-
| wrap | true (0x1) or false (0x0) |
Printed text background color
Wrapper flag (true or false)
The documentation for this class was generated from the following files:
- /var/lib/jenkins/workspace/upm-doc-stable/src/st7735/gfx.h
- /var/lib/jenkins/workspace/upm-doc-stable/src/st7735/gfx.cxx