pub struct EngineProject { /* private fields */ }Expand description
An immutable project snapshot and its reusable evaluation index.
Implementations§
Source§impl EngineProject
impl EngineProject
Sourcepub fn layers_at(
&self,
time: MediaTime,
) -> Result<Vec<EvaluatedLayer<'_>>, EvalError>
pub fn layers_at( &self, time: MediaTime, ) -> Result<Vec<EvaluatedLayer<'_>>, EvalError>
Every clip the frame at time places, in drawing order.
Corners come from the clip’s own transform, without compositions, masks, corrections or a shutter.
§Errors
Returns an error if the immutable index and project disagree.
Sourcepub fn layers_json(&self, time: MediaTime) -> Result<String, EvalError>
pub fn layers_json(&self, time: MediaTime) -> Result<String, EvalError>
Self::layers_at as JSON { time, canvas: { width, height }, layers }, each layer
{ clip, track, source, draws, opacity, transform: { position, anchor, scale, rotationDegrees }, corners, picture, adjustment, matte } with position, anchor and
scale as { x, y }, and corners and picture (or null) as four [x, y] canvas
pixels: top left, top right, bottom left, bottom right.
§Errors
Returns an error if the immutable index and project disagree.
Source§impl EngineProject
impl EngineProject
Sourcepub fn new(project: Project) -> Result<Self, EvalError>
pub fn new(project: Project) -> Result<Self, EvalError>
Validates a project and builds its active interval index.
§Errors
Returns an evaluation error when the project is structurally invalid.
Sourcepub const fn generation(&self) -> u64
pub const fn generation(&self) -> u64
Process-unique snapshot identity, shared by clones. An crate::Exporter renders only
its own snapshot.
Sourcepub const fn draws_text(&self) -> bool
pub const fn draws_text(&self) -> bool
Whether any frame may draw text, which the host must prepare
(crate::TextTextures::prepare_at).
Sourcepub fn evaluate(&self, time: MediaTime) -> Result<FrameDesc<'_>, EvalError>
pub fn evaluate(&self, time: MediaTime) -> Result<FrameDesc<'_>, EvalError>
Evaluates a deterministic frame description.
§Errors
Returns an error if the immutable index and project disagree.
Sourcepub fn plan_errors(&self, range: TimeRange) -> Vec<EvalError>
pub fn plan_errors(&self, range: TimeRange) -> Vec<EvalError>
The errors Self::evaluate would return in range because a clip’s composition cannot
draw (alpha2_eval::ActiveIndex::plan_errors). An export checks its range before frame 0.
Sourcepub fn frame_needs(&self, time: MediaTime) -> Result<Vec<FrameNeed>, EvalError>
pub fn frame_needs(&self, time: MediaTime) -> Result<Vec<FrameNeed>, EvalError>
Returns the host frames needed at a timeline timestamp.
§Errors
Returns an error if the immutable index and project disagree.
Sourcepub fn evaluate_audio(
&self,
range: TimeRange,
) -> Result<AudioSpanDesc<'_>, EvalError>
pub fn evaluate_audio( &self, range: TimeRange, ) -> Result<AudioSpanDesc<'_>, EvalError>
Evaluates every audio clip overlapping a half-open timeline span.
§Errors
Returns an error if the immutable index and project disagree.
Sourcepub fn evaluate_audio_in<'s>(
&self,
range: TimeRange,
scratch: &'s mut AudioSpanScratch,
) -> Result<AudioSpan<'_, 's>, EvalError>
pub fn evaluate_audio_in<'s>( &self, range: TimeRange, scratch: &'s mut AudioSpanScratch, ) -> Result<AudioSpan<'_, 's>, EvalError>
Self::evaluate_audio into reusable scratch.
§Errors
Returns an error if the immutable index and project disagree.
Sourcepub fn timeline_range(&self) -> Option<TimeRange>
pub fn timeline_range(&self) -> Option<TimeRange>
The smallest interval holding everything the timeline shows, captions included
(alpha2_model::Timeline::extent).
Sourcepub fn effects(&self) -> Vec<(&str, u32)>
pub fn effects(&self) -> Vec<(&str, u32)>
Every effect the project can draw, by id and version, each once. Compositions that cannot draw are reported when a frame shows them.
Sourcepub fn check_effects(&self, renderer: &Renderer) -> Result<(), EngineError>
pub fn check_effects(&self, renderer: &Renderer) -> Result<(), EngineError>
Checks that renderer can draw every effect the project uses
(Self::effects).
§Errors
Returns crate::EngineError::UnregisteredEffect naming the first missing one.
Sourcepub fn sample_context(&self) -> SampleContext<'_>
pub fn sample_context(&self) -> SampleContext<'_>
What the project’s timeline-time values read their data bindings through.
Trait Implementations§
Source§impl Clone for EngineProject
impl Clone for EngineProject
Auto Trait Implementations§
impl Forget for EngineProject
impl Freeze for EngineProjectwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<MediaSource>: Freeze,
PhantomData<EffectResource>: Freeze,
PhantomData<Composition>: Freeze,
PhantomData<Track>: Freeze,
PhantomData<Keyframe<f32>>: Freeze,
PhantomData<Animated<f32>>: Freeze,
*const DataBinding is !null: Freeze,
PhantomData<DataBinding>: Freeze,
PhantomData<AudioEffect>: Freeze,
PhantomData<AudioBus>: Freeze,
PhantomData<DataSet>: Freeze,
PhantomData<IntervalNode>: Freeze,
PhantomData<IndexedTransition>: Freeze,
PhantomData<IndexedCaptions>: Freeze,
PhantomData<(DataSetId, usize)>: Freeze,
PhantomData<(ClipId, (usize, usize))>: Freeze,
PhantomData<(ClipId, OnceLock<Vec<i64>>)>: Freeze,
PhantomData<Option<(u32, u32)>>: Freeze,
PhantomData<(ClipId, CurveStretches)>: Freeze,
impl Move for EngineProject
impl RefUnwindSafe for EngineProjectwhere
Atomic<usize>: RefUnwindSafe,
OnceLock<Vec<i64>>: RefUnwindSafe,
OnceLock<Vec<Stretch>>: RefUnwindSafe,
impl Send for EngineProjectwhere
RawVecInner: Send,
BoxRaw<DataBinding>: Send,
BoxRaw<MotionPath>: Send,
BoxRaw<TextStyle>: Send,
BoxRaw<LayoutNode>: Send,
NodeRef<Owned, String, Animated<EffectValue>, LeafOrInternal>: Send,
BoxRaw<(String, Animated<EffectValue>)>: Send,
NodeRef<Owned, String, EffectResourceId, LeafOrInternal>: Send,
BoxRaw<(String, EffectResourceId)>: Send,
NodeRef<Owned, String, Option<NodeId>, LeafOrInternal>: Send,
BoxRaw<(String, Option<NodeId>)>: Send,
NodeRef<Owned, String, TextStylePatch, LeafOrInternal>: Send,
BoxRaw<(String, TextStylePatch)>: Send,
NodeRef<Owned, String, Value, LeafOrInternal>: Send,
BoxRaw<(String, Value)>: Send,
Arc<Result<CompositionPlan, PlanError>>: Send,
Arc<GeneratorPlan>: Send,
RawTable<(DataSetId, usize)>: Send,
RawTable<(ClipId, (usize, usize))>: Send,
RawTable<(ClipId, OnceLock<Vec<i64>>)>: Send,
RawTable<(ClipId, CurveStretches)>: Send,
impl Sync for EngineProjectwhere
RawVecInner: Sync,
BoxRaw<DataBinding>: Sync,
BoxRaw<MotionPath>: Sync,
BoxRaw<TextStyle>: Sync,
BoxRaw<LayoutNode>: Sync,
NodeRef<Owned, String, Animated<EffectValue>, LeafOrInternal>: Sync,
BoxRaw<(String, Animated<EffectValue>)>: Sync,
NodeRef<Owned, String, EffectResourceId, LeafOrInternal>: Sync,
BoxRaw<(String, EffectResourceId)>: Sync,
NodeRef<Owned, String, Option<NodeId>, LeafOrInternal>: Sync,
BoxRaw<(String, Option<NodeId>)>: Sync,
NodeRef<Owned, String, TextStylePatch, LeafOrInternal>: Sync,
BoxRaw<(String, TextStylePatch)>: Sync,
NodeRef<Owned, String, Value, LeafOrInternal>: Sync,
BoxRaw<(String, Value)>: Sync,
Arc<Result<CompositionPlan, PlanError>>: Sync,
Arc<GeneratorPlan>: Sync,
RawTable<(DataSetId, usize)>: Sync,
RawTable<(ClipId, (usize, usize))>: Sync,
RawTable<(ClipId, OnceLock<Vec<i64>>)>: Sync,
RawTable<(ClipId, CurveStretches)>: Sync,
impl Unpin for EngineProjectwhere
*const u8 is !null: Unpin,
Box<DataBinding>: Unpin,
Box<MotionPath>: Unpin,
Box<TextStyle>: Unpin,
Box<LayoutNode>: Unpin,
*const LeafNode<String, Animated<EffectValue>> is !null: Unpin,
Box<(String, Animated<EffectValue>)>: Unpin,
*const LeafNode<String, EffectResourceId> is !null: Unpin,
Box<(String, EffectResourceId)>: Unpin,
*const LeafNode<String, Option<NodeId>> is !null: Unpin,
Box<(String, Option<NodeId>)>: Unpin,
*const LeafNode<String, TextStylePatch> is !null: Unpin,
Box<(String, TextStylePatch)>: Unpin,
*const LeafNode<String, Value> is !null: Unpin,
Box<(String, Value)>: Unpin,
Arc<Result<CompositionPlan, PlanError>>: Unpin,
Arc<GeneratorPlan>: Unpin,
Align4<u32>: Unpin,
impl UnsafeUnpin for EngineProjectwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<MediaSource>: UnsafeUnpin,
PhantomData<EffectResource>: UnsafeUnpin,
PhantomData<Composition>: UnsafeUnpin,
PhantomData<Track>: UnsafeUnpin,
PhantomData<Keyframe<f32>>: UnsafeUnpin,
PhantomData<Animated<f32>>: UnsafeUnpin,
*const DataBinding is !null: UnsafeUnpin,
PhantomData<DataBinding>: UnsafeUnpin,
PhantomData<AudioEffect>: UnsafeUnpin,
PhantomData<AudioBus>: UnsafeUnpin,
PhantomData<DataSet>: UnsafeUnpin,
PhantomData<IntervalNode>: UnsafeUnpin,
PhantomData<IndexedTransition>: UnsafeUnpin,
PhantomData<IndexedCaptions>: UnsafeUnpin,
PhantomData<(DataSetId, usize)>: UnsafeUnpin,
PhantomData<(ClipId, (usize, usize))>: UnsafeUnpin,
PhantomData<(ClipId, OnceLock<Vec<i64>>)>: UnsafeUnpin,
PhantomData<Option<(u32, u32)>>: UnsafeUnpin,
PhantomData<(ClipId, CurveStretches)>: UnsafeUnpin,
impl UnwindSafe for EngineProjectwhere
RawVecInner: UnwindSafe,
BoxRaw<DataBinding>: UnwindSafe,
BoxRaw<MotionPath>: UnwindSafe,
BoxRaw<TextStyle>: UnwindSafe,
BoxRaw<LayoutNode>: UnwindSafe,
BTreeMap<String, Animated<EffectValue>>: UnwindSafe,
BTreeMap<String, EffectResourceId>: UnwindSafe,
BTreeMap<String, Option<NodeId>>: UnwindSafe,
BTreeMap<String, TextStylePatch>: UnwindSafe,
BTreeMap<String, Value>: UnwindSafe,
Arc<Result<CompositionPlan, PlanError>>: UnwindSafe,
Arc<GeneratorPlan>: UnwindSafe,
HashMap<DataSetId, usize>: UnwindSafe,
HashMap<ClipId, (usize, usize)>: UnwindSafe,
HashMap<ClipId, OnceLock<Vec<i64>>>: UnwindSafe,
HashMap<ClipId, CurveStretches>: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more