dasp_interpolate

Trait Interpolator

Source
pub trait Interpolator {
    type Frame: Frame;

    // Required methods
    fn interpolate(&self, x: f64) -> Self::Frame;
    fn next_source_frame(&mut self, source_frame: Self::Frame);
}
Expand description

Types that can interpolate between two values.

Implementations should keep track of the necessary data both before and after the current frame.

Required Associated Types§

Source

type Frame: Frame

The type of frame over which the interpolate may operate.

Required Methods§

Source

fn interpolate(&self, x: f64) -> Self::Frame

Given a distance between [0.0 and 1.0) toward the following sample, return the interpolated value.

Source

fn next_source_frame(&mut self, source_frame: Self::Frame)

To be called whenever the Interpolator value steps passed 1.0.

Implementors§

Source§

impl<F> Interpolator for Linear<F>
where F: Frame, F::Sample: Duplex<f64>,

Source§

type Frame = F