pub enum Interpolation {
Step = 0,
Linear = 1,
Smooth = 2,
Ramp = 3,
}
Expand description
The Interpolation
Type.
This represents the various forms of interpolation that can be performed.
Variants§
Implementations§
Source§impl Interpolation
impl Interpolation
Sourcepub fn interpolate(&self, t: f32) -> f32
pub fn interpolate(&self, t: f32) -> f32
This performs the interpolation.
§Examples
assert_eq!(Interpolation::Linear.interpolate(0.5), 0.5);
assert_eq!(Interpolation::Step.interpolate(0.5), 0.);
Trait Implementations§
Source§impl<'__de, __Context> BorrowDecode<'__de, __Context> for Interpolation
impl<'__de, __Context> BorrowDecode<'__de, __Context> for Interpolation
Source§fn borrow_decode<__D: BorrowDecoder<'__de, Context = __Context>>(
decoder: &mut __D,
) -> Result<Self, DecodeError>
fn borrow_decode<__D: BorrowDecoder<'__de, Context = __Context>>( decoder: &mut __D, ) -> Result<Self, DecodeError>
Attempt to decode this type with the given BorrowDecode.
Source§impl Clone for Interpolation
impl Clone for Interpolation
Source§fn clone(&self) -> Interpolation
fn clone(&self) -> Interpolation
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for Interpolation
impl Debug for Interpolation
Source§impl<__Context> Decode<__Context> for Interpolation
impl<__Context> Decode<__Context> for Interpolation
Source§impl<'de> Deserialize<'de> for Interpolation
impl<'de> Deserialize<'de> for Interpolation
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Encode for Interpolation
impl Encode for Interpolation
Source§impl From<u8> for Interpolation
impl From<u8> for Interpolation
Source§fn from(raw: u8) -> Interpolation
fn from(raw: u8) -> Interpolation
Converts to this type from the input type.
Source§impl Serialize for Interpolation
impl Serialize for Interpolation
impl Copy for Interpolation
Auto Trait Implementations§
impl Freeze for Interpolation
impl RefUnwindSafe for Interpolation
impl Send for Interpolation
impl Sync for Interpolation
impl Unpin for Interpolation
impl UnwindSafe for Interpolation
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