[][src]Struct nannou::noise::Curve

pub struct Curve<'a, T> where
    'a: 'a,
    T: 'a + 'a, 
{ pub source: &'a (dyn NoiseFn<T> + 'a), // some fields omitted }

Noise function that maps the output value from the source function onto an arbitrary function curve.

This noise function maps the output value from the source function onto an application-defined curve. The curve is defined by a number of control points; each control point has an input value that maps to an output value.

To add control points to the curve, use the add_control_point method.

Since the curve is a cubic spline, an application must have a minimum of four control points to the curve. If there is less than four control points, the get() method panics. Each control point can have any input and output value, although no two control points can have the same input.

Fields

source: &'a (dyn NoiseFn<T> + 'a)

Outputs a value.

Methods

impl<'a, T> Curve<'a, T>[src]

pub fn new(source: &'a (dyn NoiseFn<T> + 'a)) -> Curve<'a, T>[src]

pub fn add_control_point(
    self,
    input_value: f64,
    output_value: f64
) -> Curve<'a, T>
[src]

Trait Implementations

impl<'a, T> NoiseFn<T> for Curve<'a, T>[src]

Auto Trait Implementations

impl<'a, T> !Send for Curve<'a, T>

impl<'a, T> !Sync for Curve<'a, T>

Blanket Implementations

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

impl<T, U> Into<U> for T where
    U: From<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.

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

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

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

impl<T> Content for T[src]

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

impl<T> Erased for T

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

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

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

impl<T> SetParameter for T

fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
    T: Parameter<Self>, 

Sets value as a parameter of self.

impl<T> SetParameter for T

fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
    T: Parameter<Self>, 

Sets value as a parameter of self.