pub trait Interpolate: Sized {
// Required method
fn interpolate_progress(
from: &Self,
to: &Self,
progress: InterpolationProgress,
) -> Self;
// Provided methods
fn lerp(&self, other: &Self, progress: f32) -> Self { ... }
fn interpolate(from: &Self, to: &Self, progress: f32) -> Self { ... }
fn extrapolate(from: &Self, to: &Self, progress: f32) -> Self { ... }
}Expand description
Interpolates values of the same type.
Required Methods§
Sourcefn interpolate_progress(
from: &Self,
to: &Self,
progress: InterpolationProgress,
) -> Self
fn interpolate_progress( from: &Self, to: &Self, progress: InterpolationProgress, ) -> Self
Interpolates from from to to using a prepared progress value.
Provided Methods§
Sourcefn lerp(&self, other: &Self, progress: f32) -> Self
fn lerp(&self, other: &Self, progress: f32) -> Self
Interpolates from self to other using normalized progress.
Sourcefn interpolate(from: &Self, to: &Self, progress: f32) -> Self
fn interpolate(from: &Self, to: &Self, progress: f32) -> Self
Interpolates from from to to using normalized progress.
Sourcefn extrapolate(from: &Self, to: &Self, progress: f32) -> Self
fn extrapolate(from: &Self, to: &Self, progress: f32) -> Self
Interpolates or extrapolates from from to to without clamping finite progress.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl Interpolate for Border
Available on crate features oklaba or rgba only.
impl Interpolate for Border
Available on crate features
oklaba or rgba only.fn interpolate_progress( from: &Border, to: &Border, progress: InterpolationProgress, ) -> Border
Source§impl Interpolate for Color
Available on crate feature rgba only.
impl Interpolate for Color
Available on crate feature
rgba only.fn interpolate_progress( from: &Color, to: &Color, progress: InterpolationProgress, ) -> Color
Source§impl Interpolate for Padding
impl Interpolate for Padding
fn interpolate_progress( from: &Padding, to: &Padding, progress: InterpolationProgress, ) -> Padding
Source§impl Interpolate for Radius
impl Interpolate for Radius
fn interpolate_progress( from: &Radius, to: &Radius, progress: InterpolationProgress, ) -> Radius
Source§impl Interpolate for Shadow
Available on crate features oklaba or rgba only.
impl Interpolate for Shadow
Available on crate features
oklaba or rgba only.