339 Color *output)
const = 0;
347 Color *output)
const = 0;
363 transparency_(CalculateTransparency(
mode)) {}
384 roo_io::ByteOrder byte_order_;
Axis-aligned integer rectangle.
int16_t xMin() const
Minimum x (inclusive).
int16_t xMax() const
Maximum x (inclusive).
int16_t yMax() const
Maximum y (inclusive).
int16_t yMin() const
Minimum y (inclusive).
ARGB8888 color stored as a 32-bit unsigned integer.
Base class for display device drivers.
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_height() const
Return the display height in the current orientation.
virtual void init()
Initialize the display driver.
DisplayDevice(int16_t raw_width, int16_t raw_height)
Orientation orientation() const
Return the current orientation of the display.
int16_t effective_width() const
Return the display width in the current orientation.
void setOrientation(Orientation orientation)
Set the orientation of the display.
virtual void orientationUpdated()
Invoked when orientation() is updated.
DisplayDevice(Orientation orientation, int16_t raw_width, int16_t raw_height)
virtual void setBgColorHint(Color bgcolor)
Provide a background color hint for source-over blending.
The abstraction for drawing to a display.
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.
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().
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 write(Color *color, uint32_t pixel_count)=0
Write pixels into the current address window.
virtual void flush()
Wait until pending asynchronous drawing operations complete.
virtual void end()
Finalize the previously entered write transaction, flushing any pending writes.
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.
void fillRect(BlendingMode blending_mode, const Box &rect, Color color)
Fill a single rectangle. Invalidates the address window.
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 begin()
Enter a write transaction.
virtual void fill(Color color, uint32_t pixel_count)
Write pixel_count copies of the same color into the current 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 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.
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 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.
Represents the orientation of a display device.
static constexpr Orientation Default()
Return the default orientation (RightDown).
bool isXYswapped() const
Return whether x maps to the vertical direction.
Touch controller interface.
virtual ~TouchDevice()=default
virtual void initTouch()
Initialize the touch controller.
virtual TouchResult getTouch(TouchPoint *points, int max_points)=0
Read the current touch state.
Defines 140 opaque HTML named colors.
BlendingMode
Porter-Duff style blending modes.
@ kSource
The new ARGB8888 value completely replaces the old one.
TransparencyMode
Transparency information for a stream or color mode.
@ kNone
All colors are fully opaque.
@ kFull
Colors may include partial transparency (alpha channel).
BlendingMode blending_mode
A single touch point returned by a touch controller.
int16_t x
X-coordinate of the touch.
int16_t y
Y-coordinate of the touch.
uint16_t id
ID assigned by the driver, for tracking. For non-multitouch devices, this should be left at zero.
int32_t vy
Y-axis velocity at the touch point, in pixels/sec.
int16_t z
Z-coordinate of the touch (pressure). Range [0-4095]. Drivers that don't support it should report 102...
int32_t vx
X-axis velocity at the touch point, in pixels/sec.
Metadata for a touch sampling result.
TouchResult(roo_time::Uptime timestamp, int touch_points)
roo_time::Uptime timestamp
Detection time.