pub struct SyncMap {
pub sync_points: Vec<TcSyncPoint>,
}Expand description
A collection of sync points that defines a piecewise-linear mapping between source and target frame domains.
Fields§
§sync_points: Vec<TcSyncPoint>Ordered list of sync points (sorted by source_frame)
Implementations§
Source§impl SyncMap
impl SyncMap
Sourcepub fn add_sync_point(&mut self, point: TcSyncPoint)
pub fn add_sync_point(&mut self, point: TcSyncPoint)
Add a sync point. The internal list is kept sorted by source_frame.
Sourcepub fn point_count(&self) -> usize
pub fn point_count(&self) -> usize
Return the number of sync points
Sourcepub fn source_to_target(&self, frame: i64) -> i64
pub fn source_to_target(&self, frame: i64) -> i64
Convert a source frame to a target frame using linear interpolation.
- If there are no sync points, returns
source_frameunchanged. - If
source_frameis before the first sync point or after the last, the nearest endpoint’s offset is extrapolated. - Otherwise, interpolates linearly between the bounding sync points.
Sourcepub fn target_to_source(&self, frame: i64) -> i64
pub fn target_to_source(&self, frame: i64) -> i64
Convert a target frame to a source frame using linear interpolation.
Uses the same piecewise-linear logic but operates on the target axis.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SyncMap
impl RefUnwindSafe for SyncMap
impl Send for SyncMap
impl Sync for SyncMap
impl Unpin for SyncMap
impl UnsafeUnpin for SyncMap
impl UnwindSafe for SyncMap
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