dasp_interpolate::linear

Struct Linear

Source
pub struct Linear<F> { /* private fields */ }
Expand description

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

§Required Features

  • When using dasp_interpolate, this item requires the linear feature to be enabled.
  • When using dasp, this item requires the interpolate-linear feature to be enabled.

Implementations§

Source§

impl<F> Linear<F>

Source

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

Create a new Linear Interpolator, where left and right are the first two frames to be interpolated.

§Required Features
  • When using dasp_interpolate, this item requires the linear feature to be enabled.
  • When using dasp, this item requires the interpolate-linear feature to be enabled.

Trait Implementations§

Source§

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

Source§

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

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.

Source§

type Frame = F

The type of frame over which the interpolate may operate.
Source§

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

To be called whenever the Interpolator value steps passed 1.0.

Auto Trait Implementations§

§

impl<F> Freeze for Linear<F>
where F: Freeze,

§

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§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<S> FromSample<S> for S

Source§

fn from_sample_(s: S) -> S

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> ToSample<U> for T
where U: FromSample<T>,

Source§

fn to_sample_(self) -> U

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

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