Expand description
Vector graphics frame and primitive types.
This module models a resolution-independent, scene-graph-style vector
frame so the same VectorFrame can round-trip through both SVG 1.1
and PDF 1.4 without lossy conversion. The primitive set is the
intersection of what those two formats represent natively:
- paths built from move / line / quadratic / cubic / elliptic-arc / close commands,
- solid + linear-gradient + radial-gradient paints,
- stroke style (width, cap, join, miter limit, dash),
- even-odd / non-zero fill rules,
- 2D affine transforms,
- group nodes (transform, opacity, optional clip),
- embedded raster passthrough via
ImageRef(carries a childVideoFrame— the rasterizer paints the image into vector space).
Text nodes are intentionally deferred to round 2 — text needs
font handling and tight scribe coupling that will land alongside the
oxideav-svg parser (#349). Round 1 is shape-only.
No rasterizer / SVG parser / PDF writer lives in oxideav-core; those
are downstream tasks (#349 / #350 / #351). This module ships only the
data types every consumer of the vector pipeline needs to agree on.
Structs§
- Dash
Pattern - Dash pattern for a stroke.
arrayis an alternating dash-on / dash-off length list (in user units);offsetis the phase offset from the path start. - Gradient
Stop - One color stop along a gradient.
offsetis in0.0..=1.0. - Group
- A grouping node — applies a transform / opacity / optional clip path
to all descendants. Mirrors SVG
<g>and PDFq ... Qgraphic-state blocks. - Image
Ref - An embedded raster image painted into vector space.
- Linear
Gradient - A linear gradient: color stops sweep along the line
start→end. - Path
- A geometric path expressed as a sequence of drawing commands.
- Path
Node - A drawn path with optional fill and stroke.
- Point
- 2D point in user-space coordinates.
- Radial
Gradient - A radial gradient: color stops sweep from
focaloutward to a circle of radiusradiuscentered oncenter. WhenfocalisNone, it defaults tocenter(the common case). - Rect
- Axis-aligned rectangle in user-space coordinates.
- Rgba
- 32-bit straight (non-premultiplied) RGBA color.
- Stroke
- Stroke style for a path’s outline.
- Transform2D
- A 2D affine transform stored as the column-major matrix
- Vector
Frame - A decoded vector-graphics frame.
- ViewBox
- User-coordinate system rectangle. Mirrors the SVG
viewBoxattribute and the PDFMediaBox/CropBoxrectangles.
Enums§
- Fill
Rule - Fill rule for self-intersecting and compound paths. Matches SVG’s
fill-ruleattribute and PDF’sf(non-zero) vs.f*(even-odd) painting operators. - LineCap
- How an open path’s endpoints are drawn.
- Line
Join - How two stroke segments meet at a corner.
- Mask
Kind - How to interpret a soft mask’s rasterised pixels as a coverage modulator.
- Node
- One node in the scene tree.
- Paint
- A paint server — what fills the inside of a path or strokes its outline. The variant set is the SVG/PDF intersection.
- Path
Command - A single path-construction command.
- Spread
Method - What happens past the gradient endpoints. Mirrors SVG
spreadMethod="pad|reflect|repeat"and PDF gradientExtendarrays.