Skip to main content

Crate alpha2_compose

Crate alpha2_compose 

Source
Expand description

Compose specs for alpha2: a video described by intent, compiled into a plain project document.

A VideoSpec says what a video is made of: a body (sequences, stacks, grids, media, text, captions, and components such as slideshows, title cards and comparison grids), what is drawn over it, and what plays under it. compile turns it into a alpha2_model::Project that alpha2_model::Project::validate accepts, and the export options the project does not hold. The result is an ordinary project: open it in the editor, change it, render it anywhere.

Compiling is a pure function. It reads no files: what it needs to know about the files a spec names (sizes, lengths, caption text) comes in as Facts, which a binding gathers from the list requirements makes. The same spec, facts, fonts and compiler version give the same project, byte for byte.

The spec is data without logic: no loops, conditions or expressions. Programs build specs in their own language; components that take any number of inputs are Rust code here.

Re-exports§

pub use spec::COMPOSE_VERSION;
pub use spec::VideoSpec;

Modules§

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

Structs§

Compiled
A compiled spec: the project, and what an export of it needs besides.
ComposeError
Why a spec does not compile: where in it, and what is wrong.
Facts
What the compiler knows of the files a spec names, by the path the spec gives them.
LoudnessTarget
The loudness an export normalizes to.
MediaFacts
One media file’s shape and length.
RequiredMedia
A media file a spec names.
Requirements
The files a spec names.

Constants§

THEMES
The built-in themes, by name.

Functions§

compile
Compiles spec with facts about its files. fonts are the font files an export registers, in its fallback order; with them, text that must fit is measured and shrunk to fit.
compile_json
compile across a JSON boundary: the spec and facts as JSON text, the result as JSON text ({project, assets, loudness, warnings}).
kind_of_path
What a file holds by its extension: a still for the image formats the host decodes itself, sound for the audio-only ones, video otherwise. Formats an extension provider reads (an animated GIF, SVG, OpenEXR) are not media nodes’ to guess.
parse_facts
Parses facts from JSON.
parse_spec
Parses a spec from JSON, naming where a value that does not parse lies.
requirements
The files spec names, for a binding to describe before compiling.
requirements_json
requirements across a JSON boundary.