Struct nannou::noise::Turbulence
source · pub struct Turbulence<Source> {
pub source: Source,
pub frequency: f64,
pub power: f64,
pub roughness: usize,
/* private fields */
}
Expand description
Noise function that randomly displaces the input value before returning the output value from the source function.
_ is the pseudo-random displacement of the input value. The get() method randomly displaces the coordinates of the input value before retrieving the output value from the source function. To control the turbulence, an application can modify its frequency, its power, and its roughness.
Fields§
§source: Source
Source function that outputs a value.
frequency: f64
Frequency value for the Turbulence function.
power: f64
Controls the strength of the turbulence by affecting how much each point is moved.
roughness: usize
Affects the roughness of the turbulence. Higher values are rougher.
Implementations§
source§impl<Source> Turbulence<Source>
impl<Source> Turbulence<Source>
pub const DEFAULT_SEED: u32 = 0u32
pub const DEFAULT_FREQUENCY: f64 = 1f64
pub const DEFAULT_POWER: f64 = 1f64
pub const DEFAULT_ROUGHNESS: usize = 3usize
pub fn new(source: Source) -> Turbulence<Source>
pub fn set_frequency(self, frequency: f64) -> Turbulence<Source>
pub fn set_power(self, power: f64) -> Turbulence<Source>
pub fn set_roughness(self, roughness: usize) -> Turbulence<Source>
Trait Implementations§
source§impl<Source> Clone for Turbulence<Source>where
Source: Clone,
impl<Source> Clone for Turbulence<Source>where
Source: Clone,
source§fn clone(&self) -> Turbulence<Source>
fn clone(&self) -> Turbulence<Source>
Returns a copy 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<Source> Debug for Turbulence<Source>where
Source: Debug,
impl<Source> Debug for Turbulence<Source>where
Source: Debug,
Auto Trait Implementations§
impl<Source> RefUnwindSafe for Turbulence<Source>where
Source: RefUnwindSafe,
impl<Source> Send for Turbulence<Source>where
Source: Send,
impl<Source> Sync for Turbulence<Source>where
Source: Sync,
impl<Source> Unpin for Turbulence<Source>where
Source: Unpin,
impl<Source> UnwindSafe for Turbulence<Source>where
Source: UnwindSafe,
Blanket Implementations§
source§impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S
source§fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<Swp, Dwp, T>,
fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<Swp, Dwp, T>,
Convert the source color to the destination color using the specified
method
source§fn adapt_into(self) -> D
fn adapt_into(self) -> D
Convert the source color to the destination color using the bradford
method by default
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
source§impl<T, U> ConvertInto<U> for Twhere
U: ConvertFrom<T>,
impl<T, U> ConvertInto<U> for Twhere
U: ConvertFrom<T>,
source§fn convert_into(self) -> U
fn convert_into(self) -> U
Convert into T with values clamped to the color defined bounds Read more
source§fn convert_unclamped_into(self) -> U
fn convert_unclamped_into(self) -> U
Convert into T. The resulting color might be invalid in its color space Read more
source§fn try_convert_into(self) -> Result<U, OutOfBounds<U>>
fn try_convert_into(self) -> Result<U, OutOfBounds<U>>
Convert into T, returning ok if the color is inside of its defined range,
otherwise an
OutOfBounds
error is returned which contains the unclamped color. Read more