|
roo_display
API Documentation for roo_display
|
Non-owning raster view over a pixel buffer. More...
#include <raster.h>
Public Types | |
| using | ColorMode = ColorModeT |
| using | PtrType = typename internal::PtrTypeResolver< PtrTypeT >::PtrType |
| using | StreamType = RasterPixelStream< roo_io::UnsafeGenericMemoryIterable< PtrType >, ColorMode, pixel_order, byte_order > |
| using | Reader = internal::Reader< ColorMode, pixel_order, byte_order > |
Public Member Functions | |
| Raster (int16_t width, int16_t height, PtrTypeT ptr, const ColorMode &color_mode=ColorMode()) | |
| Construct a raster for a width/height buffer. | |
| Raster (int16_t width, int16_t height, Box extents, PtrTypeT ptr, const ColorMode &color_mode=ColorMode()) | |
| Construct a raster with custom extents and buffer dimensions. | |
| Raster (Box extents, PtrTypeT ptr, const ColorMode &color_mode=ColorMode()) | |
| Construct a raster with extents and a buffer pointer. | |
| Raster (Box extents, Box anchor_extents, PtrTypeT ptr, const ColorMode &color_mode=ColorMode()) | |
| Construct a raster with extents and anchor extents. | |
| 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. | |
| ColorMode & | color_mode () |
| const ColorMode & | color_mode () const |
| std::unique_ptr< StreamType > | createRawStream () const |
| std::unique_ptr< PixelStream > | createStream () const override |
Create a stream covering the full extents(). | |
| std::unique_ptr< PixelStream > | createStream (const Box &bounds) const override |
| Create a stream for the given clipped bounds. | |
| void | readColors (const int16_t *x, const int16_t *y, uint32_t count, Color *result) const override |
| Read colors for the given points. | |
| bool | readColorRect (int16_t xMin, int16_t yMin, int16_t xMax, int16_t yMax, Color *result) const override |
| Read colors for a rectangle. | |
| TransparencyMode | getTransparencyMode () const override |
| Return the transparency mode for pixels in this stream. | |
| TransparencyMode | transparency () const |
| Color | get (int16_t x, int16_t y) const |
| const PtrType | buffer () 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. | |
| 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 () |
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. | |
Protected Member Functions inherited from roo_display::Rasterizable | |
| void | drawTo (const Surface &s) const override |
Default drawTo() using readColors(). | |
Non-owning raster view over a pixel buffer.
The raster representation is small and can be passed by value. Prefer using DramRaster, ConstDramRaster, or ProgMemRaster aliases instead of this template directly.
| using roo_display::Raster< PtrTypeT, ColorModeT, pixel_order, byte_order >::ColorMode = ColorModeT |
| using roo_display::Raster< PtrTypeT, ColorModeT, pixel_order, byte_order >::PtrType = typename internal::PtrTypeResolver<PtrTypeT>::PtrType |
| using roo_display::Raster< PtrTypeT, ColorModeT, pixel_order, byte_order >::Reader = internal::Reader<ColorMode, pixel_order, byte_order> |
| using roo_display::Raster< PtrTypeT, ColorModeT, pixel_order, byte_order >::StreamType = RasterPixelStream<roo_io::UnsafeGenericMemoryIterable<PtrType>, ColorMode, pixel_order, byte_order> |
|
inline |
|
inline |
|
inline |
|
inline |
|
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.
|
inline |
|
inline |
Definition at line 260 of file raster.h.
Referenced by roo_display::MakeTiledRaster(), and roo_display::MakeTiledRaster().
|
inline |
|
inline |
|
inlineoverridevirtual |
Create a stream covering the full extents().
Implements roo_display::Streamable.
|
inlineoverridevirtual |
Create a stream for the given clipped bounds.
Implements roo_display::Streamable.
Definition at line 273 of file raster.h.
References roo_display::Raster< PtrTypeT, ColorModeT, pixel_order, byte_order >::extents(), and roo_display::SubRectangle().
|
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 256 of file raster.h.
Referenced by roo_display::Raster< PtrTypeT, ColorModeT, pixel_order, byte_order >::createStream(), roo_display::MakeTiledRaster(), and roo_display::MakeTiledRaster().
|
inline |
Definition at line 324 of file raster.h.
References roo_display::Box::xMin(), and roo_display::Box::yMin().
|
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 318 of file raster.h.
References roo_display::Raster< PtrTypeT, ColorModeT, pixel_order, byte_order >::transparency().
|
inlineoverridevirtual |
Read colors for a rectangle.
Returns true if all colors are identical (then only result[0] is valid). The caller must ensure the rectangle is within bounds.
Reimplemented from roo_display::Rasterizable.
Definition at line 290 of file raster.h.
References roo_display::Box::xMin(), and roo_display::Box::yMin().
|
inlineoverridevirtual |
Read colors for the given points.
The caller must ensure all points are within bounds.
Implements roo_display::Rasterizable.
Definition at line 280 of file raster.h.
References roo_display::Box::xMin(), and roo_display::Box::yMin().
|
inline |
Definition at line 322 of file raster.h.
Referenced by roo_display::Raster< PtrTypeT, ColorModeT, pixel_order, byte_order >::getTransparencyMode().