pub struct InterleavedGradientNoise { /* private fields */ }Expand description
Interleaved Gradient Noise for 2D dithering.
Fast algorithm from Jorge Jimenez’s presentation at SIGGRAPH 2014. Widely used in real-time graphics for its speed and quality balance. Creates smooth gradient-like patterns with good visual properties.
Implementations§
Trait Implementations§
Source§impl Clone for InterleavedGradientNoise
impl Clone for InterleavedGradientNoise
Source§fn clone(&self) -> InterleavedGradientNoise
fn clone(&self) -> InterleavedGradientNoise
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 InterleavedGradientNoise
impl Debug for InterleavedGradientNoise
Source§impl Hash for InterleavedGradientNoise
impl Hash for InterleavedGradientNoise
Source§impl PartialEq for InterleavedGradientNoise
impl PartialEq for InterleavedGradientNoise
Source§impl SpatialRng for InterleavedGradientNoise
impl SpatialRng for InterleavedGradientNoise
Source§fn compute(&self, x: u32, y: u32) -> f32
fn compute(&self, x: u32, y: u32) -> f32
Compute a deterministic value for given 2D coordinates.
Returns a value in range [-1, 1].
Source§fn dither_2d<T>(
&self,
value: T,
min: T,
one: T,
dither_amplitude: T,
x: u32,
y: u32,
) -> Twhere
T: DitherFloat,
Self: Sized,
fn dither_2d<T>(
&self,
value: T,
min: T,
one: T,
dither_amplitude: T,
x: u32,
y: u32,
) -> Twhere
T: DitherFloat,
Self: Sized,
Dither a single value using 2D coordinates.
Source§fn simple_dither_2d<T>(&self, value: T, one: T, x: u32, y: u32) -> T
fn simple_dither_2d<T>(&self, value: T, one: T, x: u32, y: u32) -> T
Simple dither for a single value using 2D coordinates.
Source§fn dither_slice_2d<T>(
&self,
values: &mut [T],
width: usize,
min: T,
one: T,
dither_amplitude: T,
)
fn dither_slice_2d<T>( &self, values: &mut [T], width: usize, min: T, one: T, dither_amplitude: T, )
Dither a 2D image stored as a flat slice (parallel version).
Source§fn simple_dither_slice_2d<T>(&self, values: &mut [T], width: usize, one: T)
fn simple_dither_slice_2d<T>(&self, values: &mut [T], width: usize, one: T)
Simple dither for a 2D image stored as a flat slice (parallel version).
Source§fn dither_float_2d<Src, Dest>(&self, value: Src, x: u32, y: u32) -> Dest
fn dither_float_2d<Src, Dest>(&self, value: Src, x: u32, y: u32) -> Dest
Dither a float value when converting to lower precision using 2D
coordinates.
Source§fn dither_float_slice_2d<Src, Dest>(
&self,
values: &[Src],
width: usize,
) -> Vec<Dest>where
Src: DitherFloatConversion<Dest> + DitherFloat + CastableFrom<f64> + Copy + Send + Sync,
Dest: Send,
Self: Sized,
fn dither_float_slice_2d<Src, Dest>(
&self,
values: &[Src],
width: usize,
) -> Vec<Dest>where
Src: DitherFloatConversion<Dest> + DitherFloat + CastableFrom<f64> + Copy + Send + Sync,
Dest: Send,
Self: Sized,
Dither float values in a 2D image slice when converting to lower
precision (parallel version).
impl Copy for InterleavedGradientNoise
impl Eq for InterleavedGradientNoise
impl StructuralPartialEq for InterleavedGradientNoise
Auto Trait Implementations§
impl Freeze for InterleavedGradientNoise
impl RefUnwindSafe for InterleavedGradientNoise
impl Send for InterleavedGradientNoise
impl Sync for InterleavedGradientNoise
impl Unpin for InterleavedGradientNoise
impl UnwindSafe for InterleavedGradientNoise
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
Source§impl<T, U> CastableInto<U> for Twhere
U: CastableFrom<T>,
impl<T, U> CastableInto<U> for Twhere
U: CastableFrom<T>,
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DowncastableFrom<T> for T
impl<T> DowncastableFrom<T> for T
Source§fn downcast_from(value: T) -> T
fn downcast_from(value: T) -> T
Truncate the current UnsignedInt to a possibly smaller size
Source§impl<T, U> DowncastableInto<U> for Twhere
U: DowncastableFrom<T>,
impl<T, U> DowncastableInto<U> for Twhere
U: DowncastableFrom<T>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> UpcastableFrom<T> for T
impl<T> UpcastableFrom<T> for T
Source§fn upcast_from(value: T) -> T
fn upcast_from(value: T) -> T
Extend the current UnsignedInt to a possibly bigger size.