Expand description
ffcine.text generator clips (place cards, time cards, subtitles, titles) rendered as GPU
overlays, only over their own time ranges: see docs/text.md.
TextLayer collects a timeline’s text clips with their resolved styles
(metadata.ffcine.project.styles); TextLayer::overlays lays out the ones overlapping a
segment with cosmic-text and returns Overlays that the render pipeline composites in its
libplacebo pass (ffcine_render::Pipeline::overlays). Segment renderers split at
TextLayer::cuts and key their cache on TextLayer::fingerprint, so a card edit
re-renders only the seconds it covers. ass imports .ass subtitles as text clips;
anim animates text (slide, pop, typewriter, wipe, keyframes) and title expands
ffcine.title clips (title sequences, end screens) into text pieces.
use ffcine_render::{Pipeline, Size};
use ffcine_text::TextLayer;
use ffcine_timeline::Timeline;
let t = Timeline::from_file("edit.otio")?;
let mut text = TextLayer::from_timeline(&t, ".")?;
// A segment of 96 frames starting 12.5 s into the timeline, rendered at 4K.
let size = Size { width: 3840, height: 2160 };
let overlays = text.overlays(12.5, 96, 24000.0 / 1001.0, size)?;
let p = Pipeline::new("shot.mov", "seg.mkv").overlays(overlays);Re-exports§
pub use anim::Animation;pub use layout::Layer;pub use layout::Rendered;pub use layout::Role;pub use layout::Typesetter;pub use style::Align;pub use style::TextStyle;
Modules§
- anim
- Text animations (
animation.in/animation.out: fade, slide, pop, typewriter, wipe, by word, line or character with a stagger) and keyframed parameters (keyframes.position,scale,opacity,colour), baked into per-frame overlay placements (Motion). - ass
.ass/.ssasubtitles ->ffcine.textclips, so existing subtitle files render through the same GPU text path as cards.- layout
- Laying out and rasterising text with
cosmic-text: one coverage mask per text, plus derived masks for the shadow (blurred) and outline (dilated), asLayers ready to be overlays. - style
- Resolving an
ffcine.textclip’s look:project.styles.base<- itsstyle(and that style’sbased_onchain) <- the clip’s own parameters, then read into aTextStyle. - title
ffcine.titlegenerator clips: a designed title sequence or end screen (title words staggering in, a rule drawing out from the middle, subtitle and credit lines after them, an optional backdrop), expanded intoffcine.textpieces that render like any text clip.
Structs§
- Text
Clip - One
ffcine.textclip on the timeline. - Text
Layer - A timeline’s text clips, ready to render per segment.
Constants§
- GENERATOR
generator_kindof text clips.