Donner SVG 0.8.0-pre
SVG editor and embeddable C⁠+⁠+⁠20 engine.
Loading...
Searching...
No Matches
GeodePathEncoder.h File Reference

CPU-side Slug band decomposition: converts a Path into GPU-ready band data. More...

#include <array>
#include <cstddef>
#include <cstdint>
#include <limits>
#include <span>
#include <vector>
#include "donner/base/Box.h"
#include "donner/base/Vector2.h"
Include dependency graph for GeodePathEncoder.h:
This graph shows which files directly or indirectly include this file:

Classes

struct  donner::geode::EncodedPath
 GPU-ready encoded path data produced by the Slug band decomposition algorithm. More...
struct  donner::geode::EncodedPath::Curve
 A quadratic Bézier curve segment (3 control points) stored as floats for GPU consumption. More...
struct  donner::geode::EncodedPath::Band
 Compact metadata for one band. Layout matches the WGSL Band struct exactly. More...
struct  donner::geode::EncodedPath::AxisStats
 Per-axis encode statistics retained with the path for diagnostics and perf tests. More...
struct  donner::geode::EncodedPath::EncodingStats
 Output-neutral instrumentation for the CPU encoding result. More...
struct  donner::geode::EncodedPath::BoundingPoint
 One path-space vertex in the convex bounding polygon. More...
class  donner::geode::GeodePathEncoder
 Encodes a Path into Slug band decomposition format for GPU rendering. More...
struct  donner::geode::GeodePathEncoder::Limits

Namespaces

namespace  donner
 Top-level Donner namespace, which is split into different sub-namespaces such as donner::svg and donner::css.

Detailed Description

CPU-side Slug band decomposition: converts a Path into GPU-ready band data.


Class Documentation

◆ donner::geode::EncodedPath::Curve

struct donner::geode::EncodedPath::Curve

A quadratic Bézier curve segment (3 control points) stored as floats for GPU consumption.

Class Members
float p0x
float p0y Start point.
float p1x
float p1y Control point.
float p2x
float p2y End point.

◆ donner::geode::EncodedPath::Band

struct donner::geode::EncodedPath::Band

Compact metadata for one band. Layout matches the WGSL Band struct exactly.

Class Members
uint32_t curveCount Number of curve references in the band.
uint32_t curveStart First entry in the axis's curve-reference array.

◆ donner::geode::EncodedPath::AxisStats

struct donner::geode::EncodedPath::AxisStats

Per-axis encode statistics retained with the path for diagnostics and perf tests.

Class Members
uint32_t canonicalCurveCount = 0 Curves stored exactly once for this ray.
uint32_t curveReferenceCount = 0 Total indexes across all bands.
uint32_t gridBandCount = 0 Dense band-grid cells.
uint32_t maxCurvesPerBand = 0 Worst packed-band reference count.
double meanCurvesPerBand = 0.0 Mean references per nonempty band.
uint32_t nonemptyBandCount = 0 Packed nonempty band records.
uint32_t omittedParallelCurves = 0 Curves proven parallel to this ray.
uint32_t p95CurvesPerBand = 0 95th percentile nonempty-band count.

◆ donner::geode::EncodedPath::EncodingStats

struct donner::geode::EncodedPath::EncodingStats

Output-neutral instrumentation for the CPU encoding result.

Class Members
double aabbArea = 0.0
double boundingGeometryArea = 0.0
uint32_t boundingGeometryVertexCount = 0
AxisStats horizontal
AxisStats vertical

◆ donner::geode::EncodedPath::BoundingPoint

struct donner::geode::EncodedPath::BoundingPoint

One path-space vertex in the convex bounding polygon.

Class Members
float x
float y

◆ donner::geode::GeodePathEncoder::Limits

struct donner::geode::GeodePathEncoder::Limits
Class Members
size_t maximumConvertedCommands = 1u << 20
size_t maximumEncodedGeometryItems = 1u << 20