Skip to main content

Module spec

Module spec 

Source
Expand description

The compose spec: a video described by intent, which crate::compile turns into a project document.

Times are seconds, rounded to the nearest tick (1/120 000 s). Lengths are canvas pixels. Colors are CSS hex strings or the project’s {red, green, blue, alpha} object. Nodes are tagged by type, and a node with an id can be named by another (a music bed ducks under it).

Structs§

Audio
A sound file.
BoxBorder
A box border.
BoxNode
A box laid out by CSS flexbox (the default) or grid, filling the node’s area. Its fields are the engine layout’s container fields as CSS writes them (flex_direction, gap, "8px 16px" paddings, "repeat(3, 1fr)" tracks); background and border take theme colors.
CaptionedVideo
A video under its captions.
Captions
Timed text.
ColorFill
An area painted one color.
ConicPaint
{"conic": gradient}.
Counter
A number counting from start to end, shown as text that changes on the frame grid.
Cue
Text over an interval.
CustomCanvas
A canvas by its parts.
EffectUse
One effect: a built-in by its short name (gaussian-blur) or any effect by its full id, with its parameters by name. A parameter is a constant, a ramp or keys; a named image input is a node.
Gradient
Colors spread over a gradient.
Grid
Children in grid cells.
Group
Children drawn together as one layer. Unlike a stack, whose children each meet what is under them, a group composites its children first: its opacity, blend mode, effects and transform apply to that one picture.
GroupTransform
A group’s movement, about anchor.
Key
One keyed value.
Keys
Values at times; the value holds before the first and after the last.
Layout
A layout generator.
LinearPaint
{"linear": gradient}.
Mask
content shown only inside outlines, combined in order. Outlines are in the node’s area as a shape’s are, and stay put while the content moves.
MaskShape
One mask outline and how it combines with those before it.
Matte
content shown where by’s picture is: by its alpha (text as a window onto video) or its luminance. by is never drawn itself. Both are placed in the node’s area.
Media
A video or still file.
Motion
An entrance or exit, timed from the node’s own start or back from its own end.
MusicBed
Music under the video.
NumberFormat
How a counter writes its number.
OffsetStop
A gradient color at a set position.
PlacedChild
A box child with item fields.
RadialPaint
{"radial": gradient}.
Ramp
A change from one value to another; before it the value is from, after it to.
Raw
Part of a project at its own times.
Reveal
A text revealed a unit at a time. Each unit moves at a constant rate over duration.
Sequence
Children one after another.
Shape
Shapes in the node’s area, filled and stroked as one compound path. Coordinates are fractions of the area, [0, 0] its top left to [1, 1] its bottom right; lengths are fractions of its shorter side.
Slideshow
Stills or clips in turn.
SpeakerLook
How one speaker’s captions look.
Stack
Children over each other.
Stroke
A line along outlines.
Text
Text in one of the theme’s styles.
TextFit
The font sizes a text is fitted between, in pixels.
Theme
How text, panels and timings look. Parts left out come from the base theme. Sizes are fractions of the canvas’s shorter side, so a theme looks the same on wide and tall canvases.
ThemeColor
A theme color, so a design follows whatever theme it is drawn with.
ThemeLength
One of the theme’s lengths times scale, as a fraction of the picture’s shorter side.
Transition
The transition between two neighbours of a sequence.
Trim
The part of outlines’ length that is kept, from start to end, shifted by offset turns.
VideoSpec
A whole video: a body, what is drawn over it, and what plays under it.

Enums§

Align
A point of an area: its center, an edge’s middle or a corner.
Anim
A value over a node’s time: a constant, a ramp from one value to another, or keys. Times are seconds from the node’s start.
BoxChild
A box’s child: a node, or {"box": item fields, "node": node} when it has item fields (size, flex or grid placement, aspect_ratio, border_radius, margin).
Canvas
The canvas: a preset name, or its parts.
CaptionStyle
How captions look.
Direction
A direction of travel on the canvas.
EasingChoice
A timing curve: linear, a CSS name (ease, ease-in, ease-out, ease-in-out) or a project easing object.
Ellipsis
What ends a cut line: an ellipsis or nothing (true, false), or a text.
FileKind
What a media file holds, when its extension does not say.
Fit
How a picture fills its area.
FrameRateChoice
A frame rate, as a number or exactly.
Geometry
One outline, in its area’s unit square. Masks take the same outlines.
GridLength
How long a grid of clips of different lengths lasts.
Inset
Space kept clear inside an area.
LayoutSize
A layout size: a number is a fraction of the picture’s shorter side, "<n>px" canvas pixels.
LengthToken
A theme’s named lengths.
Loudness
The loudness an export normalizes to: a target, or a target and a ceiling.
MatteUse
What of a matte’s picture is coverage.
MediaItem
A file given by its path alone, or a media node.
MotionKind
What an entrance or exit moves.
Node
One part of a video.
PaintChoice
A color, a theme color, or a gradient.
RevealKind
How a revealed unit appears.
RevealUnit
The unit a text is revealed by.
Size
A size in pixels, or one of the theme’s lengths.
SolidColor
One color: a theme color, CSS hex, or the project’s color object.
Stop
One gradient color.
TextRole
A theme text style.
ThemeChoice
A theme by name, or one built on a named theme.
ThemeToken
A theme’s named colors.
TransitionChoice
A sequence’s transitions: none, the theme’s, or one given.
WhenLong
What a video longer than its node does.
WhenShort
What a video shorter than its node does once it ends.

Constants§

COMPOSE_SCHEMA_ID
Where the compose schema is published.
COMPOSE_VERSION
The newest compose spec version this build reads.