Donner 0.5.1
Embeddable browser-grade SVG2 engine
Loading...
Searching...
No Matches
donner::geode::RadialGradientParams Struct Reference

Parameters for a radial gradient fill at the Geode drawing layer. More...

#include "donner/svg/renderer/geode/GeoEncoder.h"

Collaboration diagram for donner::geode::RadialGradientParams:
[legend]

Public Types

using Stop = LinearGradientParams::Stop
 Gradient stops. Same wire format / cap as LinearGradientParams — kept as a sibling struct so each gradient kind's C++ API reflects its natural parameter set without std::variant-style dispatch.

Public Attributes

Vector2d center = Vector2d::Zero()
 Outer circle center in gradient space.
Vector2d focalCenter = Vector2d::Zero()
 Focal circle center in gradient space. Typically equals center unless the gradient has a distinct focal point (fx/fy).
double radius = 0.0
 Outer circle radius. Must be > 0.
double focalRadius = 0.0
 Focal circle radius (SVG 2 fr attribute). Typically 0.
Transform2d gradientFromPath
 Same as LinearGradientParams::gradientFromPath.
uint32_t spreadMode = 0
 Spread mode. 0 = pad, 1 = reflect, 2 = repeat.
std::span< const Stopstops
 Gradient stops (capped at 16 entries by the underlying uniform buffer).

Detailed Description

Parameters for a radial gradient fill at the Geode drawing layer.

Describes a two-circle radial gradient: an outer circle (center, radius) and a focal circle (focalCenter, focalRadius). When focalCenter == center and focalRadius == 0, this reduces to the simple one-circle radial gradient (t = distance(P, center) / radius).

All geometry fields are in the gradient's own coordinate system, same convention as LinearGradientParams — the caller has already folded gradientUnits and gradientTransform into gradientFromPath.

Member Typedef Documentation

◆ Stop

Gradient stops. Same wire format / cap as LinearGradientParams — kept as a sibling struct so each gradient kind's C++ API reflects its natural parameter set without std::variant-style dispatch.

Member Data Documentation

◆ center

Vector2d donner::geode::RadialGradientParams::center = Vector2d::Zero()

Outer circle center in gradient space.

◆ focalCenter

Vector2d donner::geode::RadialGradientParams::focalCenter = Vector2d::Zero()

Focal circle center in gradient space. Typically equals center unless the gradient has a distinct focal point (fx/fy).

◆ focalRadius

double donner::geode::RadialGradientParams::focalRadius = 0.0

Focal circle radius (SVG 2 fr attribute). Typically 0.

◆ gradientFromPath

Transform2d donner::geode::RadialGradientParams::gradientFromPath

◆ radius

double donner::geode::RadialGradientParams::radius = 0.0

Outer circle radius. Must be > 0.

◆ spreadMode

uint32_t donner::geode::RadialGradientParams::spreadMode = 0

Spread mode. 0 = pad, 1 = reflect, 2 = repeat.

◆ stops

std::span<const Stop> donner::geode::RadialGradientParams::stops

Gradient stops (capped at 16 entries by the underlying uniform buffer).


The documentation for this struct was generated from the following file: