pub struct TransformAnimation {
pub start_ms: u32,
pub end_ms: u32,
pub accel: f32,
pub target_tags: Vec<AnimatableTag>,
}Expand description
Transform animation data
Fields§
§start_ms: u32Start time in milliseconds (relative to line start)
end_ms: u32End time in milliseconds (relative to line start)
accel: f32Acceleration factor (1.0 = linear, >1 = ease-in, <1 = ease-out)
Tags to animate to
Implementations§
Source§impl TransformAnimation
impl TransformAnimation
Sourcepub fn calculate_progress(&self, current_ms: u32, full_duration_ms: u32) -> f32
pub fn calculate_progress(&self, current_ms: u32, full_duration_ms: u32) -> f32
Calculate interpolation progress for the current time (all in milliseconds relative to the event start).
full_duration_ms is the event’s duration: a \t with no explicit end time
(\t(tags) or \t(accel,tags)) animates across the whole event, matching
libass, rather than snapping straight to the target.
Trait Implementations§
Source§impl Clone for TransformAnimation
impl Clone for TransformAnimation
Source§fn clone(&self) -> TransformAnimation
fn clone(&self) -> TransformAnimation
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 moreAuto Trait Implementations§
impl Freeze for TransformAnimation
impl RefUnwindSafe for TransformAnimation
impl Send for TransformAnimation
impl Sync for TransformAnimation
impl Unpin for TransformAnimation
impl UnsafeUnpin for TransformAnimation
impl UnwindSafe for TransformAnimation
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 more