pub enum Generator {
Fill {
paint: Paint,
},
Shape {
shape: GeneratedShape,
center: Vec2,
size: Vec2,
rotation_degrees: f32,
fill: Option<Paint>,
stroke: Option<Stroke>,
},
Text {
text: String,
style: TextStyle,
},
}Expand description
The picture of a generated source.
A generated picture has the canvas’s size and aspect, like a source that
fills the frame at scale 1. Positions are in its normalized space, (0, 0)
top-left to (1, 1) bottom-right; lengths (radii, stroke widths) are
fractions of its shorter side, so the picture is the same at any render
resolution. It does not change over time: a clip animates it with its
transform, effects, and masks.
Variants§
Fill
Paint over the whole picture.
Shape
One shape on a transparent picture, filled, stroked, or both.
Fields
shape: GeneratedShapeThe shape’s outline.
Text
Text on a transparent picture, laid out and placed by its style as a
caption track’s cues are: its size and wrapping width fractions of
the canvas, its anchor at style.position. The engine draws it with
the fonts its host registered.
Fields
text: StringThe text; \n starts a line. Non-empty, at most
MAX_TEXT_CONTENT_BYTES bytes.
style: TextStyleHow it looks and where it lies. The font size is at most
MAX_TEXT_GENERATOR_FONT_SIZE.