Skip to main content

ffcine_comp/
lib.rs

1//! Compositions (`ffcine.comp/1`, `docs/compositing.md`): a canvas and layers, bottom first,
2//! whose parameters are param tracks ([`ffcine_core::anim`]). A comp is read and validated once
3//! ([`Comp`]), cut into pieces at layer in/out points ([`Comp::pieces`]), and each piece is
4//! lowered on the CPU into what the GPU pass takes: a base input and grade plus
5//! [`ffcine_render::Layer`]s with every track sampled per frame ([`Comp::lower`]). The piece's
6//! key hashes those sampled values, not the track definitions.
7//!
8//! Built (steps 2 and 3 of the plan): `video`, `still`, `solid`, `text` and nested `comp`
9//! layers, placement (`size`, `fit`, `content`, `crop`, `transform`), `radius`, shape `mask`,
10//! `blend`, `fade`, the canvas background and fade, and base promotion. Text lowers to
11//! [`ffcine_render::Overlay`]s drawn under the next layer up; a nested comp to a
12//! [`ffcine_render::LayerSource::Scene`] composited in the same pass. Per-layer grades, time
13//! remapping and filter graphs are rejected with the step that adds them.
14//!
15//! [`templates`] (`layout`, `story`) write a comp out from a few parameters when a comp file
16//! names one (`"template": {...}`).
17
18mod lower;
19mod model;
20pub mod templates;
21mod time;
22
23pub use lower::{Base, Media, Piece};
24pub use model::{
25    Canvas, Comp, CompLayer, Fit, MaskShape, SCHEMA, Source, is_comp, is_comp_file, limits,
26    read_document,
27};
28pub use time::pick as frame_pick;
29
30#[cfg(test)]
31mod filter_tests;
32#[cfg(test)]
33mod tests;