[−][src]Trait dasp::interpolate::Interpolator
Types that can interpolate between two values.
Implementations should keep track of the necessary data both before and after the current frame.
Associated Types
Loading content...Required methods
fn interpolate(&self, x: f64) -> Self::Frame
Given a distance between [0.0 and 1.0) toward the following sample, return the interpolated value.
fn next_source_frame(&mut self, source_frame: Self::Frame)
To be called whenever the Interpolator value steps passed 1.0.
Implementors
impl<F> Interpolator for Floor<F> where
F: Frame,
<F as Frame>::Sample: Duplex<f64>,
[src]
F: Frame,
<F as Frame>::Sample: Duplex<f64>,
type Frame = F
fn interpolate(&self, _x: f64) -> <Floor<F> as Interpolator>::Frame
[src]
fn next_source_frame(&mut self, source_frame: <Floor<F> as Interpolator>::Frame)
[src]
impl<F> Interpolator for Linear<F> where
F: Frame,
<F as Frame>::Sample: Duplex<f64>,
[src]
F: Frame,
<F as Frame>::Sample: Duplex<f64>,
type Frame = F
fn interpolate(&self, x: f64) -> <Linear<F> as Interpolator>::Frame
[src]
Converts linearly from the previous value, using the next value to interpolate. It is possible, although not advisable, to provide an x > 1.0 or < 0.0, but this will just continue to be a linear ramp in one direction or another.
fn next_source_frame(
&mut self,
source_frame: <Linear<F> as Interpolator>::Frame
)
[src]
&mut self,
source_frame: <Linear<F> as Interpolator>::Frame
)
impl<S> Interpolator for Sinc<S> where
S: SliceMut,
<S as Slice>::Element: Frame,
<<S as Slice>::Element as Frame>::Sample: Duplex<f64>,
[src]
S: SliceMut,
<S as Slice>::Element: Frame,
<<S as Slice>::Element as Frame>::Sample: Duplex<f64>,
type Frame = <S as Slice>::Element
fn interpolate(&self, x: f64) -> <Sinc<S> as Interpolator>::Frame
[src]
Sinc interpolation