Skip to main content

Crate ffcine_comp

Crate ffcine_comp 

Source
Expand description

Compositions (ffcine.comp/1, docs/compositing.md): a canvas and layers, bottom first, whose parameters are param tracks (ffcine_core::anim). A comp is read and validated once (Comp), cut into pieces at layer in/out points (Comp::pieces), and each piece is lowered on the CPU into what the GPU pass takes: a base input and grade plus ffcine_render::Layers with every track sampled per frame (Comp::lower). The piece’s key hashes those sampled values, not the track definitions.

Built (steps 2 and 3 of the plan): video, still, solid, text and nested comp layers, placement (size, fit, content, crop, transform), radius, shape mask, blend, fade, the canvas background and fade, and base promotion. Text lowers to ffcine_render::Overlays drawn under the next layer up; a nested comp to a ffcine_render::LayerSource::Scene composited in the same pass. Per-layer grades, time remapping and filter graphs are rejected with the step that adds them.

templates (layout, story) write a comp out from a few parameters when a comp file names one ("template": {...}).

Modules§

limits
Limits a comp is checked against (docs/compositing.md#limits).
templates
Templates (docs/compositing.md#templates): functions from a few parameters to an ordinary comp document, run when a comp file is read. A comp file names one as "template": {"story": {...}} or "template": {"layout": {...}, "panels": [...], ...}; expand writes it out (ffcine comp lower prints the result), so templates add no render path and the plan keys only see the lowered layers.

Structs§

Canvas
The canvas: size, rate, duration, and the animated background and fade.
Comp
A composition: a canvas and layers, bottom first.
CompLayer
One layer.
Piece
A lowered piece: comp frames from..from + frames.

Enums§

Base
The pass’s input.
Fit
How the source fills the layer’s box.
MaskShape
A mask’s shape.
Source
What a layer shows.

Constants§

SCHEMA
The schema name ("schema": "ffcine.comp/1").

Traits§

Media
What lowering needs to know about media files.

Functions§

frame_pick
The source frame a layer frame shows, from its source times at the frame (s) and half a frame later (mid), on a source of rate fps and frames frames. Moving forward, it is the fps filter’s pick (round=near, half away from zero): the last source frame whose remapped time rounds to this frame or earlier, i.e. the last one strictly before mid (a frame exactly on mid rounds to the next one). Holding or going back, the nearest frame to s. Clamped to the source.
is_comp
Whether v is a comp document (schema is ffcine.comp/N), as opposed to a timeline.
is_comp_file
Whether the file at path is a comp document (JSON, or YAML by extension); false for timelines and unreadable files.
read_document
A comp file’s document as written (JSON, or YAML for .yaml/.yml), templates not expanded (crate::templates::expand does that).