ThorVG  v0.15
RadialGradientfinal

A class representing the radial gradient fill of the Shape object. More...

Inheritance diagram for RadialGradient:
Collaboration diagram for RadialGradient:

Public Member Functions

Result radial (float cx, float cy, float radius) noexcept
 Sets the radial gradient bounds. More...
 
Result radial (float *cx, float *cy, float *radius) const noexcept
 Gets the radial gradient bounds. More...
 
Type type () const noexcept override
 Returns the ID value of this class. More...
 
- Public Member Functions inherited from Fill
Result colorStops (const ColorStop *colorStops, uint32_t cnt) noexcept
 Sets the parameters of the colors of the gradient and their position. More...
 
Result spread (FillSpread s) noexcept
 Sets the FillSpread value, which specifies how to fill the area outside the gradient bounds. More...
 
Result transform (const Matrix &m) noexcept
 Sets the matrix of the affine transformation for the gradient fill. More...
 
uint32_t colorStops (const ColorStop **colorStops) const noexcept
 Gets the parameters of the colors of the gradient, their position and number. More...
 
FillSpread spread () const noexcept
 Gets the FillSpread value of the fill. More...
 
Matrix transform () const noexcept
 Gets the matrix of the affine transformation of the gradient fill. More...
 
Fillduplicate () const noexcept
 Creates a copy of the Fill object. More...
 
TVG_DEPRECATED uint32_t identifier () const noexcept
 

Static Public Member Functions

static std::unique_ptr< RadialGradientgen () noexcept
 Creates a new RadialGradient object. More...
 
static TVG_DEPRECATED uint32_t identifier () noexcept
 

Detailed Description

A class representing the radial gradient fill of the Shape object.

Member Function Documentation

◆ gen()

static std::unique_ptr<RadialGradient> gen ( )
staticnoexcept

Creates a new RadialGradient object.

Returns
A new RadialGradient object.

◆ identifier()

static TVG_DEPRECATED uint32_t identifier ( )
staticnoexcept

◆ radial() [1/2]

Result radial ( float *  cx,
float *  cy,
float *  radius 
) const
noexcept

Gets the radial gradient bounds.

The radial gradient bounds are defined as a circle centered in a given point (cx, cy) of a given radius.

Parameters
[out]cxThe horizontal coordinate of the center of the bounding circle.
[out]cyThe vertical coordinate of the center of the bounding circle.
[out]radiusThe radius of the bounding circle.

◆ radial() [2/2]

Result radial ( float  cx,
float  cy,
float  radius 
)
noexcept

Sets the radial gradient bounds.

The radial gradient bounds are defined as a circle centered in a given point (cx, cy) of a given radius.

Parameters
[in]cxThe horizontal coordinate of the center of the bounding circle.
[in]cyThe vertical coordinate of the center of the bounding circle.
[in]radiusThe radius of the bounding circle.
Return values
Result::InvalidArgumentsin case the radius value is zero or less.
Note
In case the radius is zero, an object is filled with a single color using the last color specified in the colorStops().

◆ type()

Type type ( ) const
overridevirtualnoexcept

Returns the ID value of this class.

This method can be used to check the current concrete instance type.

Returns
The class type ID of the LinearGradient instance.
Since
Experimental API

Implements Fill.