Trait sample::interpolate::Interpolator [−][src]
pub trait Interpolator { type Frame: Frame; fn interpolate(&self, x: f64) -> Self::Frame; fn next_source_frame(&mut self, source_frame: Self::Frame); }
Types that can interpolate between two values.
Implementations should keep track of the necessary data both before and after the current frame.
Associated Types
Required Methods
fn interpolate(&self, x: f64) -> Self::Frame
Given a distance between [0.0 and 1.0) to the following sample, return the interpolated value.
fn next_source_frame(&mut self, source_frame: Self::Frame)
Called whenever the Interpolator value steps passed 1.0.
Implementors
impl<F> Interpolator for Floor<F> where
F: Frame,
F::Sample: Duplex<f64>, type Frame = F;impl<F> Interpolator for Linear<F> where
F: Frame,
F::Sample: Duplex<f64>, type Frame = F;impl<S> Interpolator for Sinc<S> where
S: SliceMut,
S::Element: Frame,
<S::Element as Frame>::Sample: Duplex<f64>, type Frame = S::Element;