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

Radial gradient based on distance from the center. More...

#include <gradient.h>

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

Public Member Functions

 RadialGradient (FpPoint center, ColorGradient gradient, Box extents=Box::MaximumBox())
 Create a radial gradient.
 
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.
 
- 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().
 
- 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 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

Radial gradient based on distance from the center.

Definition at line 75 of file gradient.h.

Constructor & Destructor Documentation

◆ RadialGradient()

roo_display::RadialGradient::RadialGradient ( FpPoint  center,
ColorGradient  gradient,
Box  extents = Box::MaximumBox() 
)

Create a radial gradient.

Value equals distance from center. No anti-aliasing is performed; keep node distances >= 1 to avoid jagged rings. For smooth outer edges, add a terminal node with color::Transparent at +1 distance.

Definition at line 100 of file gradient.cpp.

Member Function Documentation

◆ extents()

Box roo_display::RadialGradient::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 85 of file gradient.h.

◆ readColors()

void roo_display::RadialGradient::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 107 of file gradient.cpp.

References roo_display::ColorGradient::getColor(), and r.


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