|
roo_display
API Documentation for roo_display
|
Offscreen rasterizable that writes into a pixel buffer. More...
#include <offscreen.h>
Public Types | |
| using | RasterType = Raster< const roo::byte *, ColorMode, pixel_order, byte_order > |
Public Member Functions | |
| Offscreen (int16_t width, int16_t height, roo::byte *buffer, ColorMode color_mode=ColorMode()) | |
| Create an offscreen with the given geometry and buffer. | |
| Offscreen (int16_t width, int16_t height, uint8_t *buffer, ColorMode color_mode=ColorMode()) | |
| Offscreen (Box extents, roo::byte *buffer, ColorMode color_mode=ColorMode()) | |
| Offscreen (int16_t width, int16_t height, ColorMode color_mode=ColorMode()) | |
| Offscreen (Box extents, ColorMode color_mode=ColorMode()) | |
| Offscreen (int16_t width, int16_t height, Color fillColor, ColorMode color_mode=ColorMode()) | |
| Offscreen (Box extents, Color fillColor, ColorMode color_mode=ColorMode()) | |
| Offscreen (const Drawable &d, ColorMode color_mode=ColorMode()) | |
| Offscreen (const Drawable &d, Color bgColor, ColorMode color_mode=ColorMode()) | |
| virtual | ~Offscreen () |
| Offscreen (Offscreen &&other) noexcept | |
| const RasterType & | raster () const |
| Box | extents () const override |
| Return the bounding box encompassing all pixels that need to be drawn. | |
| Box | anchorExtents () const override |
| Return the bounds used for alignment. | |
| void | setAnchorExtents (Box anchor_extents) |
| TransparencyMode | getTransparencyMode () const override |
| Return the transparency mode for pixels in this stream. | |
| void | readColors (const int16_t *x, const int16_t *y, uint32_t count, Color *result) const override |
| Read colors for the given points. | |
| const OffscreenDevice< ColorMode, pixel_order, byte_order, pixels_per_byte, storage_type > & | output () const |
| OffscreenDevice< ColorMode, pixel_order, byte_order, pixels_per_byte, storage_type > & | output () |
| roo::byte * | buffer () |
| const roo::byte * | buffer () const |
| const ColorMode & | color_mode () const |
Public Member Functions inherited from roo_display::Rasterizable | |
| void | readColorsMaybeOutOfBounds (const int16_t *x, const int16_t *y, uint32_t count, Color *result, Color out_of_bounds_color=color::Transparent) const |
| Read colors for points that may be out of bounds. | |
| virtual bool | readColorRect (int16_t xMin, int16_t yMin, int16_t xMax, int16_t yMax, Color *result) const |
| Read colors for a rectangle. | |
| std::unique_ptr< PixelStream > | createStream () const override |
Default createStream() using readColors(). | |
| std::unique_ptr< PixelStream > | createStream (const Box &bounds) const override |
Default createStream() for a clipped box using readColors(). | |
Public Member Functions inherited from roo_display::Drawable | |
| virtual | ~Drawable () |
Protected Member Functions | |
| void | set_extents (const Box &extents) |
Protected Member Functions inherited from roo_display::Rasterizable | |
| void | drawTo (const Surface &s) const override |
Default drawTo() using readColors(). | |
Friends | |
| class | DrawingContext |
Additional Inherited Members | |
Static Public Member Functions inherited from roo_display::Drawable | |
| static const Drawable * | Empty () |
| A singleton representing a no-op drawable with no bounding box. | |
Offscreen rasterizable that writes into a pixel buffer.
Example:
Definition at line 491 of file offscreen.h.
| using roo_display::Offscreen< ColorMode, pixel_order, byte_order, pixels_per_byte, storage_type >::RasterType = Raster<const roo::byte*, ColorMode, pixel_order, byte_order> |
Definition at line 493 of file offscreen.h.
|
inline |
Create an offscreen with the given geometry and buffer.
The buffer must have capacity $(width * height * ColorMode::bits_per_pixel + 7) / 8$ bytes. The buffer is not modified on construction.
Definition at line 501 of file offscreen.h.
|
inline |
Definition at line 506 of file offscreen.h.
|
inline |
Definition at line 514 of file offscreen.h.
|
inline |
Definition at line 524 of file offscreen.h.
|
inline |
|
inline |
Definition at line 547 of file offscreen.h.
|
inline |
Definition at line 553 of file offscreen.h.
References roo_display::Offscreen< ColorMode, pixel_order, byte_order, pixels_per_byte, storage_type >::extents(), roo_display::Box::height(), and roo_display::Box::width().
|
inline |
Definition at line 560 of file offscreen.h.
References color.
|
inline |
Definition at line 566 of file offscreen.h.
References roo_display::Offscreen< ColorMode, pixel_order, byte_order, pixels_per_byte, storage_type >::extents(), roo_display::Box::height(), roo_display::kExtents, roo_display::kSource, roo_display::Offscreen< ColorMode, pixel_order, byte_order, pixels_per_byte, storage_type >::setAnchorExtents(), roo_display::Box::width(), roo_display::Box::xMin(), and roo_display::Box::yMin().
|
inlinevirtual |
Definition at line 577 of file offscreen.h.
References roo_display::Offscreen< ColorMode, pixel_order, byte_order, pixels_per_byte, storage_type >::output().
|
inlinenoexcept |
Definition at line 581 of file offscreen.h.
|
inlineoverridevirtual |
Return the bounds used for alignment.
Defaults to extents(). Some drawables (notably text labels) may want different alignment bounds.
This method is called during a transaction and must not block or perform I/O.
Reimplemented from roo_display::Drawable.
Definition at line 593 of file offscreen.h.
|
inline |
Definition at line 620 of file offscreen.h.
References roo_display::Offscreen< ColorMode, pixel_order, byte_order, pixels_per_byte, storage_type >::output().
Referenced by roo_display::Offscreen< ColorMode, pixel_order, byte_order, pixels_per_byte, storage_type >::Offscreen().
|
inline |
Definition at line 621 of file offscreen.h.
References roo_display::Offscreen< ColorMode, pixel_order, byte_order, pixels_per_byte, storage_type >::output().
|
inline |
Definition at line 623 of file offscreen.h.
References roo_display::Offscreen< ColorMode, pixel_order, byte_order, pixels_per_byte, storage_type >::output().
|
inlineoverridevirtual |
Return the bounding box encompassing all pixels that need to be drawn.
This method is called during a transaction and must not block or perform I/O.
Implements roo_display::Drawable.
Definition at line 592 of file offscreen.h.
Referenced by roo_display::FrontToBackWriter::fillPixels(), roo_display::FrontToBackWriter::fillRects(), roo_display::Offscreen< ColorMode, pixel_order, byte_order, pixels_per_byte, storage_type >::Offscreen(), roo_display::Offscreen< ColorMode, pixel_order, byte_order, pixels_per_byte, storage_type >::Offscreen(), roo_display::Offscreen< ColorMode, pixel_order, byte_order, pixels_per_byte, storage_type >::Offscreen(), roo_display::Offscreen< ColorMode, pixel_order, byte_order, pixels_per_byte, storage_type >::set_extents(), roo_display::FrontToBackWriter::writePixels(), and roo_display::FrontToBackWriter::writeRects().
|
inlineoverridevirtual |
Return the transparency mode for pixels in this stream.
This is an optimization hint. The default is TransparencyMode::kFull, which is always safe. If pixels are guaranteed fully opaque or 1-bit alpha, return TransparencyMode::kNone or TransparencyMode::kCrude to enable faster blending paths.
Reimplemented from roo_display::Streamable.
Definition at line 599 of file offscreen.h.
References roo_display::Offscreen< ColorMode, pixel_order, byte_order, pixels_per_byte, storage_type >::raster().
|
inline |
Definition at line 616 of file offscreen.h.
|
inline |
Definition at line 610 of file offscreen.h.
Referenced by roo_display::Offscreen< ColorMode, pixel_order, byte_order, pixels_per_byte, storage_type >::buffer(), roo_display::Offscreen< ColorMode, pixel_order, byte_order, pixels_per_byte, storage_type >::buffer(), roo_display::Offscreen< ColorMode, pixel_order, byte_order, pixels_per_byte, storage_type >::color_mode(), roo_display::FrontToBackWriter::fill(), roo_display::FrontToBackWriter::fillPixels(), roo_display::FrontToBackWriter::fillRects(), roo_display::FrontToBackWriter::setAddress(), roo_display::FrontToBackWriter::write(), roo_display::FrontToBackWriter::writePixels(), roo_display::FrontToBackWriter::writeRects(), and roo_display::Offscreen< ColorMode, pixel_order, byte_order, pixels_per_byte, storage_type >::~Offscreen().
|
inline |
|
inlineoverridevirtual |
Read colors for the given points.
The caller must ensure all points are within bounds.
Implements roo_display::Rasterizable.
Definition at line 603 of file offscreen.h.
References roo_display::Offscreen< ColorMode, pixel_order, byte_order, pixels_per_byte, storage_type >::raster().
|
inlineprotected |
Definition at line 629 of file offscreen.h.
References roo_display::Offscreen< ColorMode, pixel_order, byte_order, pixels_per_byte, storage_type >::extents().
|
inline |
Definition at line 595 of file offscreen.h.
Referenced by roo_display::Offscreen< ColorMode, pixel_order, byte_order, pixels_per_byte, storage_type >::Offscreen().
|
friend |
Definition at line 632 of file offscreen.h.