pub struct FrameTimecode {
pub frame_number: u64,
pub fps_num: u32,
pub fps_den: u32,
}Expand description
A timecode value expressed as total frames at a given frame rate.
Fields§
§frame_number: u64Total frame count from zero.
fps_num: u32Frame rate numerator.
fps_den: u32Frame rate denominator.
Implementations§
Source§impl FrameTimecode
impl FrameTimecode
Sourcepub fn from_hmsf(
hours: u64,
minutes: u64,
seconds: u64,
frames: u64,
fps: u64,
) -> Self
pub fn from_hmsf( hours: u64, minutes: u64, seconds: u64, frames: u64, fps: u64, ) -> Self
Create a timecode from hours, minutes, seconds, frames at 24fps.
Sourcepub fn as_seconds(&self) -> f64
pub fn as_seconds(&self) -> f64
Duration in seconds.
Sourcepub fn frame_diff(&self, other: &Self) -> i64
pub fn frame_diff(&self, other: &Self) -> i64
Compute the difference in frames from another timecode.
Returns a positive value if self is later than other.
Trait Implementations§
Source§impl Clone for FrameTimecode
impl Clone for FrameTimecode
Source§fn clone(&self) -> FrameTimecode
fn clone(&self) -> FrameTimecode
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 FrameTimecode
impl Debug for FrameTimecode
Source§impl Ord for FrameTimecode
impl Ord for FrameTimecode
Source§fn cmp(&self, other: &FrameTimecode) -> Ordering
fn cmp(&self, other: &FrameTimecode) -> 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 FrameTimecode
impl PartialEq for FrameTimecode
Source§impl PartialOrd for FrameTimecode
impl PartialOrd for FrameTimecode
impl Copy for FrameTimecode
impl Eq for FrameTimecode
impl StructuralPartialEq for FrameTimecode
Auto Trait Implementations§
impl Freeze for FrameTimecode
impl RefUnwindSafe for FrameTimecode
impl Send for FrameTimecode
impl Sync for FrameTimecode
impl Unpin for FrameTimecode
impl UnsafeUnpin for FrameTimecode
impl UnwindSafe for FrameTimecode
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
Converts
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>
Converts
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