|
Ersa Wearable Platform
Embedded smartwatch firmware and application framework
|
#include <display.h>

Public Member Functions | |
| virtual | ~IDisplay ()=default |
| virtual Result< void > | init ()=0 |
| virtual int16_t | width () const =0 |
| virtual int16_t | height () const =0 |
| virtual void | clear (Color color=Color::Black)=0 |
| virtual void | drawPixel (int16_t x, int16_t y, Color color)=0 |
| virtual void | drawLine (int16_t x1, int16_t y1, int16_t x2, int16_t y2, Color color)=0 |
| virtual void | fillRect (int16_t x, int16_t y, int16_t w, int16_t h, Color color)=0 |
| virtual void | drawFastHLine (int16_t x, int16_t y, int16_t w, Color color)=0 |
| virtual void | drawFastVLine (int16_t x, int16_t y, int16_t h, Color color)=0 |
| virtual void | drawCircle (int16_t x, int16_t y, int16_t r, Color color)=0 |
| virtual void | fillCircle (int16_t x, int16_t y, int16_t r, Color color)=0 |
| virtual void | drawRoundRect (int16_t x, int16_t y, int16_t w, int16_t h, int16_t radius, Color color)=0 |
| Draw an unfilled rectangle with rounded corners. | |
| virtual void | fillRoundRect (int16_t x, int16_t y, int16_t w, int16_t h, int16_t radius, Color color)=0 |
| Draw a filled rectangle with rounded corners. | |
| virtual void | setFont (FontFace face)=0 |
| virtual void | setTextSize (uint8_t size)=0 |
| virtual void | setTextColor (Color color)=0 |
| virtual void | setTextWrap (bool wrap)=0 |
| virtual void | setCursor (int16_t x, int16_t y)=0 |
| virtual size_t | print (const char *text)=0 |
| virtual size_t | print (uint8_t value)=0 |
| Draw an unsigned byte value and return the number of characters consumed. | |
| virtual size_t | print (int32_t value)=0 |
| Draw a signed 32-bit value and return the number of characters consumed. | |
| virtual size_t | print (uint32_t value)=0 |
| Draw an unsigned 32-bit value and return the number of characters consumed. | |
| virtual void | getTextBounds (const char *text, int16_t x, int16_t y, int16_t *x1, int16_t *y1, uint16_t *w, uint16_t *h)=0 |
| void | fillScreen (uint16_t color) |
| Clear the framebuffer using the legacy 0=black, nonzero=white mapping. | |
| void | setTextColor (uint16_t color) |
| Set legacy monochrome text color; nonzero maps to white. | |
| void | drawLine (int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint16_t color) |
| Draw a line using the legacy monochrome color convention. | |
| void | drawFastHLine (int16_t x, int16_t y, int16_t w, uint16_t color) |
| void | drawFastVLine (int16_t x, int16_t y, int16_t h, uint16_t color) |
| void | fillRect (int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color) |
| void | drawCircle (int16_t x, int16_t y, int16_t r, uint16_t color) |
| void | fillCircle (int16_t x, int16_t y, int16_t r, uint16_t color) |
| void | drawRoundRect (int16_t x, int16_t y, int16_t w, int16_t h, int16_t r, uint16_t color) |
| void | fillRoundRect (int16_t x, int16_t y, int16_t w, int16_t h, int16_t r, uint16_t color) |
| virtual void | refresh (bool full=false)=0 |
| virtual void | refreshRect (const Rect &rect)=0 |
| virtual bool | isBusy () const =0 |
| Return whether the panel is still processing a refresh. | |
| virtual void | setBusyCallback (DisplayBusyCallback cb, void *userData=nullptr)=0 |
| virtual void | powerOff ()=0 |
| virtual void | powerOn ()=0 |
| virtual bool | isPowered () const =0 |
| virtual const uint8_t * | getBuffer () const =0 |
| virtual uint8_t * | getBuffer ()=0 |
Graphics, text, refresh, and power contract consumed by watch UI code.
This is the stable renderer-facing surface for every board. Applications draw using logical colors, fonts, and coordinates; the selected driver maps those operations to e-paper, OLED, or another panel. Keeping vendor drawing types out of this interface lets a different panel driver be substituted without rewriting app code. Drawing mutates a framebuffer; refresh methods are the separate operation that transmits that buffer to the physical panel.
|
virtualdefault |
Allow a concrete panel driver to be destroyed through this contract.
|
pure virtual |
Fill the drawing buffer with one logical color; this does not itself trigger a physical panel refresh.
Implemented in ersa::test::MockDisplay.
|
pure virtual |
Draw a circle outline centered at (x, y) with the given radius.
Implemented in ersa::test::MockDisplay.
|
inline |
|
pure virtual |
Draw a horizontal line, allowing the backend to optimize row access.
Implemented in ersa::test::MockDisplay.
|
inline |
|
pure virtual |
Draw a vertical line, allowing the backend to optimize column access.
Implemented in ersa::test::MockDisplay.
|
inline |
|
pure virtual |
Rasterize a line from (x1, y1) to (x2, y2) in the framebuffer.
Implemented in ersa::test::MockDisplay.
|
inline |
Draw a line using the legacy monochrome color convention.
|
pure virtual |
Set the framebuffer pixel at (x, y), clipping unsupported coordinates.
Implemented in ersa::test::MockDisplay.
|
inline |
|
pure virtual |
Draw an unfilled rectangle with rounded corners.
Implemented in ersa::test::MockDisplay.
|
pure virtual |
Fill a circle centered at (x, y) with the given radius.
Implemented in ersa::test::MockDisplay.
|
inline |
|
pure virtual |
Fill a rectangle with its top-left corner at (x, y).
Implemented in ersa::test::MockDisplay.
|
inline |
|
inline |
|
pure virtual |
Draw a filled rectangle with rounded corners.
Implemented in ersa::test::MockDisplay.
|
inline |
Clear the framebuffer using the legacy 0=black, nonzero=white mapping.
|
pure virtual |
Return a non-owning read-only framebuffer view, or null if unavailable.
Implemented in ersa::test::MockDisplay.
|
pure virtual |
Return a non-owning mutable framebuffer view, or null if unavailable. Direct access is an optimization; callers must still schedule refresh().
Implemented in ersa::test::MockDisplay.
|
pure virtual |
Measure text using the current font/size without drawing it.
| text | Null-terminated string to measure. |
| x | Baseline origin x coordinate. |
| y | Baseline origin y coordinate. |
| x1 | Receives the left edge relative to the supplied origin. |
| y1 | Receives the top edge relative to the supplied baseline. |
| w | Receives measured width in pixels. |
| h | Receives measured height in pixels. Callers should provide non-null output pointers supported by the driver. |
Implemented in ersa::test::MockDisplay.
|
pure virtual |
Return vertical logical resolution used by app coordinates.
Implemented in ersa::test::MockDisplay.
|
pure virtual |
Initialize the panel and its drawing buffer.
Implemented in ersa::test::MockDisplay.
|
pure virtual |
Return whether the panel is still processing a refresh.
Implemented in ersa::test::MockDisplay.
|
pure virtual |
Return the driver's current powered state; this does not imply the image is visible.
Implemented in ersa::test::MockDisplay.
|
pure virtual |
Put the panel or driver into its supported low-power state. Visible-image retention and controller-state retention are device-specific.
Implemented in ersa::test::MockDisplay.
|
pure virtual |
Restore a state usable for drawing or refresh; implementations may reinitialize hardware.
Implemented in ersa::test::MockDisplay.
|
pure virtual |
Draw a null-terminated string at the current cursor and return its consumed character count. The pointer is borrowed for this call only.
Implemented in ersa::test::MockDisplay.
|
pure virtual |
Draw a signed 32-bit value and return the number of characters consumed.
Implemented in ersa::test::MockDisplay.
|
pure virtual |
Draw an unsigned 32-bit value and return the number of characters consumed.
Implemented in ersa::test::MockDisplay.
|
pure virtual |
Draw an unsigned byte value and return the number of characters consumed.
Implemented in ersa::test::MockDisplay.
|
pure virtual |
Transmit the framebuffer to the panel.
| full | Request a full waveform when true; partial waveform otherwise. |
Implemented in ersa::test::MockDisplay.
|
pure virtual |
Update only the specified region when the panel supports partial refresh. Drivers without region updates may safely promote this to a full refresh.
Implemented in ersa::test::MockDisplay.
|
pure virtual |
Register a completion/wait callback for panel busy handling.
| cb | Callback invoked by the driver, or null to clear it. |
| userData | Opaque context passed back unchanged to cb. |
Implemented in ersa::test::MockDisplay.
|
pure virtual |
Set the text baseline origin used by subsequent print() calls.
Implemented in ersa::test::MockDisplay.
|
pure virtual |
Select an asset-level font name; drivers map it to their own font data.
Implemented in ersa::test::MockDisplay.
|
pure virtual |
Set the color used by subsequent print() calls.
Implemented in ersa::test::MockDisplay.
|
inline |
Set legacy monochrome text color; nonzero maps to white.
|
pure virtual |
Set text scaling; size 1 is the backend's normal scale.
Implemented in ersa::test::MockDisplay.
|
pure virtual |
Control whether subsequent text wraps when it reaches the canvas edge.
Implemented in ersa::test::MockDisplay.
|
pure virtual |
Return horizontal logical resolution used by app coordinates.
Implemented in ersa::test::MockDisplay.