[][src]Struct spherical_blue_noise::BlueNoiseSphere

pub struct BlueNoiseSphere { /* fields omitted */ }

Points on sphere that forms blue noise.

The only way to get points is through iterator, created by calling into_iterator method:

BlueNoiseSphere::new(16, &mut rand::thread_rng()).into_iter()

Implementations

impl BlueNoiseSphere[src]

pub fn new<R: Rng + ?Sized>(num_of_points: u32, rng: &mut R) -> Self[src]

Creates new spherical blue noise from num_of_points with default parameters.

pub fn new_with_params<R: Rng + ?Sized>(
    rng: &mut R,
    num_of_points: u32,
    num_of_iterations: u16,
    maximum_angular_displacement_threshold: f32,
    angular_displacement_threshold_decay: f32
) -> Self
[src]

Creates new spherical blue noise with passed parameters.

  • num_of_points - The number of points that should lie on the sphere.

  • num_of_iterations - The number of iterations the algorithm makes before returning blue noise. More is slower and better.

  • maximum_angular_displacement_threshold - The "starting speed" of points to converge into blue noise.

  • angular_displacement_threshold_decay - The ratio that governs the decay of the starting speed. If the ratio is bigger, then the algorithm needs fewer iterations to converge, at the cost of more randomness in produced pattern. With bigger ratio, point may "vibrate" rather than converge into blue noise.

pub fn new_raw<R: Rng + ?Sized>(num_of_points: u32, rng: &mut R) -> Self[src]

Returns new BlueNoiseSphere with random points on the sphere, without passed any iteration of the algorithm, should then be called method advance or advance_multiple.

pub fn advance_multiple(
    self,
    num_of_iterations: u16,
    maximum_angular_displacement_threshold: f32,
    angular_displacement_threshold_decay: f32
) -> Self
[src]

Calls num_of_iterations times the advance method on BlueNoiseSphere. Each time the maximum_angular_displacement_threshold is reduced by angular_displacement_threshold_decay.

pub fn advance(&self, maximum_angular_displacement_threshold: f32) -> Self[src]

Makes random points on sphere into blue noise. Takes maximum_angular_displacement_threshold as displacement (in radians) of each point toward direction, in which the point is pushed away by other particles. Returns new BlueNoiseSphere struct.

Trait Implementations

impl Clone for BlueNoiseSphere[src]

impl IntoIterator for BlueNoiseSphere[src]

type Item = (f32, f32, f32)

The type of the elements being iterated over.

type IntoIter = BlueNoiseSphereIterator

Which kind of iterator are we turning this into?

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,