GFX helper class.
More...
This file is 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 |
|
) |
| |
Instantiates a GFX object
- Parameters
-
width | Screen width |
height | Screen height |
screenBuffer | Pointer to the screen buffer |
font | Pointer to the font map |
virtual void setAddrWindow |
( |
uint8_t |
x0, |
|
|
uint8_t |
y0, |
|
|
uint8_t |
x1, |
|
|
uint8_t |
y1 |
|
) |
| |
|
pure virtual |
Sets 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 |
Sends a pixel color (RGB) to the chip. Must be implemented by the inherited class.
- Parameters
-
x | Axis on the horizontal scale |
y | Axis on the vertical scale |
color | RGB value |
Implemented in ST7735.
Copies the buffer to the chip via the SPI.
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 the horizontal scale |
y | Axis on the vertical scale |
data | Character to write |
color | Character color |
bg | Character background color |
size | Size of the font |
void print |
( |
std::string |
msg | ) |
|
Prints a message on the screen
- Parameters
-
mraa_result_t setPixel |
( |
int |
x, |
|
|
int |
y, |
|
|
uint16_t |
color |
|
) |
| |
Prints a message on the screen
- Parameters
-
x | Axis on the horizontal scale |
y | Axis on the vertical scale |
color | Pixel color |
void fillScreen |
( |
uint16_t |
color | ) |
|
Fills the screen with a selected color
- Parameters
-
void fillRect |
( |
int16_t |
x, |
|
|
int16_t |
y, |
|
|
int16_t |
w, |
|
|
int16_t |
h, |
|
|
uint16_t |
color |
|
) |
| |
Fills a rectangle with a selected color
- Parameters
-
x | Axis on the horizontal scale (top-left corner) |
y | Axis on the 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 |
|
) |
| |
Draws a line on the vertical scale
- Parameters
-
x | Axis on the horizontal scale |
y | Axis on the 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 |
|
) |
| |
Draws a 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 |
|
) |
| |
Draws 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 |
|
) |
| |
Draws a circle
- Parameters
-
x | Center of the circle on the horizontal scale |
y | Center of the circle on the vertical scale |
r | Radius of the circle |
color | Color of the circle |
void setCursor |
( |
int16_t |
x, |
|
|
int16_t |
y |
|
) |
| |
Sets the cursor for a text message
- Parameters
-
x | Axis on the horizontal scale |
y | Axis on the vertical scale |
void setTextColor |
( |
uint16_t |
textColor, |
|
|
uint16_t |
textBGColor |
|
) |
| |
Sets a text color for a message
- Parameters
-
textColor | Font color |
textBGColor | Background color |
void setTextSize |
( |
uint8_t |
size | ) |
|
Sets the size of the font
- Parameters
-
void setTextWrap |
( |
uint8_t |
wrap | ) |
|
Wraps a 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