Struct sample::interpolate::Linear
[−]
[src]
pub struct Linear<F> { /* fields omitted */ }
Interpolator that interpolates linearly between the previous value and the next value
Methods
impl<F> Linear<F>
[src]
fn new(left: F, right: F) -> Linear<F>
[src]
Create a new Linear Interpolator.
fn from_source<S>(source: &mut S) -> Linear<F> where
F: Frame,
S: Signal<Frame = F>,
[src]
F: Frame,
S: Signal<Frame = F>,
Consumes the first value from a given source to initialize itself. If the source has no values, this will return None.
Trait Implementations
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) -> Self::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: Self::Frame)
[src]
Called whenever the Interpolator value steps passed 1.0.