13#include "roo_io/memory/fill.h"
14#include "roo_io/memory/store.h"
80 bool eof()
const {
return cursor_y_ > y1_; }
129template <
typename ColorMode,
131 ByteOrder byte_order = roo_io::kBigEndian,
132 int8_t pixels_per_byte = ColorTraits<ColorMode>::pixels_per_byte,
133 typename storage_type = ColorStorageType<ColorMode>>
145 color_format_(color_mode_),
154 color_mode_(std::move(
other.color_mode_)),
155 color_format_(color_mode_),
156 buffer_(
other.buffer_),
157 orienter_(
other.orienter_),
158 window_(
other.window_),
159 blending_mode_(
other.blending_mode_) {
160 other.buffer_ =
nullptr;
183 void end()
override { awaitAsyncBlit(); }
197 constexpr size_t kBytesPerPixel =
199 size_t copy_row_bytes =
static_cast<size_t>(width) * kBytesPerPixel;
201 static_cast<size_t>(
raw_width()) * kBytesPerPixel;
205 static_cast<size_t>(
src_x0) * kBytesPerPixel;
208 static_cast<size_t>(
dst_x0) * kBytesPerPixel;
211 static_cast<size_t>(height));
231 static_cast<size_t>(height));
251 static_cast<size_t>(
src_x0) * kBytesPerPixel),
253 static_cast<size_t>(width) * kBytesPerPixel),
257 void operator()(roo::byte*
p,
uint32_t offset) {
258 roo::byte* dst =
p + offset * kBytesPerPixel;
259 std::memcpy(dst,
src_row_, kBytesPerPixel);
298 void operator()(roo::byte*
p,
uint32_t offset) {
349 constexpr size_t kBytesPerPixel =
351 size_t copy_row_bytes =
static_cast<size_t>(width) * kBytesPerPixel;
353 static_cast<size_t>(
raw_width()) * kBytesPerPixel;
357 static_cast<size_t>(
src_x0) * kBytesPerPixel;
360 static_cast<size_t>(
dst_x0) * kBytesPerPixel;
391 void flush()
override { awaitAsyncBlit(); }
435 const roo::byte*
buffer()
const {
return buffer_; }
443 template <
typename,
typename, ColorPixelOrder, ByteOrder>
446 template <
typename Writer>
448 while (count-- > 0) {
457 int16_t* y0, int16_t* x1, int16_t* y1, uint16_t count);
460 int16_t* y0, int16_t* x1, uint16_t count);
463 int16_t* y0, int16_t* y1, uint16_t count);
465 ColorMode color_mode_;
466 internal::ColorFormatImpl<ColorMode, byte_order, pixel_order> color_format_;
471 internal::Orienter orienter_;
474 internal::AddressWindow window_;
486template <
typename ColorMode,
488 ByteOrder byte_order = roo_io::kBigEndian,
489 int8_t pixels_per_byte = ColorTraits<ColorMode>::pixels_per_byte,
490 typename storage_type = ColorStorageType<ColorMode>>
519 owns_buffer_(
false) {}
541 (ColorMode::bits_per_pixel *
extents.
area() + 7) / 8);
578 if (owns_buffer_)
delete[]
output().buffer();
582 : device_(std::move(
other.device_)),
583 raster_(device_.raster(
other.extents_.xMin(),
other.extents_.yMin())),
584 extents_(
other.extents_),
585 anchor_extents_(
other.anchor_extents_),
586 owns_buffer_(
other.owns_buffer_) {
587 other.owns_buffer_ =
false;
600 return raster().getTransparencyMode();
608 const OffscreenDevice<ColorMode, pixel_order, byte_order, pixels_per_byte,
635 void drawTo(
const Surface&
s)
const override {
s.drawObject(
raster()); }
639 void unnest()
const {}
640 Color getBackgroundColor()
const {
return color::Transparent; }
641 const Rasterizable* getRasterizableBackground()
const {
return nullptr; }
642 int16_t dx()
const {
return -raster_.extents().xMin(); }
643 int16_t dy()
const {
return -raster_.extents().yMin(); }
644 bool is_write_once()
const {
return false; }
648 OffscreenDevice<ColorMode, pixel_order, byte_order, pixels_per_byte,
661template <
typename Device,
typename... Args>
663 ->
Offscreen<
typename Device::ColorMode, Device::pixel_order,
664 Device::byte_order> {
665 return Offscreen<
typename Device::ColorMode, Device::pixel_order,
666 Device::byte_order>(std::forward<Args>(
args)...,
667 device.color_mode());
731 uint8_t pixels_per_byte = ColorTraits<ColorMode>::pixels_per_byte,
732 typename storage_type = ColorStorageType<ColorMode>>
736 : color_mode_(color_mode), color_(
color) {}
741 roo::byte*
target =
p + offset / pixels_per_byte;
751 roo::byte*
target =
p + offset / pixels_per_byte;
752 while (count-- > 0) {
765 ColorMode& color_mode_;
776 : color_mode_(color_mode), color_(
color) {}
781 blender(
p + offset * kBytesPerPixel, *color_++, color_mode_);
786 roo::byte*
cursor =
p + offset * kBytesPerPixel;
788 while (count-- > 0) {
795 const ColorMode& color_mode_;
799template <
typename ColorMode, ColorPixelOrder pixel_order, ByteOrder
byte_order>
801 template <BlendingMode blending_mode>
892 roo::byte*
target =
p + offset / pixels_per_byte;
895 *color_++, color_mode_);
902 roo::byte*
target =
p + offset / pixels_per_byte;
904 while (count-- > 0) {
907 *color_++, color_mode_);
917 ColorMode& color_mode_;
924 typename storage_type>
934 blending_mode_,
p + offset * kBytesPerPixel, *color_++, color_mode_);
939 roo::byte*
cursor =
p + offset * kBytesPerPixel;
940 while (count-- > 0) {
942 *color_++, color_mode_);
948 const ColorMode& color_mode_;
967 : color_mode_(color_mode), color_(
color) {}
972 roo::byte*
target =
p + offset / pixels_per_byte;
981 roo::byte*
target =
p + offset / pixels_per_byte;
983 while (count-- > 0) {
995 ColorMode& color_mode_;
1006 : color_mode_(color_mode), color_(
color) {}
1011 blender(
p + offset * kBytesPerPixel, color_, color_mode_);
1016 roo::byte*
cursor =
p + offset * kBytesPerPixel;
1018 while (count-- > 0) {
1020 cursor += kBytesPerPixel;
1025 const ColorMode& color_mode_;
1033 uint8_t pixels_per_byte,
typename storage_type>
1039 : color_mode_(color_mode),
1040 raw_color_(color_mode_.fromArgbColor(
color)),
1041 raw_color_full_byte_(
1042 SubByteColorIo<ColorMode, pixel_order>().expandRaw(raw_color_)) {}
1046 io.storeRaw(raw_color_,
p + offset / pixels_per_byte,
1047 offset % pixels_per_byte);
1053 roo::byte*
target =
p + offset / pixels_per_byte;
1056 if (count-- == 0)
return;
1064 (
const roo::byte*)&raw_color_full_byte_);
1065 count = count % pixels_per_byte;
1073 ColorMode& color_mode_;
1075 roo::byte raw_color_full_byte_;
1080 typename storage_type>
1085 : color_mode_(color_mode) {
1090 roo_io::PatternWrite<ColorMode::bits_per_pixel / 8>(
1091 p + offset * ColorMode::bits_per_pixel / 8, raw_color_);
1095 roo_io::PatternFill<ColorMode::bits_per_pixel / 8>(
1096 p + offset * ColorMode::bits_per_pixel / 8, count, raw_color_);
1100 const ColorMode& color_mode_;
1101 roo::byte raw_color_[ColorMode::bits_per_pixel / 8];
1105 if (cursor_x_ < x1_) {
1107 offset_ += advance_x_;
1111 offset_ += advance_x_;
1112 offset_ += advance_y_;
1120 offset_ += advance_x_ * count;
1124 offset_ += advance_y_;
1129 count = count %
width();
1135 offset_ += advance_x_ * count;
1138template <
typename ColorMode, ColorPixelOrder pixel_order, ByteOrder
byte_order>
1140 template <BlendingMode blending_mode>
1161 roo::byte*
target =
p + offset / pixels_per_byte;
1170 roo::byte*
target =
p + offset / pixels_per_byte;
1172 while (count-- > 0) {
1175 color_, color_mode_);
1185 ColorMode& color_mode_;
1192 typename storage_type>
1202 blending_mode_,
p + offset * kBytesPerPixel, color_, color_mode_);
1207 roo::byte*
cursor =
p + offset * kBytesPerPixel;
1208 while (count-- > 0) {
1210 color_, color_mode_);
1211 cursor += kBytesPerPixel;
1216 const ColorMode& color_mode_;
1224 if (
color.isOpaque()) {
1243 }
else if (
color.a() == 0) {
1286 if (
color.isOpaque()) {
1311 }
else if (
color.a() == 0) {
1371 int8_t pixels_per_byte,
typename storage_type>
1372void OffscreenDevice<ColorMode, pixel_order, byte_order, pixels_per_byte,
1373 storage_type>::orientationUpdated() {
1375 orienter_.setOrientation(orientation());
1379 int8_t pixels_per_byte,
typename storage_type>
1380void OffscreenDevice<ColorMode, pixel_order, byte_order, pixels_per_byte,
1385 window_.setAddress(x0, y0, x1, y1, raw_width(), raw_height(),
1386 orienter_.orientation());
1408 int8_t pixels_per_byte,
typename storage_type>
1409void OffscreenDevice<ColorMode, pixel_order, byte_order, pixels_per_byte,
1430 color_mode_, blending_mode_,
color);
1458 int8_t pixels_per_byte,
typename storage_type>
1459void OffscreenDevice<ColorMode, pixel_order, byte_order, pixels_per_byte,
1465 roo::byte* buffer = buffer_;
1471 write(color_mode_,
color);
1473 write(buffer, *x++ + *y++ * w);
1482 write(color_mode_,
color);
1484 write(buffer, *x++ + *y++ * w);
1489 write(color_mode_,
color);
1491 write(buffer, *x++ + *y++ * w);
1497 write(buffer, *x++ + *y++ * w);
1522 int8_t pixels_per_byte,
typename storage_type>
1523void OffscreenDevice<ColorMode, pixel_order, byte_order, pixels_per_byte,
1529 roo::byte* buffer = buffer_;
1541 fill(color_mode_,
color);
1543 fill(buffer, *x++ + *y++ * w);
1548 fill(color_mode_,
color);
1550 fill(buffer, *x++ + *y++ * w);
1556 fill(buffer, *x++ + *y++ * w);
1566 int8_t pixels_per_byte,
typename storage_type>
1567void OffscreenDevice<ColorMode, pixel_order, byte_order, pixels_per_byte,
1573 orienter_.orientRects(x0, y0, x1, y1, count);
1579 while (count-- > 0) {
1585 int8_t pixels_per_byte,
typename storage_type>
1586void OffscreenDevice<ColorMode, pixel_order, byte_order, pixels_per_byte,
1592 orienter_.orientRects(x0, y0, x1, y1, count);
1600 }
else if (x0 == x1) {
1607template <
typename Filler>
1611 while (count-- > 0) {
1612 uint32_t offset = *x0 + *y0 * width;
1615 if (
my_w == width) {
1618 while (
my_h-- > 0) {
1619 fill(buffer, offset,
my_w);
1630template <
typename Filler>
1634 while (count-- > 0) {
1636 fill(buffer, *x0++ + *y0++ * width,
n);
1640template <
typename Filler>
1644 while (count-- > 0) {
1646 uint32_t offset = *x0++ + *y0++ * width;
1648 fill(buffer, offset);
1668 int8_t pixels_per_byte,
typename storage_type>
1669void OffscreenDevice<ColorMode, pixel_order, byte_order, pixels_per_byte,
1672 Color color, int16_t* x0,
1673 int16_t* y0, int16_t* x1,
1677 fillHlinesAbsolute(
blending_mode, color, x0, y0, x1, count);
1678 }
else if (x0 == x1) {
1679 fillVlinesAbsolute(
blending_mode, color, x0, y0, y1, count);
1681 int16_t w = raw_width();
1682 roo::byte* buffer = buffer_;
1684 typename internal::BlendingFiller<ColorMode, pixel_order, byte_order>::
1685 template Operator<BlendingMode::kSource>
1686 fill(color_mode_, color);
1689 typename internal::BlendingFiller<ColorMode, pixel_order, byte_order>::
1690 template Operator<BlendingMode::kSourceOverOpaque>
1691 fill(color_mode_, color);
1694 typename internal::BlendingFiller<ColorMode, pixel_order, byte_order>::
1695 template Operator<BlendingMode::kSourceOver>
1696 fill(color_mode_, color);
1699 internal::GenericFiller<ColorMode, pixel_order, byte_order> fill(
1720 int8_t pixels_per_byte,
typename storage_type>
1721void OffscreenDevice<ColorMode, pixel_order, byte_order, pixels_per_byte,
1724 Color color, int16_t* x0,
1725 int16_t* y0, int16_t* x1,
1727 roo::byte* buffer = buffer_;
1728 int16_t w = raw_width();
1730 typename internal::BlendingFiller<ColorMode, pixel_order, byte_order>::
1731 template Operator<BlendingMode::kSource>
1732 fill(color_mode_, color);
1735 typename internal::BlendingFiller<ColorMode, pixel_order, byte_order>::
1736 template Operator<BlendingMode::kSourceOverOpaque>
1737 fill(color_mode_, color);
1740 typename internal::BlendingFiller<ColorMode, pixel_order, byte_order>::
1741 template Operator<BlendingMode::kSourceOver>
1742 fill(color_mode_, color);
1745 internal::GenericFiller<ColorMode, pixel_order, byte_order> fill(
1770 int8_t pixels_per_byte,
typename storage_type>
1771void OffscreenDevice<ColorMode, pixel_order, byte_order, pixels_per_byte,
1774 Color color, int16_t* x0,
1775 int16_t* y0, int16_t* y1,
1777 roo::byte* buffer = buffer_;
1778 int16_t w = raw_width();
1780 typename internal::BlendingFiller<ColorMode, pixel_order, byte_order>::
1781 template Operator<BlendingMode::kSource>
1782 fill(color_mode_, color);
1785 typename internal::BlendingFiller<ColorMode, pixel_order, byte_order>::
1786 template Operator<BlendingMode::kSourceOverOpaque>
1787 fill(color_mode_, color);
1790 typename internal::BlendingFiller<ColorMode, pixel_order, byte_order>::
1791 template Operator<BlendingMode::kSourceOver>
1792 fill(color_mode_, color);
1795 internal::GenericFiller<ColorMode, pixel_order, byte_order> fill(
1808 DCHECK(x != y) <<
"orientPixels requires distinct x and y buffers";
1824 DCHECK(x0 != y0 && x1 != y1 && x0 != y1 && x1 != y0)
1825 <<
"orientRects disallows cross-axis aliasing";
1850 DCHECK(&x0 != &y0 && &x1 != &y1 && &x0 != &y1 && &x1 != &y0)
1851 <<
"OrientRects disallows cross-axis aliasing";
1876 while (count-- > 0) {
1882inline void Orienter::revertY(int16_t* y, uint16_t count) {
1883 int16_t yMax = yMax_;
1884 while (count-- > 0) {
BufferedRectWriter & writer
BitMaskOffscreen(Box extents, uint8_t *buffer)
BitMaskOffscreen(int16_t width, int16_t height, roo::byte *buffer)
BitMaskOffscreen(int16_t width, int16_t height, Color fillColor)
BitMaskOffscreen(int16_t width, int16_t height, uint8_t *buffer)
BitMaskOffscreen(int16_t width, int16_t height)
Axis-aligned integer rectangle.
int16_t width() const
Width in pixels (inclusive coordinates).
int16_t xMin() const
Minimum x (inclusive).
int16_t height() const
Height in pixels (inclusive coordinates).
int32_t area() const
Area in pixels.
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.
Orientation orientation() const
Return the current orientation of the display.
Interface for objects that can be drawn to an output device.
Primary top-level interface for drawing to screens, off-screen buffers, or other devices.
In-memory DisplayDevice backed by a pixel buffer.
ColorMode & color_mode()
Access color mode.
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().
int16_t window_x() const
Current address window x cursor.
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 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.
const ConstDramRaster< ColorMode, pixel_order, byte_order > raster(int16_t dx, int16_t dy) const
Return a raster view of the buffer with an offset.
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.
const ColorFormat & getColorFormat() const override
Return the native color format used by this device for direct drawing.
const roo::byte * buffer() const
Direct access to the underlying buffer (const).
roo::byte * buffer()
Direct access to the underlying buffer.
OffscreenDevice(int16_t width, int16_t height, roo::byte *buffer, ColorMode color_mode)
Create an offscreen device with the given geometry and buffer.
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.
const ColorMode & color_mode() const
Access color mode (const).
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 orientationUpdated()
Update orientation-dependent state.
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 write(Color *color, uint32_t pixel_count) override
Write pixels into the current address window.
const ConstDramRaster< ColorMode, pixel_order, byte_order > raster() const
Return a raster view of the full buffer.
OffscreenDevice(OffscreenDevice &&other) noexcept
int16_t window_y() const
Current address window y cursor.
void end() override
Finalize the previously entered write transaction, flushing any pending writes.
void flush() override
Wait until pending asynchronous drawing operations complete.
Offscreen rasterizable that writes into a pixel buffer.
void readColors(const int16_t *x, const int16_t *y, uint32_t count, Color *result) const override
Read colors for the given points.
const roo::byte * buffer() const
Offscreen(Box extents, Color fillColor, ColorMode color_mode=ColorMode())
Raster< const roo::byte *, ColorMode, pixel_order, byte_order > RasterType
Offscreen(const Drawable &d, Color bgColor, ColorMode color_mode=ColorMode())
Offscreen(Box extents, roo::byte *buffer, ColorMode color_mode=ColorMode())
void set_extents(const Box &extents)
Offscreen(Offscreen &&other) noexcept
OffscreenDevice< ColorMode, pixel_order, byte_order, pixels_per_byte, storage_type > & output()
TransparencyMode getTransparencyMode() const override
Return the transparency mode for pixels in this stream.
const ColorMode & color_mode() const
void setAnchorExtents(Box anchor_extents)
Offscreen(Box extents, ColorMode color_mode=ColorMode())
Box anchorExtents() const override
Return the bounds used for alignment.
Offscreen(int16_t width, int16_t height, roo::byte *buffer, ColorMode color_mode=ColorMode())
Create an offscreen with the given geometry and buffer.
Box extents() const override
Return the bounding box encompassing all pixels that need to be drawn.
Offscreen(int16_t width, int16_t height, uint8_t *buffer, ColorMode color_mode=ColorMode())
Offscreen(const Drawable &d, ColorMode color_mode=ColorMode())
Offscreen(int16_t width, int16_t height, ColorMode color_mode=ColorMode())
const OffscreenDevice< ColorMode, pixel_order, byte_order, pixels_per_byte, storage_type > & output() const
const RasterType & raster() const
Offscreen(int16_t width, int16_t height, Color fillColor, ColorMode color_mode=ColorMode())
Represents the orientation of a display device.
bool isRightToLeft() const
Return whether horizontal direction is right-to-left.
static constexpr Orientation Default()
Return the default orientation (RightDown).
bool isBottomToTop() const
Return whether vertical direction is bottom-to-top.
bool isXYswapped() const
Return whether x maps to the vertical direction.
Drawable that can provide a color for any point within its extents.
Low-level handle used to draw to an underlying device.
int16_t advance_x() const
uint16_t remaining_rows() const
void setAddress(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, int16_t raw_width, int16_t raw_height, Orientation orientation)
uint16_t remaining_in_row() const
int32_t advance_y() const
Orientation orientation() const
const uint32_t offset() const
void operator()(roo::byte *p, uint32_t offset, uint32_t count) const
void operator()(roo::byte *p, uint32_t offset) const
BlendingFillerOperator(const ColorMode &color_mode, Color color)
BlendingFillerOperator(const ColorMode &color_mode, Color color)
void operator()(roo::byte *p, uint32_t offset, uint32_t count) const
void operator()(roo::byte *p, uint32_t offset) const
void operator()(roo::byte *p, uint32_t offset, uint32_t count) const
BlendingFillerOperator(ColorMode &color_mode, Color color)
void operator()(roo::byte *p, uint32_t offset) const
void operator()(roo::byte *p, uint32_t offset, uint32_t count)
void operator()(roo::byte *p, uint32_t offset)
BlendingFillerOperator(ColorMode &color_mode, Color color)
void operator()(roo::byte *p, uint32_t offset, uint32_t count)
void operator()(roo::byte *p, uint32_t offset)
BlendingWriterOperator(const ColorMode &color_mode, const Color *color)
BlendingWriterOperator(ColorMode &color_mode, const Color *color)
void operator()(roo::byte *p, uint32_t offset)
void operator()(roo::byte *p, uint32_t offset, uint32_t count)
GenericFiller(const ColorMode &color_mode, BlendingMode blending_mode, Color color)
void operator()(roo::byte *p, uint32_t offset) const
void operator()(roo::byte *p, uint32_t offset, uint32_t count) const
void operator()(roo::byte *p, uint32_t offset)
void operator()(roo::byte *p, uint32_t offset, uint32_t count)
GenericFiller(ColorMode &color_mode, BlendingMode blending_mode, Color color)
GenericWriter(const ColorMode &color_mode, BlendingMode blending_mode, Color *color)
void operator()(roo::byte *p, uint32_t offset)
void operator()(roo::byte *p, uint32_t offset, uint32_t count)
void operator()(roo::byte *p, uint32_t offset)
void operator()(roo::byte *p, uint32_t offset, uint32_t count)
GenericWriter(ColorMode &color_mode, BlendingMode blending_mode, Color *color)
void orientRects(int16_t *&x0, int16_t *&y0, int16_t *&x1, int16_t *&y1, int16_t count)
void orientRect(int16_t &x0, int16_t &y0, int16_t &x1, int16_t &y1)
Orientation orientation() const
Orienter(int16_t raster_width, int16_t raster_height, Orientation orientation=Orientation::Default())
void orientPixels(int16_t *&x, int16_t *&y, int16_t count)
void setOrientation(Orientation orientation)
BlendingMode ResolveBlendingModeForWrite(BlendingMode mode, TransparencyMode transparency_mode)
BlendingMode ResolveBlendingModeForFill(BlendingMode mode, TransparencyMode transparency_mode, Color color)
Defines 140 opaque HTML named colors.
ColorStorageType< ColorMode > ApplyRawSubByteBlending(BlendingMode blending_mode, uint8_t dst, Color src, const ColorMode &color_mode)
BlendingMode
Porter-Duff style blending modes.
@ kDestinationOver
Destination is placed over the source.
@ kDestinationIn
Destination which overlaps the source, replaces the source.
@ kDestinationOut
Destination is placed, where it falls outside of the source.
@ kSourceOverOpaque
Similar to kSourceOver, but assumes that the destination is opaque.
@ kXor
The non-overlapping regions of source and destination are combined.
@ kDestination
Only the destination will be present.
@ kSource
The new ARGB8888 value completely replaces the old one.
@ kDestinationAtop
Destination which overlaps the source replaces the source. Source is placed elsewhere.
@ kSourceIn
The source that overlaps the destination, replaces the destination.
@ kSourceAtop
Source which overlaps the destination, replaces the destination. Destination is placed elsewhere.
@ kClear
No regions are enabled.
@ kSourceOver
Source is placed (alpha-blended) over the destination. This is the default blending mode.
@ kSourceOut
Source is placed, where it falls outside of the destination.
void async_blit(const roo::byte *src_ptr, size_t src_stride, roo::byte *dst_ptr, size_t dst_stride, size_t width, size_t height)
TransparencyMode
Transparency information for a stream or color mode.
@ kNone
All colors are fully opaque.
auto OffscreenForDevice(const Device &device, Args &&... args) -> Offscreen< typename Device::ColorMode, Device::pixel_order, Device::byte_order >
void fillHlinesAbsoluteImpl(Filler &fill, roo::byte *buffer, int16_t width, int16_t *x0, int16_t *y0, int16_t *x1, uint16_t count)
FillMode
Specifies whether a Drawable should fill its entire extents box, including fully transparent pixels.
@ kVisible
Fully transparent pixels do not need to be filled.
@ kExtents
Fill the entire extents box (possibly with fully transparent pixels).
void fillRectsAbsoluteImpl(Filler &fill, roo::byte *buffer, int16_t width, int16_t *x0, int16_t *y0, int16_t *x1, int16_t *y1, uint32_t count)
void fillVlinesAbsoluteImpl(Filler &fill, roo::byte *buffer, int16_t width, int16_t *x0, int16_t *y0, int16_t *y1, uint16_t count)
roo_io::ByteOrder ByteOrder
void blit(const roo::byte *src_ptr, size_t src_stride, roo::byte *dst_ptr, size_t dst_stride, size_t width, size_t height)
BlendingMode blending_mode
Traits for a color mode's storage characteristics.