|
|
Donner 0.5.1
Embeddable browser-grade SVG2 engine
|
Parameters for a linear gradient fill at the Geode drawing layer. More...
#include "donner/svg/renderer/geode/GeoEncoder.h"
Classes | |
| struct | Stop |
| Gradient stops. Colors are in straight alpha, 0..1 per channel — the encoder premultiplies before upload. Offsets must be in [0, 1]. More... | |
Public Attributes | |
| Vector2d | startGrad = Vector2d::Zero() |
| Start point in gradient space. | |
| Vector2d | endGrad = Vector2d::Zero() |
| End point in gradient space. | |
| Transform2d | gradientFromPath |
| Affine transform that maps a path-space sample position to gradient space. The fragment shader uses this to recover the gradient parameter t per pixel. This is the inverse of pathFromGradient and already bakes in both gradientUnits and the gradientTransform attribute. | |
| uint32_t | spreadMode = 0 |
| Spread mode at the edges of the gradient range. 0 = pad, 1 = reflect, 2 = repeat. | |
| std::span< const Stop > | stops |
| Gradient stops (capped at 16 entries by the underlying uniform buffer). | |
Parameters for a linear gradient fill at the Geode drawing layer.
All geometry fields are in the gradient's own coordinate system (after the caller has already folded gradientUnits + the gradientTransform attribute into gradientFromPath). The encoder uploads these verbatim into a per-draw uniform buffer consumed by shaders/slug_gradient.wgsl.
| struct donner::geode::LinearGradientParams::Stop |
Gradient stops. Colors are in straight alpha, 0..1 per channel — the encoder premultiplies before upload. Offsets must be in [0, 1].
A hard cap of 16 stops is enforced inside the encoder to match the fixed-size uniform buffer layout in slug_gradient.wgsl. Stops beyond the cap are silently truncated — a follow-up will move stop storage to a texture lookup (GeodeGradientCacheComponent) to lift this limit. A single gradient stop: normalized offset and premultiplied linear RGBA.
| Class Members | ||
|---|---|---|
| float | offset = 0.0f | Stop offset in [0, 1]. |
| float | rgba[4] = {0.0f, 0.0f, 0.0f, 1.0f} | Premultiplied linear RGBA color. |
| Vector2d donner::geode::LinearGradientParams::endGrad = Vector2d::Zero() |
End point in gradient space.
| Transform2d donner::geode::LinearGradientParams::gradientFromPath |
Affine transform that maps a path-space sample position to gradient space. The fragment shader uses this to recover the gradient parameter t per pixel. This is the inverse of pathFromGradient and already bakes in both gradientUnits and the gradientTransform attribute.
| uint32_t donner::geode::LinearGradientParams::spreadMode = 0 |
Spread mode at the edges of the gradient range. 0 = pad, 1 = reflect, 2 = repeat.
| Vector2d donner::geode::LinearGradientParams::startGrad = Vector2d::Zero() |
Start point in gradient space.
| std::span<const Stop> donner::geode::LinearGradientParams::stops |
Gradient stops (capped at 16 entries by the underlying uniform buffer).