#include <Display/DisplayInterface.hpp>
An interface for displays.
Inspired by the Adafruit GFX library for easy compatibility.
Definition at line 16 of file DisplayInterface.hpp.
Inheritance diagram for DisplayInterface:
Collaboration diagram for DisplayInterface:Public Member Functions | |
| virtual | ~DisplayInterface ()=default |
| virtual void | begin () |
| Initialize the display. | |
| virtual void | clear ()=0 |
| Clear the frame buffer or clear the display. | |
| virtual void | drawBackground () |
| Draw a custom background. | |
| virtual void | display ()=0 |
| Write the frame buffer to the display. | |
| virtual void | drawPixel (int16_t x, int16_t y, uint16_t color)=0 |
| Paint a single pixel with the given color. | |
| virtual void | setTextColor (uint16_t color)=0 |
| Set the text color. | |
| virtual void | setTextSize (uint8_t size)=0 |
| Set the text size. | |
| virtual void | setCursor (int16_t x, int16_t y)=0 |
| Set the cursor position. | |
| size_t | write (uint8_t c) override=0 |
| Write a character to the display. | |
| virtual void | drawLine (int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint16_t color)=0 |
| Draw a line between two points. | |
| virtual void | drawFastVLine (int16_t x, int16_t y, int16_t h, uint16_t color)=0 |
| Draw a vertical line. | |
| virtual void | drawFastHLine (int16_t x, int16_t y, int16_t w, uint16_t color)=0 |
| Draw a horizontal line. | |
| virtual void | drawXBitmap (int16_t x, int16_t y, const uint8_t bitmap[], int16_t w, int16_t h, uint16_t color)=0 |
| Draw a bitmap to the display. | |
| virtual void | fillRect (int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color) |
| Draw a filled rectangle. | |
| virtual void | drawCircle (int16_t x0, int16_t y0, int16_t r, uint16_t color) |
| Draw a circle. | |
| virtual void | fillCircle (int16_t x0, int16_t y0, int16_t r, uint16_t color) |
| Draw a disk (filled circle). | |
| void | clearAndDrawBackground () |
| Clear the frame buffer, and draw the custom background. | |
Protected Member Functions | |
| DisplayInterface ()=default | |
|
protecteddefault |
|
virtualdefault |
|
virtual |
Initialize the display.
Definition at line 5 of file DisplayInterface.cpp.
Clear the frame buffer or clear the display.
Implemented in SSD1306_DisplayInterface.
Draw a custom background.
Reimplemented in SSD1306_DisplayInterface.
Definition at line 29 of file DisplayInterface.hpp.
Write the frame buffer to the display.
If your display library writes to the display directly, without a display buffer in RAM, you can leave this function empty.
Implemented in SSD1306_DisplayInterface.
Paint a single pixel with the given color.
Implemented in SSD1306_DisplayInterface.
Set the text color.
Implemented in SSD1306_DisplayInterface.
Set the text size.
Implemented in SSD1306_DisplayInterface.
Set the cursor position.
Implemented in SSD1306_DisplayInterface.
Write a character to the display.
Implemented in SSD1306_DisplayInterface.
|
pure virtual |
Draw a line between two points.
Implemented in SSD1306_DisplayInterface.
Draw a vertical line.
Implemented in SSD1306_DisplayInterface.
Draw a horizontal line.
Implemented in SSD1306_DisplayInterface.
|
pure virtual |
Draw a bitmap to the display.
Implemented in SSD1306_DisplayInterface.
Draw a filled rectangle.
Definition at line 11 of file DisplayInterface.cpp.
Draw a circle.
Definition at line 17 of file DisplayInterface.cpp.
Draw a disk (filled circle).
Definition at line 40 of file DisplayInterface.cpp.
|
inline |
Clear the frame buffer, and draw the custom background.
Definition at line 83 of file DisplayInterface.hpp.