Skip to main content

Module vector

Module vector 

Source
Expand description

Backend-agnostic SVG/vector asset IR.

usvg owns SVG normalization: XML, inherited style, transforms, arcs, relative commands, and basic shapes are resolved before Aetna stores anything. The renderer-facing IR below is deliberately small: paths plus fill/stroke style. Backends can tessellate it with lyon or feed it into more specialized vector shaders later.

Structs§

PathBuilder
Imperative builder for a single VectorPath. Mirrors a subset of the SVG path command vocabulary (M, L, C, Q, Z) plus fill/stroke style. Returns a VectorPath; combine multiple via VectorAsset::from_paths.
VectorAsset
VectorFill
VectorGradientStop
A gradient stop. The colour is stored in linear premultiplied-friendly floats (sRGB → linear, with the per-stop opacity baked into the alpha) so vertex interpolation matches what the shader expects.
VectorLinearGradient
VectorMesh
VectorMeshOptions
VectorMeshRun
VectorMeshVertex
VectorParseError
VectorPath
VectorRadialGradient
VectorStroke

Enums§

IconMaterial
VectorColor
VectorFillRule
VectorGradient
A linear or radial gradient resolved to absolute SVG/viewBox space. The stored axis/centre coordinates live in the gradient’s own coordinate system; absolute_to_local maps a point in absolute SVG space back into that system so per-vertex evaluation is one matrix-multiply away.
VectorLineCap
VectorLineJoin
VectorRenderMode
Render policy for app-supplied VectorAssets.
VectorSegment
VectorSpreadMethod

Functions§

append_vector_asset_mesh
parse_svg_asset
tessellate_vector_asset