|
roo_display
API Documentation for roo_display
|
Rasterizable drop shadow for rounded rectangles. More...
#include <shadow.h>
Data Structures | |
| struct | Spec |
| Shadow specification parameters. More... | |
Public Member Functions | |
| RoundRectShadow (roo_display::Box extents, Color color, uint8_t blur_radius, uint8_t dx, uint8_t dy, uint8_t corner_radius) | |
| Construct a rounded-rect shadow. | |
| Box | extents () const override |
| Return the bounding box encompassing all pixels that need to be drawn. | |
| 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, roo_display::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< 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::Streamable | |
| virtual TransparencyMode | getTransparencyMode () const |
| Return the transparency mode for pixels in this stream. | |
Public Member Functions inherited from roo_display::Drawable | |
| virtual | ~Drawable () |
| virtual Box | anchorExtents () const |
| Return the bounds used for alignment. | |
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(). | |
Rasterizable drop shadow for rounded rectangles.
| roo_display::RoundRectShadow::RoundRectShadow | ( | roo_display::Box | extents, |
| Color | color, | ||
| uint8_t | blur_radius, | ||
| uint8_t | dx, | ||
| uint8_t | dy, | ||
| uint8_t | corner_radius | ||
| ) |
Construct a rounded-rect shadow.
extents refer to the original object area. blur_radius approximates elevation (shadow growth). corner_radius indicates rounded corners of the casting object.
Definition at line 74 of file shadow.cpp.
References roo_display::Color::a(), roo_display::RoundRectShadow::Spec::alpha_start, roo_display::RoundRectShadow::Spec::alpha_step, roo_display::RoundRectShadow::Spec::border, color, extents(), roo_display::RoundRectShadow::Spec::h, roo_display::Box::height(), roo_display::RoundRectShadow::Spec::radius, roo_display::RoundRectShadow::Spec::w, roo_display::Box::width(), roo_display::RoundRectShadow::Spec::x, roo_display::Box::xMin(), roo_display::RoundRectShadow::Spec::y, and roo_display::Box::yMin().
|
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 37 of file shadow.h.
Referenced by RoundRectShadow().
|
overridevirtual |
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 99 of file shadow.cpp.
References roo_display::Color::withA(), roo_display::Box::xMax(), roo_display::Box::xMin(), roo_display::Box::yMax(), and roo_display::Box::yMin().
|
overridevirtual |
Read colors for the given points.
The caller must ensure all points are within bounds.
Implements roo_display::Rasterizable.
Definition at line 92 of file shadow.cpp.
References roo_display::Color::withA().