pub struct Clamp<T, Source, const DIM: usize>where
Source: NoiseFn<T, DIM>,{
pub source: Source,
pub bounds: (f64, f64),
/* private fields */
}
Expand description
Noise function that clamps the output value from the source function to a range of values.
Fields§
§source: Source
Outputs a value.
bounds: (f64, f64)
Bound of the clamping range. Default is -1.0 to 1.0.
Implementations§
source§impl<T, Source, const DIM: usize> Clamp<T, Source, DIM>where
Source: NoiseFn<T, DIM>,
impl<T, Source, const DIM: usize> Clamp<T, Source, DIM>where
Source: NoiseFn<T, DIM>,
pub fn new(source: Source) -> Self
pub fn set_lower_bound(self, lower_bound: f64) -> Self
pub fn set_upper_bound(self, upper_bound: f64) -> Self
pub fn set_bounds(self, lower_bound: f64, upper_bound: f64) -> Self
Trait Implementations§
Auto Trait Implementations§
impl<T, Source, const DIM: usize> Freeze for Clamp<T, Source, DIM>where
Source: Freeze,
impl<T, Source, const DIM: usize> RefUnwindSafe for Clamp<T, Source, DIM>where
Source: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, Source, const DIM: usize> Send for Clamp<T, Source, DIM>
impl<T, Source, const DIM: usize> Sync for Clamp<T, Source, DIM>
impl<T, Source, const DIM: usize> Unpin for Clamp<T, Source, DIM>
impl<T, Source, const DIM: usize> UnwindSafe for Clamp<T, Source, DIM>where
Source: UnwindSafe,
T: 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