Skip to main content

Crate alpha2_compose

Crate alpha2_compose 

Source
Expand description

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

compile turns a VideoSpec into an alpha2_model::Project that alpha2_model::Project::validate accepts, plus the export options the project does not hold.

Compiling is pure and reads no files. Facts about the files a spec names come in as Facts, gathered by a binding from requirements. The same spec, facts, fonts and compiler version give a byte-identical project.

A spec has no logic. A template adds parameters, $if, $switch, $each and {{name}}, which binding removes. 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.
template
Templates are compose documents with typed parameters, bound to data into plain specs.

Structs§

Compiled
A compiled spec: the project, and what an export of it needs besides.
ComposeError
Why a spec does not compile, and where.
Facts
What the compiler knows of the files a spec names, keyed by the path the spec gives.
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§

DEFAULT_TRUE_PEAK_CEILING_DBTP
The true-peak ceiling a loudness target without one takes, in dBTP: EBU R128’s.
THEMES
The built-in themes, by name.

Functions§

bind_json
template::bind across a JSON boundary: options is {theme?, templates?}.
compile
Compiles spec with facts about its files.
compile_json
compile across a JSON boundary. The result is {project, assets, loudness, warnings}.
data_schema_json
template::data_schema across a JSON boundary.
kind_of_path
What a file holds by its extension: a still for image formats the host decodes, sound for audio-only formats, video otherwise. Formats read by extension providers (animated GIF, SVG, OpenEXR) are not guessed.
lint_json
template::lint across a JSON boundary: data may be empty for none, and options is {templates?}. Returns the issues as a JSON list.
media_facts_json
MediaFacts::from_fingerprint across a JSON boundary: a host’s fingerprint of a file in, its facts out.
parse_facts
Parses facts from JSON.
parse_spec
Parses a spec from JSON, naming where an unparsable value lies.
requirements
The files spec names, for a binding to describe before compiling.
requirements_json
requirements across a JSON boundary.
templates_json
The 1st-party alpha2/ templates, as a JSON list.