|
roo_display
API Documentation for roo_display
|
#include <addr_window_device.h>
Public Types | |
| using | ColorMode = typename Target::ColorMode |
| using | raw_color_type = roo::byte[kBytesPerPixel] |
Public Member Functions | |
| AddrWindowDevice (Orientation orientation, uint16_t width, uint16_t height) | |
| AddrWindowDevice (uint16_t width, uint16_t height) | |
| AddrWindowDevice (Target target) | |
| template<typename... Args> | |
| AddrWindowDevice (Args &&... args) | |
| template<typename... Args> | |
| AddrWindowDevice (Orientation orientation, Args &&... args) | |
| AddrWindowDevice (Orientation orientation, Target target) | |
| ~AddrWindowDevice () override | |
| void | init () override |
| Initialize the display driver. | |
| void | begin () override |
| Enter a write transaction. | |
| void | end () override |
| Finalize the previously entered write transaction, flushing any pending writes. | |
| void | setBgColorHint (Color bgcolor) override |
| Provide a background color hint for source-over blending. | |
| void | setAddress (uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, BlendingMode mode) override |
Set a rectangular window filled by subsequent calls to write(). | |
| void | write (Color *color, uint32_t pixel_count) override |
| Write pixels into the current address window. | |
| void | fill (Color color, uint32_t pixel_count) override |
Write pixel_count copies of the same color into the current address window. | |
| void | writeRects (BlendingMode blending_mode, Color *color, int16_t *x0, int16_t *y0, int16_t *x1, int16_t *y1, uint16_t count) override |
| Draw the specified rectangles (per-rectangle colors). Invalidates the address window. | |
| void | fillRects (BlendingMode blending_mode, Color color, int16_t *x0, int16_t *y0, int16_t *x1, int16_t *y1, uint16_t count) override |
| Draw the specified rectangles using the same color. Invalidates the address window. | |
| void | writePixels (BlendingMode mode, Color *colors, int16_t *xs, int16_t *ys, uint16_t pixel_count) override |
| Draw the specified pixels (per-pixel colors). Invalidates the address window. | |
| void | fillPixels (BlendingMode blending_mode, Color color, int16_t *xs, int16_t *ys, uint16_t pixel_count) override |
| Draw the specified pixels using the same color. Invalidates the address window. | |
| const ColorFormat & | getColorFormat () const override |
| Return the native color format used by this device for direct drawing. | |
| const ColorMode & | color_mode () const |
| void | drawDirectRect (const roo::byte *data, size_t row_width_bytes, int16_t src_x0, int16_t src_y0, int16_t src_x1, int16_t src_y1, int16_t dst_x0, int16_t dst_y0) override |
| Draw a rectangle represented in the device's native color format. | |
| void | drawDirectRectAsync (const roo::byte *data, size_t row_width_bytes, int16_t src_x0, int16_t src_y0, int16_t src_x1, int16_t src_y1, int16_t dst_x0, int16_t dst_y0) override |
| Asynchronous variant of drawDirectRect(). | |
| void | flush () override |
| Wait until pending asynchronous drawing operations complete. | |
| void | orientationUpdated () override |
Invoked when orientation() is updated. | |
Public Member Functions inherited from roo_display::DisplayDevice | |
| virtual | ~DisplayDevice () |
| void | setOrientation (Orientation orientation) |
| Set the orientation of the display. | |
| Orientation | orientation () const |
| Return the current orientation of the display. | |
| int16_t | raw_width () const |
| Return the width of the display in its native orientation. | |
| int16_t | raw_height () const |
| Return the height of the display in its native orientation. | |
| int16_t | effective_width () const |
| Return the display width in the current orientation. | |
| int16_t | effective_height () const |
| Return the display height in the current orientation. | |
Public Member Functions inherited from roo_display::DisplayOutput | |
| virtual | ~DisplayOutput () |
| void | setAddress (const Box &bounds, BlendingMode blending_mode) |
Convenience overload for setAddress() using a Box. | |
| void | fillRect (BlendingMode blending_mode, const Box &rect, Color color) |
| Fill a single rectangle. Invalidates the address window. | |
| void | fillRect (BlendingMode blending_mode, int16_t x0, int16_t y0, int16_t x1, int16_t y1, Color color) |
| Fill a single rectangle. Invalidates the address window. | |
| void | fillRect (int16_t x0, int16_t y0, int16_t x1, int16_t y1, Color color) |
Fill a single rectangle using BlendingMode::kSource. | |
Static Public Attributes | |
| static constexpr ColorPixelOrder | pixel_order = ColorPixelOrder::kMsbFirst |
| static constexpr ByteOrder | byte_order = Target::byte_order |
| static constexpr int | kBytesPerPixel |
Protected Attributes | |
| Target | target_ |
| bool | initialized_ |
Additional Inherited Members | |
Protected Member Functions inherited from roo_display::DisplayDevice | |
| DisplayDevice (int16_t raw_width, int16_t raw_height) | |
| DisplayDevice (Orientation orientation, int16_t raw_width, int16_t raw_height) | |
Definition at line 55 of file addr_window_device.h.
| using roo_display::AddrWindowDevice< Target >::ColorMode = typename Target::ColorMode |
Definition at line 57 of file addr_window_device.h.
| using roo_display::AddrWindowDevice< Target >::raw_color_type = roo::byte[kBytesPerPixel] |
Definition at line 62 of file addr_window_device.h.
|
inline |
Definition at line 64 of file addr_window_device.h.
|
inline |
Definition at line 67 of file addr_window_device.h.
|
inline |
Definition at line 70 of file addr_window_device.h.
|
inline |
Definition at line 74 of file addr_window_device.h.
|
inline |
Definition at line 79 of file addr_window_device.h.
|
inline |
Definition at line 82 of file addr_window_device.h.
|
inlineoverride |
Definition at line 89 of file addr_window_device.h.
|
inlineoverridevirtual |
Enter a write transaction.
Normally called by the DrawingContext constructor, and does not need to be called explicitly.
Reimplemented from roo_display::DisplayOutput.
Definition at line 99 of file addr_window_device.h.
References roo_display::AddrWindowDevice< Target >::target_.
|
inline |
Definition at line 243 of file addr_window_device.h.
Referenced by roo_display::AddrWindowDevice< Target >::getColorFormat().
|
inlineoverridevirtual |
Draw a rectangle represented in the device's native color format.
Source data pointer correspond to the (0, 0) point in the source coordinate system, with stride of row_width_bytes. The source rectangle at (src_x0, src_y0, src_x1, src_y1) relative to the data pointer, gets copied to the destination rectangle with top-left corner at (dst_x0, dst_y0). The caller must ensure that the destination rectangle fits within the device's bounds.
The default implementation processes the rectangle by small tiles, converting the data to an array of regular colors, and calling regular window functions to draw them. Specific devices can override this method to provide a more efficient implementation that draws directly from the source data.
Reimplemented from roo_display::DisplayOutput.
Definition at line 248 of file addr_window_device.h.
References roo_display::DisplayOutput::drawDirectRect(), roo_display::AddrWindowDevice< Target >::kBytesPerPixel, and roo_display::AddrWindowDevice< Target >::target_.
|
inlineoverridevirtual |
Asynchronous variant of drawDirectRect().
This method may continue executing after it returns. The caller must keep data valid until any subsequent drawing method call or until flush() is called.
The default implementation calls drawDirectRect() synchronously.
Reimplemented from roo_display::DisplayOutput.
Definition at line 280 of file addr_window_device.h.
|
inlineoverridevirtual |
Finalize the previously entered write transaction, flushing any pending writes.
Normally called by the DrawingContext destructor, and does not need to be called explicitly.
Reimplemented from roo_display::DisplayOutput.
Definition at line 101 of file addr_window_device.h.
References roo_display::AddrWindowDevice< Target >::target_.
|
inlineoverridevirtual |
Write pixel_count copies of the same color into the current address window.
The same preconditions as write() apply: the address must be set via setAddress() and not invalidated by any of the write* / fill* methods. Otherwise, the behavior is undefined.
Default implementation falls back to chunked write(). Drivers and filters can override this for a more efficient single-color path.
Reimplemented from roo_display::DisplayOutput.
Definition at line 128 of file addr_window_device.h.
References color, and roo_display::AddrWindowDevice< Target >::target_.
|
inlineoverridevirtual |
Draw the specified pixels using the same color. Invalidates the address window.
| blending_mode | Blending mode used for drawing. |
| color | The color to use for all pixels. |
| x | Pointer to x-coordinates for each pixel. |
| y | Pointer to y-coordinates for each pixel. |
| pixel_count | Number of pixels. |
Implements roo_display::DisplayOutput.
Definition at line 202 of file addr_window_device.h.
References blending_mode, color, roo_display::Compactor::DOWN, roo_display::Compactor::drawPixels(), roo_display::Compactor::LEFT, roo_display::Compactor::RIGHT, roo_display::AddrWindowDevice< Target >::target_, and roo_display::Compactor::UP.
|
inlineoverridevirtual |
Draw the specified rectangles using the same color. Invalidates the address window.
| blending_mode | Blending mode used for drawing. |
| color | The color to use for all rectangles. |
| x0 | Pointer to left coordinates for each rectangle. |
| y0 | Pointer to top coordinates for each rectangle. |
| x1 | Pointer to right coordinates for each rectangle. |
| y1 | Pointer to bottom coordinates for each rectangle. |
| count | Number of rectangles. |
Implements roo_display::DisplayOutput.
Definition at line 152 of file addr_window_device.h.
References blending_mode, color, and roo_display::AddrWindowDevice< Target >::target_.
|
inlineoverridevirtual |
Wait until pending asynchronous drawing operations complete.
Implementations that perform deferred writes should override this method and block until it is safe to reuse source buffers passed to async drawing APIs.
Reimplemented from roo_display::DisplayOutput.
Definition at line 288 of file addr_window_device.h.
References roo_display::AddrWindowDevice< Target >::target_.
|
inlineoverridevirtual |
Return the native color format used by this device for direct drawing.
Implements roo_display::DisplayOutput.
Definition at line 235 of file addr_window_device.h.
References roo_display::AddrWindowDevice< Target >::color_mode(), and roo_display::kMsbFirst.
|
inlineoverridevirtual |
Initialize the display driver.
Must be called once before any DisplayOutput methods are used. Can be called later to re-initialize the display to default settings. Must be called outside a transaction.
Reimplemented from roo_display::DisplayDevice.
Definition at line 91 of file addr_window_device.h.
References roo_display::AddrWindowDevice< Target >::initialized_, roo_display::DisplayDevice::orientation(), and roo_display::AddrWindowDevice< Target >::target_.
|
inlineoverridevirtual |
Invoked when orientation() is updated.
Devices that support orientation change should override this method.
Reimplemented from roo_display::DisplayDevice.
Definition at line 290 of file addr_window_device.h.
References roo_display::AddrWindowDevice< Target >::initialized_, roo_display::DisplayDevice::orientation(), and roo_display::AddrWindowDevice< Target >::target_.
|
inlineoverridevirtual |
Set a rectangular window filled by subsequent calls to write().
| x0 | Left coordinate (inclusive). |
| y0 | Top coordinate (inclusive). |
| x1 | Right coordinate (inclusive). |
| y1 | Bottom coordinate (inclusive). |
| blending_mode | Blending mode for subsequent writes. |
Implements roo_display::DisplayOutput.
Definition at line 105 of file addr_window_device.h.
References roo_display::AddrWindowDevice< Target >::target_.
|
inlineoverridevirtual |
Provide a background color hint for source-over blending.
Devices that support BlendingMode::kSourceOver should ignore this hint. Devices that do not support alpha blending (e.g. hardware can't read the framebuffer) should use this color as the assumed background for writes using BlendingMode::kSourceOver.
Reimplemented from roo_display::DisplayDevice.
Definition at line 103 of file addr_window_device.h.
References bgcolor.
|
inlineoverridevirtual |
Write pixels into the current address window.
The address must be set via setAddress() and not invalidated by any of the write* / fill* methods. Otherwise, the behavior is undefined.
| color | Pointer to source pixels. |
| pixel_count | Number of pixels to write. |
Implements roo_display::DisplayOutput.
Definition at line 112 of file addr_window_device.h.
References color, roo_display::AddrWindowDevice< Target >::kBytesPerPixel, and roo_display::AddrWindowDevice< Target >::target_.
Referenced by roo_display::AddrWindowDevice< Target >::writePixels().
|
inlineoverridevirtual |
Draw the specified pixels (per-pixel colors). Invalidates the address window.
| blending_mode | Blending mode used for drawing. |
| color | Pointer to colors for each pixel. |
| x | Pointer to x-coordinates for each pixel. |
| y | Pointer to y-coordinates for each pixel. |
| pixel_count | Number of pixels. |
Implements roo_display::DisplayOutput.
Definition at line 169 of file addr_window_device.h.
References roo_display::Compactor::DOWN, roo_display::Compactor::drawPixels(), roo_display::Compactor::LEFT, roo_display::Compactor::RIGHT, roo_display::AddrWindowDevice< Target >::target_, roo_display::Compactor::UP, and roo_display::AddrWindowDevice< Target >::write().
|
inlineoverridevirtual |
Draw the specified rectangles (per-rectangle colors). Invalidates the address window.
| blending_mode | Blending mode used for drawing. |
| color | Pointer to colors for each rectangle. |
| x0 | Pointer to left coordinates for each rectangle. |
| y0 | Pointer to top coordinates for each rectangle. |
| x1 | Pointer to right coordinates for each rectangle. |
| y1 | Pointer to bottom coordinates for each rectangle. |
| count | Number of rectangles. |
Implements roo_display::DisplayOutput.
Definition at line 134 of file addr_window_device.h.
References blending_mode, color, and roo_display::AddrWindowDevice< Target >::target_.
|
staticconstexpr |
Definition at line 59 of file addr_window_device.h.
|
protected |
Definition at line 300 of file addr_window_device.h.
Referenced by roo_display::AddrWindowDevice< Target >::init(), and roo_display::AddrWindowDevice< Target >::orientationUpdated().
|
staticconstexpr |
Definition at line 60 of file addr_window_device.h.
Referenced by roo_display::AddrWindowDevice< Target >::drawDirectRect(), and roo_display::AddrWindowDevice< Target >::write().
|
staticconstexpr |
Definition at line 58 of file addr_window_device.h.
|
protected |
Definition at line 299 of file addr_window_device.h.
Referenced by roo_display::AddrWindowDevice< Target >::begin(), roo_display::AddrWindowDevice< Target >::drawDirectRect(), roo_display::AddrWindowDevice< Target >::end(), roo_display::AddrWindowDevice< Target >::fill(), roo_display::AddrWindowDevice< Target >::fillPixels(), roo_display::AddrWindowDevice< Target >::fillRects(), roo_display::AddrWindowDevice< Target >::flush(), roo_display::AddrWindowDevice< Target >::init(), roo_display::AddrWindowDevice< Target >::orientationUpdated(), roo_display::AddrWindowDevice< Target >::setAddress(), roo_display::AddrWindowDevice< Target >::write(), roo_display::AddrWindowDevice< Target >::writePixels(), and roo_display::AddrWindowDevice< Target >::writeRects().