roo_display
API Documentation for roo_display
Loading...
Searching...
No Matches
device.cpp
Go to the documentation of this file.
2
3#include "roo_io/memory/fill.h"
4
5namespace roo_display {
6
8 if (pixel_count == 0) return;
9 static constexpr uint32_t kChunkSize = 64;
11
12 if (pixel_count < kChunkSize) {
13 roo_io::PatternFill<4>((roo::byte *)chunk, pixel_count,
14 (const roo::byte *)(&color));
16 return;
17 }
18
19 roo_io::PatternFill<4>((roo::byte *)chunk, kChunkSize,
20 (const roo::byte *)(&color));
21
23 if (remainder > 0) {
25 }
26
28 while (full_blocks-- > 0) {
30 }
31}
32
33void DisplayOutput::drawDirectRect(const roo::byte *data,
39 if (src_x1 < src_x0 || src_y1 < src_y0) return;
40
41 static constexpr int16_t kTileSize = 8;
42 Color buffer[kTileSize * kTileSize];
43
44 for (int16_t y = src_y0; y <= src_y1; y += kTileSize) {
45 int16_t tile_h = src_y1 - y + 1;
47 for (int16_t x = src_x0; x <= src_x1; x += kTileSize) {
48 int16_t tile_w = src_x1 - x + 1;
50 color_format.decode(data, row_width_bytes, x, y, x + tile_w - 1,
51 y + tile_h - 1, buffer);
56
59 write(buffer, tile_w * tile_h);
60 }
61 }
62}
63
72
73} // namespace roo_display
ARGB8888 color stored as a 32-bit unsigned integer.
Definition color.h:16
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().
Definition device.cpp:64
virtual void write(Color *color, uint32_t pixel_count)=0
Write pixels into the current address window.
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.
Definition device.cpp:33
virtual void fill(Color color, uint32_t pixel_count)
Write pixel_count copies of the same color into the current address window.
Definition device.cpp:7
void setAddress(const Box &bounds, BlendingMode blending_mode)
Convenience overload for setAddress() using a Box.
Definition device.h:45
Defines 140 opaque HTML named colors.
@ kSource
The new ARGB8888 value completely replaces the old one.