pub struct GoldenRatio { /* private fields */ }Expand description
Golden ratio sequence for 1D low-discrepancy sampling.
Classic low-discrepancy sequence using the golden ratio (1.618…). Optimal for 1D coverage with the most uniform distribution possible. Excellent for gradient-like data or smooth transitions.
Implementations§
Trait Implementations§
Source§impl Clone for GoldenRatio
impl Clone for GoldenRatio
Source§fn clone(&self) -> GoldenRatio
fn clone(&self) -> GoldenRatio
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 GoldenRatio
impl Debug for GoldenRatio
Source§impl Hash for GoldenRatio
impl Hash for GoldenRatio
Source§impl LinearRng for GoldenRatio
impl LinearRng for GoldenRatio
Source§fn compute(&self, index: u32) -> f32
fn compute(&self, index: u32) -> f32
Compute dither offset for a given index.
Returns a value in range [-1, 1] to be scaled by amplitude.
Source§fn dither<T>(
&self,
value: T,
min: T,
one: T,
dither_amplitude: T,
index: u32,
) -> Twhere
T: DitherFloat,
Self: Sized,
fn dither<T>(
&self,
value: T,
min: T,
one: T,
dither_amplitude: T,
index: u32,
) -> Twhere
T: DitherFloat,
Self: Sized,
Dither a single value.
Source§fn simple_dither<T>(&self, value: T, one: T, index: u32) -> T
fn simple_dither<T>(&self, value: T, one: T, index: u32) -> T
Simple dither for a single value.
Source§fn dither_slice<T>(&self, values: &mut [T], min: T, one: T, dither_amplitude: T)
fn dither_slice<T>(&self, values: &mut [T], min: T, one: T, dither_amplitude: T)
Dither values in a slice (parallel version).
Source§fn simple_dither_slice<T>(&self, values: &mut [T], one: T)
fn simple_dither_slice<T>(&self, values: &mut [T], one: T)
Simple dither for values in a slice (parallel version).
Source§fn dither_iter<T, I>(
&self,
values: I,
min: T,
one: T,
dither_amplitude: T,
) -> Vec<T>
fn dither_iter<T, I>( &self, values: I, min: T, one: T, dither_amplitude: T, ) -> Vec<T>
Dither values from an iterator (parallel version).
Source§fn simple_dither_iter<T, I>(&self, values: I, one: T) -> Vec<T>where
T: DitherFloat + Number + CastableFrom<f32> + Send + Sync,
I: IntoIterator<Item = T>,
I::IntoIter: Send,
Self: Sized,
fn simple_dither_iter<T, I>(&self, values: I, one: T) -> Vec<T>where
T: DitherFloat + Number + CastableFrom<f32> + Send + Sync,
I: IntoIterator<Item = T>,
I::IntoIter: Send,
Self: Sized,
Simple dither for values from an iterator (parallel version).
Source§fn dither_float<Src, Dest>(&self, value: Src, index: u32) -> Dest
fn dither_float<Src, Dest>(&self, value: Src, index: u32) -> Dest
Dither a float value when converting to lower precision.
Source§fn dither_float_slice<Src, Dest>(&self, values: &[Src]) -> Vec<Dest>where
Src: DitherFloatConversion<Dest> + DitherFloat + CastableFrom<f64> + Copy + Send + Sync,
Dest: Send,
Self: Sized,
fn dither_float_slice<Src, Dest>(&self, values: &[Src]) -> Vec<Dest>where
Src: DitherFloatConversion<Dest> + DitherFloat + CastableFrom<f64> + Copy + Send + Sync,
Dest: Send,
Self: Sized,
Dither float values in a slice when converting to lower precision
(parallel version).
Source§fn dither_float_iter<Src, Dest, I>(&self, values: I) -> Vec<Dest>where
Src: DitherFloatConversion<Dest> + DitherFloat + CastableFrom<f64> + Send + Sync,
Dest: Send,
I: IntoIterator<Item = Src>,
I::IntoIter: Send,
Self: Sized,
fn dither_float_iter<Src, Dest, I>(&self, values: I) -> Vec<Dest>where
Src: DitherFloatConversion<Dest> + DitherFloat + CastableFrom<f64> + Send + Sync,
Dest: Send,
I: IntoIterator<Item = Src>,
I::IntoIter: Send,
Self: Sized,
Dither float values from an iterator when converting to lower precision
(parallel version).
Source§impl PartialEq for GoldenRatio
impl PartialEq for GoldenRatio
impl Copy for GoldenRatio
impl Eq for GoldenRatio
impl StructuralPartialEq for GoldenRatio
Auto Trait Implementations§
impl Freeze for GoldenRatio
impl RefUnwindSafe for GoldenRatio
impl Send for GoldenRatio
impl Sync for GoldenRatio
impl Unpin for GoldenRatio
impl UnwindSafe for GoldenRatio
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.