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::compileturns into a project document.
Structs§
- Compiled
- A compiled spec: the project, and what an export of it needs besides.
- Compose
Error - 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.
- Loudness
Target - The loudness an export normalizes to.
- Media
Facts - One media file’s shape and length.
- Required
Media - A media file a spec names.
- Requirements
- The files a spec names.
Constants§
- THEMES
- The built-in themes, by name.
Functions§
- compile
- Compiles
specwithfactsabout its files.fontsare the font files an export registers, in its fallback order; with them, text that must fit is measured and shrunk to fit. - compile_
json compileacross 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
specnames, for a binding to describe before compiling. - requirements_
json requirementsacross a JSON boundary.