pub struct SubFrameOffset {
pub frame_offset: i64,
pub fractional: f64,
pub peak_value: f64,
pub confidence: f64,
}Expand description
Result of sub-frame interpolation.
Fields§
§frame_offset: i64Integer frame offset (from peak location).
fractional: f64Fractional offset within the frame (-0.5..+0.5).
peak_value: f64Interpolated peak value at the refined position.
confidence: f64Confidence of the interpolation (0.0..1.0).
Implementations§
Source§impl SubFrameOffset
impl SubFrameOffset
Sourcepub fn new(
frame_offset: i64,
fractional: f64,
peak_value: f64,
confidence: f64,
) -> Self
pub fn new( frame_offset: i64, fractional: f64, peak_value: f64, confidence: f64, ) -> Self
Create a new sub-frame offset.
Sourcepub fn total_frames(&self) -> f64
pub fn total_frames(&self) -> f64
Return the total offset in frames (integer + fractional).
Sourcepub fn to_seconds(&self, frame_rate: f64) -> f64
pub fn to_seconds(&self, frame_rate: f64) -> f64
Convert the total offset to seconds given a frame rate.
Trait Implementations§
Source§impl Clone for SubFrameOffset
impl Clone for SubFrameOffset
Source§fn clone(&self) -> SubFrameOffset
fn clone(&self) -> SubFrameOffset
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 SubFrameOffset
impl Debug for SubFrameOffset
Source§impl PartialEq for SubFrameOffset
impl PartialEq for SubFrameOffset
Source§fn eq(&self, other: &SubFrameOffset) -> bool
fn eq(&self, other: &SubFrameOffset) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for SubFrameOffset
impl StructuralPartialEq for SubFrameOffset
Auto Trait Implementations§
impl Freeze for SubFrameOffset
impl RefUnwindSafe for SubFrameOffset
impl Send for SubFrameOffset
impl Sync for SubFrameOffset
impl Unpin for SubFrameOffset
impl UnsafeUnpin for SubFrameOffset
impl UnwindSafe for SubFrameOffset
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> 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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.