|
roo_display
API Documentation for roo_display
|
Base class for display device drivers. More...
#include <device.h>
Public Member Functions | |
| virtual | ~DisplayDevice () |
| virtual void | init () |
| Initialize the display driver. | |
| void | setOrientation (Orientation orientation) |
| Set the orientation of the display. | |
| virtual void | orientationUpdated () |
Invoked when orientation() is updated. | |
| 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. | |
| virtual void | setBgColorHint (Color bgcolor) |
| Provide a background color hint for source-over blending. | |
Public Member Functions inherited from roo_display::DisplayOutput | |
| virtual | ~DisplayOutput () |
| virtual void | begin () |
| Enter a write transaction. | |
| virtual void | end () |
| Finalize the previously entered write transaction, flushing any pending writes. | |
| virtual void | flush () |
| Wait until pending asynchronous drawing operations complete. | |
| void | setAddress (const Box &bounds, BlendingMode blending_mode) |
Convenience overload for setAddress() using a Box. | |
| virtual void | setAddress (uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, BlendingMode blending_mode)=0 |
Set a rectangular window filled by subsequent calls to write(). | |
| virtual void | write (Color *color, uint32_t pixel_count)=0 |
| Write pixels into the current address window. | |
| virtual void | fill (Color color, uint32_t pixel_count) |
Write pixel_count copies of the same color into the current address window. | |
| virtual void | writePixels (BlendingMode blending_mode, Color *color, int16_t *x, int16_t *y, uint16_t pixel_count)=0 |
| Draw the specified pixels (per-pixel colors). Invalidates the address window. | |
| virtual void | fillPixels (BlendingMode blending_mode, Color color, int16_t *x, int16_t *y, uint16_t pixel_count)=0 |
| Draw the specified pixels using the same color. Invalidates the address window. | |
| virtual void | writeRects (BlendingMode blending_mode, Color *color, int16_t *x0, int16_t *y0, int16_t *x1, int16_t *y1, uint16_t count)=0 |
| Draw the specified rectangles (per-rectangle colors). Invalidates the address window. | |
| virtual void | fillRects (BlendingMode blending_mode, Color color, int16_t *x0, int16_t *y0, int16_t *x1, int16_t *y1, uint16_t count)=0 |
| Draw the specified rectangles using the same color. Invalidates the address window. | |
| 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. | |
| virtual const ColorFormat & | getColorFormat () const =0 |
| Return the native color format used by this device for direct drawing. | |
| virtual 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) |
| Draw a rectangle represented in the device's native color format. | |
| virtual 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) |
| Asynchronous variant of drawDirectRect(). | |
Protected Member Functions | |
| DisplayDevice (int16_t raw_width, int16_t raw_height) | |
| DisplayDevice (Orientation orientation, int16_t raw_width, int16_t raw_height) | |
Base class for display device drivers.
In addition to the drawing methods, exposes initialization and configuration APIs for the display.
The access pattern supports a notion of a transaction (which may, but does not have to, map to the underlying hardware transaction). The transaction begins with a call to begin() and ends with a call to end(). Calls to DisplayOutput methods are allowed only within the transaction. The driver may defer writes, but they must be flushed on end().
|
inlinevirtual |
|
inlineprotected |
|
inline |
Return the display height in the current orientation.
Definition at line 270 of file device.h.
References roo_display::Orientation::isXYswapped(), orientation(), raw_height(), and raw_width().
Referenced by roo_display::TouchDisplay::getTouch(), and roo_display::Display::resetExtents().
|
inline |
Return the display width in the current orientation.
Definition at line 265 of file device.h.
References roo_display::Orientation::isXYswapped(), orientation(), raw_height(), and raw_width().
Referenced by roo_display::TouchDisplay::getTouch(), and roo_display::Display::resetExtents().
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 in roo_display::AddrWindowDevice< Target >, roo_display::AddrWindowDevice< pinLcdCs, pinLcdDc, -1 >, roo_display::BufferedAddrWindowDevice< Target >, and roo_display::BackgroundFillOptimizerDevice.
Definition at line 232 of file device.h.
Referenced by roo_display::Display::init(), and roo_display::BackgroundFillOptimizerDevice::init().
|
inline |
Return the current orientation of the display.
Definition at line 250 of file device.h.
Referenced by roo_display::BackgroundFillOptimizerDevice::BackgroundFillOptimizerDevice(), roo_display::OffscreenDevice< ColorMode, pixel_order, byte_order, pixels_per_byte, storage_type >::drawDirectRect(), roo_display::OffscreenDevice< ColorMode, pixel_order, byte_order, pixels_per_byte, storage_type >::drawDirectRectAsync(), effective_height(), effective_width(), roo_display::TouchDisplay::getTouch(), roo_display::AddrWindowDevice< Target >::init(), roo_display::AddrWindowDevice< Target >::orientationUpdated(), roo_display::BufferedAddrWindowDevice< Target >::orientationUpdated(), roo_display::BackgroundFillOptimizerDevice::orientationUpdated(), and setOrientation().
Invoked when orientation() is updated.
Devices that support orientation change should override this method.
Reimplemented in roo_display::OffscreenDevice< ColorMode, pixel_order, byte_order, pixels_per_byte, storage_type >, roo_display::OffscreenDevice< ColorMode, ColorPixelOrder::kMsbFirst, roo_io::kBigEndian, ColorTraits< ColorMode >::pixels_per_byte, ColorStorageType< ColorMode > >, roo_display::OffscreenDevice< Monochrome, ColorPixelOrder::kMsbFirst, roo_io::kBigEndian, ColorTraits< Monochrome >::pixels_per_byte, ColorStorageType< Monochrome > >, roo_display::OffscreenDevice< typename Target::ColorMode >, roo_display::AddrWindowDevice< Target >, roo_display::AddrWindowDevice< pinLcdCs, pinLcdDc, -1 >, roo_display::BufferedAddrWindowDevice< Target >, and roo_display::BackgroundFillOptimizerDevice.
Definition at line 245 of file device.h.
References roo_display::Orientation::Default().
Referenced by roo_display::BackgroundFillOptimizerDevice::orientationUpdated(), and setOrientation().
|
inline |
Return the height of the display in its native orientation.
This value does not depend on the current orientation, and is stable even before init() is called.
Definition at line 262 of file device.h.
Referenced by roo_display::Display::area(), effective_height(), effective_width(), and roo_display::OffscreenDevice< ColorMode, pixel_order, byte_order, pixels_per_byte, storage_type >::raster().
|
inline |
Return the width of the display in its native orientation.
This value does not depend on the current orientation, and is stable even before init() is called.
Definition at line 256 of file device.h.
Referenced by roo_display::Display::area(), roo_display::OffscreenDevice< ColorMode, pixel_order, byte_order, pixels_per_byte, storage_type >::drawDirectRect(), roo_display::OffscreenDevice< ColorMode, pixel_order, byte_order, pixels_per_byte, storage_type >::drawDirectRectAsync(), effective_height(), effective_width(), and roo_display::OffscreenDevice< ColorMode, pixel_order, byte_order, pixels_per_byte, storage_type >::raster().
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 in roo_display::BackgroundFillOptimizerDevice, roo_display::AddrWindowDevice< Target >, and roo_display::AddrWindowDevice< pinLcdCs, pinLcdDc, -1 >.
Definition at line 280 of file device.h.
Referenced by roo_display::Display::setBackgroundColor(), and roo_display::BackgroundFillOptimizerDevice::setBgColorHint().
|
inline |
Set the orientation of the display.
Definition at line 235 of file device.h.
References orientation(), and orientationUpdated().
Referenced by roo_display::BackgroundFillOptimizerDevice::BackgroundFillOptimizerDevice().