pub struct TcInterpolator { /* private fields */ }Expand description
Timecode interpolator that derives frame-accurate timecodes from sparse reference points.
Implementations§
Source§impl TcInterpolator
impl TcInterpolator
Sourcepub fn new(frame_rate: FrameRate, mode: InterpolationMode) -> Self
pub fn new(frame_rate: FrameRate, mode: InterpolationMode) -> Self
Creates a new interpolator with the given frame rate and mode.
Sourcepub fn with_max_gap(self, gap: u64) -> Self
pub fn with_max_gap(self, gap: u64) -> Self
Sets the maximum allowable gap in frames.
Sourcepub fn add_ref(&mut self, point: TcRefPoint)
pub fn add_ref(&mut self, point: TcRefPoint)
Adds a reference point. Points are kept sorted by position.
Sourcepub fn frame_rate(&self) -> FrameRate
pub fn frame_rate(&self) -> FrameRate
Returns the frame rate used for interpolation.
Sourcepub fn mode(&self) -> InterpolationMode
pub fn mode(&self) -> InterpolationMode
Returns the interpolation mode.
Sourcepub fn interpolate(
&self,
position: u64,
) -> Option<Result<Timecode, TimecodeError>>
pub fn interpolate( &self, position: u64, ) -> Option<Result<Timecode, TimecodeError>>
Interpolates the timecode at the given position.
Returns None if there are no reference points or the position is out of range
for the chosen interpolation mode.
Sourcepub fn validate_consistency(&self) -> Vec<ConsistencyIssue>
pub fn validate_consistency(&self) -> Vec<ConsistencyIssue>
Checks whether the reference points are consistent (i.e., timecode increments match positional deltas).
Trait Implementations§
Source§impl Clone for TcInterpolator
impl Clone for TcInterpolator
Source§fn clone(&self) -> TcInterpolator
fn clone(&self) -> TcInterpolator
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for TcInterpolator
impl RefUnwindSafe for TcInterpolator
impl Send for TcInterpolator
impl Sync for TcInterpolator
impl Unpin for TcInterpolator
impl UnsafeUnpin for TcInterpolator
impl UnwindSafe for TcInterpolator
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
Mutably borrows from an owned value. Read more