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

Filled rectangle (rasterizable). More...

#include <basic.h>

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

Public Member Functions

 FilledRect (const Box &box, Color color)
 
 FilledRect (int16_t x0, int16_t y0, int16_t x1, int16_t y1, Color color)
 
Box extents () const override
 Return the bounding box encompassing all pixels that need to be drawn.
 
TransparencyMode getTransparencyMode () const override
 Return the transparency mode for pixels in this stream.
 
std::unique_ptr< PixelStreamcreateStream () const override
 Create a stream covering the full extents().
 
std::unique_ptr< PixelStreamcreateStream (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.
 
- Public Member Functions inherited from roo_display::RectBase
 RectBase (int16_t x0, int16_t y0, int16_t x1, int16_t y1, Color color)
 
Box extents () const override
 Return the bounding box encompassing all pixels that need to be drawn.
 
- Public Member Functions inherited from roo_display::BasicShape
Color color () const
 Return the shape color.
 
- Public Member Functions inherited from roo_display::Drawable
virtual ~Drawable ()
 
virtual Box anchorExtents () const
 Return the bounds used for alignment.
 
- 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< PixelStreamcreateStream () const override
 Default createStream() using readColors().
 
std::unique_ptr< PixelStreamcreateStream (const Box &bounds) const override
 Default createStream() for a clipped box using readColors().
 

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::BasicShape
 BasicShape (Color color)
 
- Protected Member Functions inherited from roo_display::Rasterizable
void drawTo (const Surface &s) const override
 Default drawTo() using readColors().
 
- Protected Attributes inherited from roo_display::RectBase
int16_t x0_
 
int16_t y0_
 
int16_t x1_
 
int16_t y1_
 

Detailed Description

Filled rectangle (rasterizable).

Definition at line 131 of file basic.h.

Constructor & Destructor Documentation

◆ FilledRect() [1/2]

roo_display::FilledRect::FilledRect ( const Box box,
Color  color 
)
inline

Definition at line 133 of file basic.h.

References color.

◆ FilledRect() [2/2]

roo_display::FilledRect::FilledRect ( int16_t  x0,
int16_t  y0,
int16_t  x1,
int16_t  y1,
Color  color 
)
inline

Definition at line 136 of file basic.h.

References color.

Member Function Documentation

◆ createStream() [1/2]

std::unique_ptr< PixelStream > roo_display::FilledRect::createStream ( ) const
overridevirtual

Create a stream covering the full extents().

Implements roo_display::Streamable.

Definition at line 180 of file basic.cpp.

References color.

◆ createStream() [2/2]

std::unique_ptr< PixelStream > roo_display::FilledRect::createStream ( const Box clip_box) const
overridevirtual

Create a stream for the given clipped bounds.

Implements roo_display::Streamable.

Definition at line 184 of file basic.cpp.

References color.

◆ extents()

Box roo_display::FilledRect::extents ( ) const
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 139 of file basic.h.

References roo_display::RectBase::extents().

◆ getTransparencyMode()

TransparencyMode roo_display::FilledRect::getTransparencyMode ( ) const
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 141 of file basic.h.

References roo_display::BasicShape::color(), roo_display::Color::isOpaque(), roo_display::kFull, and roo_display::kNone.

◆ readColors()

void roo_display::FilledRect::readColors ( const int16_t x,
const int16_t y,
uint32_t  count,
Color result 
) const
inlineoverridevirtual

Read colors for the given points.

The caller must ensure all points are within bounds.

Implements roo_display::Rasterizable.

Definition at line 149 of file basic.h.

References roo_display::BasicShape::color(), and roo_display::FillColor().


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