pub enum SceneCommand {
Show 26 variants
FillRect {
x: f64,
y: f64,
w: f64,
h: f64,
paint: Paint,
},
StrokeRect {
x: f64,
y: f64,
w: f64,
h: f64,
color: Color,
stroke_width: f64,
stroke_dash: Option<f64>,
stroke_gap: Option<f64>,
stroke_linecap: Option<LineCap>,
},
FillRoundedRect {
x: f64,
y: f64,
w: f64,
h: f64,
radius: f64,
paint: Paint,
radii: Option<[f64; 4]>,
},
StrokeRoundedRect {
x: f64,
y: f64,
w: f64,
h: f64,
radius: f64,
color: Color,
stroke_width: f64,
stroke_dash: Option<f64>,
stroke_gap: Option<f64>,
stroke_linecap: Option<LineCap>,
radii: Option<[f64; 4]>,
},
FillEllipse {
x: f64,
y: f64,
w: f64,
h: f64,
paint: Paint,
rx: Option<f64>,
ry: Option<f64>,
},
StrokeEllipse {
x: f64,
y: f64,
w: f64,
h: f64,
color: Color,
stroke_width: f64,
stroke_dash: Option<f64>,
stroke_gap: Option<f64>,
stroke_linecap: Option<LineCap>,
rx: Option<f64>,
ry: Option<f64>,
},
StrokeLine {
x1: f64,
y1: f64,
x2: f64,
y2: f64,
color: Color,
stroke_width: f64,
stroke_dash: Option<f64>,
stroke_gap: Option<f64>,
stroke_linecap: Option<LineCap>,
},
FillPolygon {
points: Vec<f64>,
paint: Paint,
even_odd: bool,
},
StrokePolyline {
points: Vec<f64>,
color: Color,
stroke_width: f64,
closed: bool,
align: StrokeAlign,
fill_even_odd: bool,
},
DrawImage {
x: f64,
y: f64,
w: f64,
h: f64,
asset_id: String,
fit: FitMode,
pos_x: f64,
pos_y: f64,
opacity: f64,
clip_shape: Option<ImageClip>,
src_rect: Option<SrcRect>,
},
DrawSvgAsset {
x: f64,
y: f64,
w: f64,
h: f64,
asset: String,
},
DrawGlyphRun {
x: f64,
y: f64,
font_id: String,
font_size: f32,
color: Color,
stroke_color: Option<Color>,
stroke_width: Option<f64>,
link: Option<String>,
selectable: bool,
glyphs: Vec<SceneGlyph>,
},
PushClip {
x: f64,
y: f64,
w: f64,
h: f64,
},
PopClip,
PushLayer {
opacity: f64,
blend_mode: Option<BlendMode>,
},
PopLayer,
PushTransform {
angle_deg: f64,
cx: f64,
cy: f64,
},
PopTransform,
BeginShadow {
shadows: Vec<ShadowSpec>,
},
EndShadow,
BeginBlur {
radius: f64,
},
EndBlur,
BeginFilter {
filters: Vec<FilterSpec>,
},
EndFilter,
BeginMask {
mask: MaskSpec,
},
EndMask,
}Expand description
A single display-list command in the scene.
All variants are tagged in JSON via #[serde(tag = "op")] so that each
serialized command carries an "op" field naming the primitive, e.g.
{ "op": "FillRect", "x": 0.0, … }.
Variants§
FillRect
Fill an axis-aligned rectangle.
StrokeRect
Stroke an axis-aligned rectangle (inside the declared edge by default).
Fields
FillRoundedRect
Fill a rectangle with uniform corner radius (and optional per-corner overrides).
Fields
StrokeRoundedRect
Stroke a rectangle with uniform corner radius (and optional per-corner overrides).
Fields
stroke_dash: Option<f64>Dash segment length in pixels. None = solid stroke (byte-identical to prior IR).
FillEllipse
Fill an axis-aligned ellipse.
Fields
StrokeEllipse
Stroke an axis-aligned ellipse (centered on the ellipse path; no stroke-alignment in v0).
Fields
stroke_dash: Option<f64>Dash segment length in pixels. None = solid stroke (byte-identical to prior IR).
StrokeLine
Stroke a line segment.
Fields
FillPolygon
Fill a closed polygon.
Fields
StrokePolyline
Stroke a polyline (open or closed depending on closed).
Fields
align: StrokeAlignStroke alignment relative to the closed-path boundary. Only meaningful
when closed is true; Center is the open-path/default behavior.
Skipped in JSON when Center so existing scenes serialize byte-identically.
DrawImage
Draw a raster image asset clipped to its declared box.
The renderer re-resolves bytes via AssetProvider::by_id using only the
asset_id string — no raw image bytes appear in the IR. pos_x/pos_y
are the object-position anchors resolved to 0.0..=100.0.
Fields
DrawSvgAsset
Draw a pre-resolved SVG asset.
DrawGlyphRun
Draw a shaped, positioned glyph run.
x is the text-box origin x in pixels; y is the baseline y in
pixels (text_box_top + ascent). The renderer re-resolves font bytes
via FontProvider::by_id using only the font_id string — no raw
font bytes appear in the IR.
Fields
stroke_color: Option<Color>Optional stroke (outline) color applied after the fill.
None means no outline — byte-identical to a run without stroke.
stroke_width: Option<f64>Stroke width in pixels. Ignored (and serialized as absent) when
stroke_color is None or stroke_width is <= 0.
link: Option<String>Optional hyperlink URL for this run. When set and the run is
selectable, the PDF backend emits a clickable Link annotation over
the run’s bounds. None = no link — byte-identical to a run without
one. The raster backend ignores it (no clickable concept).
selectable: boolWhether this run’s text is selectable / searchable / indexable in the
PDF backend. true (default) → real embedded text + ToUnicode;
false → filled glyph outlines (visually identical, not extractable).
The raster backend ignores it. Serialized only when false, so
default runs stay byte-identical.
glyphs: Vec<SceneGlyph>Positioned glyphs, baseline-relative.
PushClip
Push an axis-aligned clip rectangle onto the clip stack.
PopClip
Pop the most-recently pushed clip rectangle.
PushLayer
Push a compositing layer (for opacity, blend, mask).
opacity is the layer alpha applied when the layer is composited back
onto its parent. blend_mode selects the compositing operator used for
that composite; None (and Some(BlendMode::Normal)) mean plain
source-over and serialize identically to a layer with no blend.
PopLayer
Pop the most-recently pushed compositing layer.
PushTransform
Push an affine rotation around a pivot; composes onto the renderer’s transform stack.
PopTransform
Pop the most recent pushed transform.
BeginShadow
Open an isolated capture of the following draw commands. The captured
ink is buffered offscreen until the matching SceneCommand::EndShadow.
shadows are painted in reverse order at EndShadow (so the
first-declared layer ends up on top of later layers), all behind the
crisp ink.
Fields
shadows: Vec<ShadowSpec>EndShadow
Close the active shadow capture: paint the blurred shadow layers, then composite the captured ink on top.
BeginBlur
Open an offscreen capture of the following draw commands and apply a
Gaussian blur with radius (sigma in pixels) to the captured ink at
SceneCommand::EndBlur. radius == 0 is a no-op (no capture opened).
EndBlur
Close the active blur capture: blur the captured ink in place, then composite it onto the current target.
BeginFilter
Open an offscreen capture; apply filters in order to the captured ink
at the matching EndFilter, then composite back. Empty filters opens no capture.
Fields
filters: Vec<FilterSpec>EndFilter
Close the active filter capture: transform the captured ink in place, composite onto the target.
BeginMask
Open an offscreen capture of the following draw commands; at the
matching SceneCommand::EndMask the captured ink is composited back
through the feathered coverage described by mask.
EndMask
Close the active mask capture: composite the captured ink through the mask coverage onto the current target.
Trait Implementations§
Source§impl Clone for SceneCommand
impl Clone for SceneCommand
Source§fn clone(&self) -> SceneCommand
fn clone(&self) -> SceneCommand
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SceneCommand
impl Debug for SceneCommand
Source§impl PartialEq for SceneCommand
impl PartialEq for SceneCommand
Source§fn eq(&self, other: &SceneCommand) -> bool
fn eq(&self, other: &SceneCommand) -> bool
self and other values to be equal, and is used by ==.