pub struct SpeedKeyframe {
pub frame: u64,
pub speed: f64,
}Expand description
A keyframe that defines speed at a specific output frame.
Fields§
§frame: u64Output frame at which this keyframe applies.
speed: f64Speed multiplier at this keyframe.
Implementations§
Source§impl SpeedKeyframe
impl SpeedKeyframe
Sourcepub fn interpolate_to(&self, other: &Self, t: f64) -> f64
pub fn interpolate_to(&self, other: &Self, t: f64) -> f64
Linearly interpolate speed toward other at t (0.0–1.0).
Returns the interpolated speed value.
Sourcepub fn t_at_frame(&self, other: &Self, frame: u64) -> Option<f64>
pub fn t_at_frame(&self, other: &Self, frame: u64) -> Option<f64>
Compute t at a given output frame between self and other.
Returns None if the keyframes are at the same frame.
Trait Implementations§
Source§impl Clone for SpeedKeyframe
impl Clone for SpeedKeyframe
Source§fn clone(&self) -> SpeedKeyframe
fn clone(&self) -> SpeedKeyframe
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 moreimpl Copy for SpeedKeyframe
Auto Trait Implementations§
impl Freeze for SpeedKeyframe
impl RefUnwindSafe for SpeedKeyframe
impl Send for SpeedKeyframe
impl Sync for SpeedKeyframe
impl Unpin for SpeedKeyframe
impl UnsafeUnpin for SpeedKeyframe
impl UnwindSafe for SpeedKeyframe
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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 more