roo_display
API Documentation for roo_display
Loading...
Searching...
No Matches
roo_display::RasterizableStack Class Reference

Multi-layer stack of rasterizables composited in order. More...

#include <rasterizable_stack.h>

Inheritance diagram for roo_display::RasterizableStack:
[legend]
Collaboration diagram for roo_display::RasterizableStack:
[legend]

Data Structures

class  Input
 An input layer in the stack. More...
 

Public Member Functions

 RasterizableStack (const Box &extents)
 Create a stack with the given extents.
 
InputaddInput (const Rasterizable *input)
 Add an input using its full extents.
 
InputaddInput (const Rasterizable *input, Box clip_box)
 Add an input clipped to clip_box.
 
InputaddInput (const Rasterizable *input, uint16_t dx, uint16_t dy)
 Add an input with an offset.
 
InputaddInput (const Rasterizable *input, Box clip_box, uint16_t dx, uint16_t dy)
 Add an input with an offset and clip box.
 
Box extents () const override
 Return the overall extents of the stack.
 
Box anchorExtents () const override
 Return the bounds used for alignment.
 
Box naturalExtents ()
 Return minimal extents that fit all inputs without clipping.
 
void setExtents (const Box &extents)
 Set the stack extents.
 
void setAnchorExtents (const Box &anchor_extents)
 Set anchor extents used for alignment.
 
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.
 
- 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< PixelStreamcreateStream () const override
 Default createStream() using readColors().
 
std::unique_ptr< PixelStreamcreateStream (const Box &bounds) const override
 Default createStream() for a clipped box using readColors().
 
- Public Member Functions inherited from roo_display::Streamable
virtual TransparencyMode getTransparencyMode () const
 Return the transparency mode for pixels in this stream.
 
- Public Member Functions inherited from roo_display::Drawable
virtual ~Drawable ()
 

Additional Inherited Members

- Static Public Member Functions inherited from roo_display::Drawable
static const DrawableEmpty ()
 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().
 

Detailed Description

Multi-layer stack of rasterizables composited in order.

Definition at line 12 of file rasterizable_stack.h.

Constructor & Destructor Documentation

◆ RasterizableStack()

roo_display::RasterizableStack::RasterizableStack ( const Box extents)
inline

Create a stack with the given extents.

Definition at line 62 of file rasterizable_stack.h.

Member Function Documentation

◆ addInput() [1/4]

Input & roo_display::RasterizableStack::addInput ( const Rasterizable input)
inline

Add an input using its full extents.

Definition at line 66 of file rasterizable_stack.h.

◆ addInput() [2/4]

Input & roo_display::RasterizableStack::addInput ( const Rasterizable input,
Box  clip_box 
)
inline

Add an input clipped to clip_box.

Definition at line 72 of file rasterizable_stack.h.

References roo_display::Box::Intersect().

◆ addInput() [3/4]

Input & roo_display::RasterizableStack::addInput ( const Rasterizable input,
Box  clip_box,
uint16_t  dx,
uint16_t  dy 
)
inline

Add an input with an offset and clip box.

Definition at line 84 of file rasterizable_stack.h.

References roo_display::Box::Intersect().

◆ addInput() [4/4]

Input & roo_display::RasterizableStack::addInput ( const Rasterizable input,
uint16_t  dx,
uint16_t  dy 
)
inline

Add an input with an offset.

Definition at line 78 of file rasterizable_stack.h.

◆ anchorExtents()

Box roo_display::RasterizableStack::anchorExtents ( ) const
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 94 of file rasterizable_stack.h.

◆ extents()

Box roo_display::RasterizableStack::extents ( ) const
inlineoverridevirtual

Return the overall extents of the stack.

Implements roo_display::Drawable.

Definition at line 92 of file rasterizable_stack.h.

Referenced by naturalExtents(), and setExtents().

◆ naturalExtents()

Box roo_display::RasterizableStack::naturalExtents ( )
inline

Return minimal extents that fit all inputs without clipping.

Definition at line 97 of file rasterizable_stack.h.

References roo_display::Box::Extent(), and extents().

◆ readColorRect()

bool roo_display::RasterizableStack::readColorRect ( int16_t  xMin,
int16_t  yMin,
int16_t  xMax,
int16_t  yMax,
Color result 
) const
overridevirtual

◆ readColors()

void roo_display::RasterizableStack::readColors ( const int16_t x,
const int16_t y,
uint32_t  count,
Color result 
) const
overridevirtual

Read colors for the given points.

The caller must ensure all points are within bounds.

Implements roo_display::Rasterizable.

Definition at line 9 of file rasterizable_stack.cpp.

References roo_display::ApplyBlendingInPlaceIndexed(), roo_display::Box::contains(), roo_display::FillColor(), and r.

◆ setAnchorExtents()

void roo_display::RasterizableStack::setAnchorExtents ( const Box anchor_extents)
inline

Set anchor extents used for alignment.

Definition at line 110 of file rasterizable_stack.h.

◆ setExtents()

void roo_display::RasterizableStack::setExtents ( const Box extents)
inline

Set the stack extents.

Definition at line 107 of file rasterizable_stack.h.

References extents().


The documentation for this class was generated from the following files: