Struct nannou::noise::Cache [−][src]
pub struct Cache<Source> { pub source: Source, // some fields omitted }
Expand description
Noise function that caches the last output value generated by the source function.
If the input coordinates passed to Cache::get
are equal to the previous
call, the function returns the cached result of the previous call to
Source::get
. Otherwise, Source::get
is called with the new coordinates,
overwriting the cache with the result, and returning the result to the
caller.
Caching a noise function is useful if it is used as a source function for multiple noise functions. If a source function is not cached, the source function will redundantly calculate the same output value once for each noise function in which it is included.
Fields
source: Source
Outputs the value to be cached.
Implementations
Trait Implementations
Auto Trait Implementations
impl<Source> !RefUnwindSafe for Cache<Source>
impl<Source> UnwindSafe for Cache<Source> where
Source: UnwindSafe,
Blanket Implementations
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
T: Component + Float,
D: AdaptFrom<S, Swp, Dwp, T>,
Swp: WhitePoint,
Dwp: WhitePoint,
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
T: Component + Float,
D: AdaptFrom<S, Swp, Dwp, T>,
Swp: WhitePoint,
Dwp: WhitePoint,
Mutably borrows from an owned value. Read more
Convert into T with values clamped to the color defined bounds Read more
Convert into T. The resulting color might be invalid in its color space Read more
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
pub fn vzip(self) -> V