22 offscreen_(bounds,
color::Transparent),
23 mask_(offscreen_.buffer(), bounds),
24 mask_filter_(output, &mask_) {}
46 for (
int i = 0;
i < count;
i++) {
50 if (!clipped.
empty()) {
62 for (
int i = 0;
i < count;
i++) {
66 if (!clipped.
empty()) {
123 const ColorFormat& color_format_;
Axis-aligned integer rectangle.
int16_t xMin() const
Minimum x (inclusive).
bool empty() const
Return whether the box is empty.
Box translate(int16_t x_offset, int16_t y_offset) const
Return a translated copy of this box.
bool contains(int16_t x, int16_t y) const
Return whether the point (x, y) lies within the box.
static Box Intersect(const Box &a, const Box &b)
Return the intersection of two boxes (may be empty).
int16_t yMin() const
Minimum y (inclusive).
Filtering device that applies a clip mask.
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 fillPixels(BlendingMode mode, Color color, int16_t *x, int16_t *y, uint16_t pixel_count) override
Draw the specified pixels using the same color. Invalidates the address window.
Binary clip mask using a packed bit buffer.
const Box & bounds() const
Return mask bounds.
ARGB8888 color stored as a 32-bit unsigned integer.
The abstraction for drawing to a display.
void fillRect(BlendingMode blending_mode, const Box &rect, Color color)
Fill a single rectangle. Invalidates the address window.
virtual void fill(Color color, uint32_t pixel_count)
Write pixel_count copies of the same color into the current address window.
Writer that ensures front-most pixels are written first.
const ColorFormat & getColorFormat() const override
Return the native color format used by this device for direct drawing.
void writeRects(BlendingMode 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 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 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 fillPixels(BlendingMode mode, Color color, int16_t *x, int16_t *y, uint16_t pixel_count) override
Draw the specified pixels using the same color. Invalidates the address window.
void fillRects(BlendingMode 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 *color, int16_t *x, int16_t *y, uint16_t pixel_count) override
Draw the specified pixels (per-pixel colors). Invalidates the address window.
FrontToBackWriter(DisplayOutput &output, Box bounds)
Construct a front-to-back writer for a given bounds rectangle.
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 fillPixels(BlendingMode mode, Color color, int16_t *x, int16_t *y, uint16_t pixel_count) override
Draw the specified pixels using the same color. Invalidates the address window.
Box extents() const override
Return the bounding box encompassing all pixels that need to be drawn.
const OffscreenDevice< ColorMode, pixel_order, byte_order, pixels_per_byte, storage_type > & output() const
static constexpr auto Black
Defines 140 opaque HTML named colors.
BlendingMode
Porter-Duff style blending modes.