This interface is used as a base class for all types of 1bit-per-pixel graphics displays.
#include <display.h>
Public Member Functions | |
| OneBitGraphicsDisplay () | |
| virtual | ~OneBitGraphicsDisplay () |
| virtual uint16_t | Height () const =0 |
| virtual uint16_t | Width () const =0 |
| Rectangle | GetBounds () const |
| size_t | CurrentX () |
| size_t | CurrentY () |
| virtual void | Fill (bool on)=0 |
| virtual void | DrawPixel (uint_fast8_t x, uint_fast8_t y, bool on)=0 |
| virtual void | DrawLine (uint_fast8_t x1, uint_fast8_t y1, uint_fast8_t x2, uint_fast8_t y2, bool on)=0 |
| virtual void | DrawRect (uint_fast8_t x1, uint_fast8_t y1, uint_fast8_t x2, uint_fast8_t y2, bool on, bool fill=false)=0 |
| void | DrawRect (const Rectangle &rect, bool on, bool fill=false) |
| virtual void | DrawArc (uint_fast8_t x, uint_fast8_t y, uint_fast8_t radius, int_fast16_t start_angle, int_fast16_t sweep, bool on)=0 |
| void | DrawCircle (uint_fast8_t x, uint_fast8_t y, uint_fast8_t radius, bool on) |
| virtual char | WriteChar (char ch, FontDef font, bool on)=0 |
| virtual char | WriteString (const char *str, FontDef font, bool on)=0 |
| virtual Rectangle | WriteStringAligned (const char *str, const FontDef &font, Rectangle boundingBox, Alignment alignment, bool on)=0 |
| void | SetCursor (uint16_t x, uint16_t y) |
| virtual void | Update ()=0 |
| virtual bool | UpdateFinished ()=0 |
Protected Attributes | |
| uint16_t | currentX_ |
| uint16_t | currentY_ |
|
inline |
|
inlinevirtual |
|
inline |
|
inline |
|
pure virtual |
Draws an arc around the specified coordinate
| x | x Coordinate of the center of the arc |
| y | y Coordinate of the center of the arc |
| radius | radius of the arc |
| start_angle | angle where to start the arc |
| sweep | total angle of the arc |
| on | on or off |
Implemented in daisy::OneBitGraphicsDisplayImpl< ChildType >, daisy::OneBitGraphicsDisplayImpl< OledDisplay< daisy::SSD130xDriver > >, and daisy::OneBitGraphicsDisplayImpl< OledDisplay< DisplayDriver > >.
|
inline |
Draws a circle around the specified coordinate
| x | x Coordinate of the center of the circle |
| y | y Coordinate of the center of the circle |
| radius | radius of the circle |
| on | on or off |
|
pure virtual |
Draws a line from (x1, y1) to (y1, y2)
| x1 | x Coordinate of the starting point |
| y1 | y Coordinate of the starting point |
| x2 | x Coordinate of the ending point |
| y2 | y Coordinate of the ending point |
| on | on or off |
Implemented in daisy::OneBitGraphicsDisplayImpl< ChildType >, daisy::OneBitGraphicsDisplayImpl< OledDisplay< daisy::SSD130xDriver > >, and daisy::OneBitGraphicsDisplayImpl< OledDisplay< DisplayDriver > >.
|
pure virtual |
Sets the pixel at the specified coordinate to be on/off.
| x | x Coordinate |
| y | y coordinate |
| on | on or off |
Implemented in daisy::OledDisplay< DisplayDriver >, and daisy::OledDisplay< daisy::SSD130xDriver >.
|
inline |
Draws a rectangle.
| rect | the rectangle |
| on | on or off |
| fill | fill the rectangle or draw only the outline |
|
pure virtual |
Draws a rectangle based on two coordinates.
| x1 | x Coordinate of the first point |
| y1 | y Coordinate of the first point |
| x2 | x Coordinate of the second point |
| y2 | y Coordinate of the second point |
| on | on or off |
| fill | fill the rectangle or draw only the outline |
Implemented in daisy::OneBitGraphicsDisplayImpl< ChildType >, daisy::OneBitGraphicsDisplayImpl< OledDisplay< daisy::SSD130xDriver > >, and daisy::OneBitGraphicsDisplayImpl< OledDisplay< DisplayDriver > >.
|
pure virtual |
Fills the entire display with either on/off.
| on | Sets on or off. |
Implemented in daisy::OledDisplay< DisplayDriver >, and daisy::OledDisplay< daisy::SSD130xDriver >.
|
inline |
|
pure virtual |
Implemented in daisy::OledDisplay< DisplayDriver >, and daisy::OledDisplay< daisy::SSD130xDriver >.
|
inline |
Moves the 'Cursor' position used for WriteChar, and WriteStr to the specified coordinate.
| x | x pos |
| y | y pos |
|
pure virtual |
Writes the current display buffer to the OLED device using SPI or I2C depending on how the object was initialized.
Implemented in daisy::OledDisplay< DisplayDriver >, and daisy::OledDisplay< daisy::SSD130xDriver >.
|
pure virtual |
Returns true if the Update has finished, used for chained DMA transfers
Implemented in daisy::OledDisplay< DisplayDriver >, and daisy::OledDisplay< daisy::SSD130xDriver >.
|
pure virtual |
Implemented in daisy::OledDisplay< DisplayDriver >, and daisy::OledDisplay< daisy::SSD130xDriver >.
|
pure virtual |
Writes the character with the specific FontDef to the display buffer at the current Cursor position.
| ch | character to be written |
| font | font to be written in |
| on | on or off |
Implemented in daisy::OneBitGraphicsDisplayImpl< ChildType >, daisy::OneBitGraphicsDisplayImpl< OledDisplay< daisy::SSD130xDriver > >, and daisy::OneBitGraphicsDisplayImpl< OledDisplay< DisplayDriver > >.
|
pure virtual |
Similar to WriteChar, except it will handle an entire String. Wrapping does not happen automatically, so the width of the string must be kept within the dimensions of the screen.
| str | string to be written |
| font | font to use |
| on | on or off |
Implemented in daisy::OneBitGraphicsDisplayImpl< ChildType >, daisy::OneBitGraphicsDisplayImpl< OledDisplay< daisy::SSD130xDriver > >, and daisy::OneBitGraphicsDisplayImpl< OledDisplay< DisplayDriver > >.
|
pure virtual |
Similar to WriteString but justified within a bounding box.
| str | string to be written |
| font | font to use |
| boundingBox | the bounding box to draw the text in |
| alignment | the alignment to use |
| on | on or off |
Implemented in daisy::OneBitGraphicsDisplayImpl< ChildType >, daisy::OneBitGraphicsDisplayImpl< OledDisplay< daisy::SSD130xDriver > >, and daisy::OneBitGraphicsDisplayImpl< OledDisplay< DisplayDriver > >.
|
protected |
|
protected |