Skip to main content

Interpolate

Trait Interpolate 

Source
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§

Source

fn interpolate_progress( from: &Self, to: &Self, progress: InterpolationProgress, ) -> Self

Interpolates from from to to using a prepared progress value.

Provided Methods§

Source

fn lerp(&self, other: &Self, progress: f32) -> Self

Interpolates from self to other using normalized progress.

Source

fn interpolate(from: &Self, to: &Self, progress: f32) -> Self

Interpolates from from to to using normalized progress.

Source

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.
Source§

impl Interpolate for Color

Available on crate feature rgba only.
Source§

impl Interpolate for Padding

Source§

impl Interpolate for Radius

Source§

impl Interpolate for Shadow

Available on crate features oklaba or rgba only.
Source§

impl Interpolate for f32

Source§

impl Interpolate for f64

Source§

impl Interpolate for i8

Source§

fn interpolate_progress( from: &i8, to: &i8, progress: InterpolationProgress, ) -> i8

Source§

impl Interpolate for i16

Source§

impl Interpolate for i32

Source§

impl Interpolate for u8

Source§

fn interpolate_progress( from: &u8, to: &u8, progress: InterpolationProgress, ) -> u8

Source§

impl Interpolate for u16

Source§

impl Interpolate for u32

Source§

impl<A, B, C, D> Interpolate for (A, B, C, D)

Source§

impl<A, B, C> Interpolate for (A, B, C)

Source§

impl<A, B> Interpolate for (A, B)

Source§

impl<T, const N: usize> Interpolate for [T; N]
where T: Interpolate + Clone,

Source§

impl<T> Interpolate for Point<T>
where T: Interpolate + Clone,

Source§

fn interpolate_progress( from: &Point<T>, to: &Point<T>, progress: InterpolationProgress, ) -> Point<T>

Source§

impl<T> Interpolate for Rectangle<T>
where T: Interpolate + Clone,

Source§

impl<T> Interpolate for Size<T>
where T: Interpolate + Clone,

Source§

fn interpolate_progress( from: &Size<T>, to: &Size<T>, progress: InterpolationProgress, ) -> Size<T>

Source§

impl<T> Interpolate for Vector<T>
where T: Interpolate + Clone,

Source§

fn interpolate_progress( from: &Vector<T>, to: &Vector<T>, progress: InterpolationProgress, ) -> Vector<T>

Implementors§