[][src]Struct sample::interpolate::Linear

pub struct Linear<F> { /* fields omitted */ }

Interpolator that interpolates linearly between the previous value and the next value

Implementations

impl<F> Linear<F>[src]

pub fn new(left: F, right: F) -> Linear<F>[src]

Create a new Linear Interpolator.

pub fn from_source<S>(source: &mut S) -> Linear<F> where
    F: Frame,
    S: Signal<Frame = F>, 
[src]

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::Sample: Duplex<f64>, 
[src]

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.

Auto Trait Implementations

impl<F> RefUnwindSafe for Linear<F> where
    F: RefUnwindSafe

impl<F> Send for Linear<F> where
    F: Send

impl<F> Sync for Linear<F> where
    F: Sync

impl<F> Unpin for Linear<F> where
    F: Unpin

impl<F> UnwindSafe for Linear<F> where
    F: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<S, T> Duplex<S> for T where
    T: FromSample<S> + ToSample<S>, 
[src]

impl<T> From<T> for T[src]

impl<S> FromSample<S> for S[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> ToSample<U> for T where
    U: FromSample<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.