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);backgroundandbordertake theme colors. - Captioned
Video - A video under its captions.
- Captions
- Timed text.
- Color
Fill - An area painted one color.
- Conic
Paint {"conic": gradient}.- Counter
- A number counting from
starttoend, shown as text that changes on the frame grid. - Cue
- Text over an interval.
- Custom
Canvas - A canvas by its parts.
- Effect
Use - 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.
- Group
Transform - 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.
- Linear
Paint {"linear": gradient}.- Mask
contentshown 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.- Mask
Shape - One mask outline and how it combines with those before it.
- Matte
contentshown whereby’s picture is: by its alpha (text as a window onto video) or its luminance.byis 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.
- Music
Bed - Music under the video.
- Number
Format - How a counter writes its number.
- Offset
Stop - A gradient color at a set position.
- Placed
Child - A box child with item fields.
- Radial
Paint {"radial": gradient}.- Ramp
- A change from one value to another; before it the value is
from, after itto. - 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.
- Speaker
Look - 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.
- Theme
Color - A theme color, so a design follows whatever theme it is drawn with.
- Theme
Length - 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
starttoend, shifted byoffsetturns. - Video
Spec - 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.
- Caption
Style - How captions look.
- Direction
- A direction of travel on the canvas.
- Easing
Choice - 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. - File
Kind - What a media file holds, when its extension does not say.
- Fit
- How a picture fills its area.
- Frame
Rate Choice - A frame rate, as a number or exactly.
- Geometry
- One outline, in its area’s unit square. Masks take the same outlines.
- Grid
Length - How long a grid of clips of different lengths lasts.
- Inset
- Space kept clear inside an area.
- Layout
Size - A layout size: a number is a fraction of the picture’s shorter side,
"<n>px"canvas pixels. - Length
Token - A theme’s named lengths.
- Loudness
- The loudness an export normalizes to: a target, or a target and a ceiling.
- Matte
Use - What of a matte’s picture is coverage.
- Media
Item - A file given by its path alone, or a media node.
- Motion
Kind - What an entrance or exit moves.
- Node
- One part of a video.
- Paint
Choice - A color, a theme color, or a gradient.
- Reveal
Kind - How a revealed unit appears.
- Reveal
Unit - The unit a text is revealed by.
- Size
- A size in pixels, or one of the theme’s lengths.
- Solid
Color - One color: a theme color, CSS hex, or the project’s color object.
- Stop
- One gradient color.
- Text
Role - A theme text style.
- Theme
Choice - A theme by name, or one built on a named theme.
- Theme
Token - A theme’s named colors.
- Transition
Choice - A sequence’s transitions: none, the theme’s, or one given.
- When
Long - What a video longer than its node does.
- When
Short - 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.