pub struct FrameOffset { /* private fields */ }Expand description
Absolute frame offset from the epoch (midnight).
Implementations§
Source§impl FrameOffset
impl FrameOffset
Sourcepub fn add_frames(self, n: u64) -> Self
pub fn add_frames(self, n: u64) -> Self
Add a number of frames.
Sourcepub fn sub_frames(self, n: u64) -> Self
pub fn sub_frames(self, n: u64) -> Self
Subtract frames, saturating at zero.
Sourcepub fn diff(self, other: FrameOffset) -> i64
pub fn diff(self, other: FrameOffset) -> i64
Compute the difference in frames.
Sourcepub fn to_timecode(
self,
frame_rate: FrameRate,
) -> Result<Timecode, TimecodeError>
pub fn to_timecode( self, frame_rate: FrameRate, ) -> Result<Timecode, TimecodeError>
Convert to a timecode at the given frame rate.
Sourcepub fn to_seconds(self, frame_rate: FrameRate) -> f64
pub fn to_seconds(self, frame_rate: FrameRate) -> f64
Convert to wall-clock time in seconds.
Sourcepub fn from_seconds(seconds: f64, frame_rate: FrameRate) -> Self
pub fn from_seconds(seconds: f64, frame_rate: FrameRate) -> Self
Create from wall-clock time in seconds.
Sourcepub fn from_timecode(tc: &Timecode) -> Self
pub fn from_timecode(tc: &Timecode) -> Self
Create from a timecode.
Trait Implementations§
Source§impl Clone for FrameOffset
impl Clone for FrameOffset
Source§fn clone(&self) -> FrameOffset
fn clone(&self) -> FrameOffset
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 moreSource§impl Debug for FrameOffset
impl Debug for FrameOffset
Source§impl From<u64> for FrameOffset
impl From<u64> for FrameOffset
Source§impl Ord for FrameOffset
impl Ord for FrameOffset
Source§fn cmp(&self, other: &FrameOffset) -> Ordering
fn cmp(&self, other: &FrameOffset) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for FrameOffset
impl PartialEq for FrameOffset
Source§impl PartialOrd for FrameOffset
impl PartialOrd for FrameOffset
impl Copy for FrameOffset
impl Eq for FrameOffset
impl StructuralPartialEq for FrameOffset
Auto Trait Implementations§
impl Freeze for FrameOffset
impl RefUnwindSafe for FrameOffset
impl Send for FrameOffset
impl Sync for FrameOffset
impl Unpin for FrameOffset
impl UnsafeUnpin for FrameOffset
impl UnwindSafe for FrameOffset
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