|
|
Donner 0.5.0
Embeddable browser-grade SVG2 engine
|
GPU-ready encoded path data produced by the Slug band decomposition algorithm. More...
#include "donner/svg/renderer/geode/GeodePathEncoder.h"
Classes | |
| struct | Curve |
| A quadratic Bézier curve segment (3 control points) stored as floats for GPU consumption. More... | |
| struct | Band |
| Metadata for one horizontal band. More... | |
| struct | Vertex |
| Vertex for the band bounding quad (input to the Slug vertex shader). More... | |
Public Member Functions | |
| bool | empty () const |
| Returns true if the encoded path has no bands (empty or degenerate path). | |
Public Attributes | |
| std::vector< Curve > | curves |
| All quadratic curves, sorted by band. | |
| std::vector< Band > | bands |
| Band metadata. | |
| std::vector< Vertex > | vertices |
| Bounding quad vertices (6 per band). | |
| Box2d | pathBounds |
| Axis-aligned bounding box of the path. | |
GPU-ready encoded path data produced by the Slug band decomposition algorithm.
This struct contains all the data needed by the Slug vertex and fragment shaders to render a filled path. It is produced by GeodePathEncoder::encode() and consumed by the GPU pipeline.
The data is organized as:
| struct donner::geode::EncodedPath::Curve |
| struct donner::geode::EncodedPath::Band |
Metadata for one horizontal band.
Layout matches the WGSL Band struct in shaders/slug_fill.wgsl exactly (8 × 4 bytes = 32 bytes per band). Two trailing pad fields are required because storage buffer struct stride must be 16-byte aligned, and without them WGSL would round the struct to 32 bytes anyway.
| struct donner::geode::EncodedPath::Vertex |
Vertex for the band bounding quad (input to the Slug vertex shader).
| Class Members | ||
|---|---|---|
| uint32_t | bandIndex | Which band this vertex belongs to. |
| float | normalX | |
| float | normalY | Outward normal (for dynamic half-pixel dilation). |
| float | posX | |
| float | posY | Position in path space. |