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>
impl<F> Linear<F>
Sourcepub fn new(left: F, right: F) -> Linear<F>
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>
impl<F> Interpolator for Linear<F>
Source§fn interpolate(&self, x: f64) -> Self::Frame
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§fn next_source_frame(&mut self, source_frame: Self::Frame)
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more