[][src]Struct bluenoise::WrappingBlueNoise

pub struct WrappingBlueNoise<R: Rng>(_);

Provides a source of WrappingBlueNoise in a given area at some density, where the distance between two points wraps around the edges of the box. This can be used to generate tiling blue noise.

Implementations

impl<R: Rng + SeedableRng> WrappingBlueNoise<R>[src]

#[must_use = "This is quite expensive to initialise. You can iterate over it to consume it."]pub fn new(width: f32, height: f32, min_radius: f32) -> Self[src]

Creates a new instance of WrappingBlueNoise.

  • width: The width of the box to generate inside.
  • height: The height of the box to generate inside.
  • min_radius: The minimum distance between points.

#[must_use = "This is quite expensive to initialise. You can iterate over it to consume it."]pub fn from_seed(width: f32, height: f32, min_radius: f32, seed: u64) -> Self[src]

Creates a new instance of WrappingBlueNoise.

  • width: The width of the box to generate inside.
  • height: The height of the box to generate inside.
  • min_radius: The minimum distance between points.
  • seed: Value to seed the rng with

pub fn with_seed(&mut self, seed: u64) -> &mut Self[src]

A builder function to seed the rng with a specific value.

For an example, see the WrappingBlueNoise examples.

impl<R: Rng> WrappingBlueNoise<R>[src]

#[must_use = "This is quite expensive to initialise. You can iterate over it to consume it."]pub fn from_rng(width: f32, height: f32, min_radius: f32, rng: R) -> Self[src]

Creates a new instance of WrappingBlueNoise.

  • width: The width of the box to generate inside.
  • height: The height of the box to generate inside.
  • min_radius: The minimum distance between points.
  • rng: Rng to use

pub fn with_samples(&mut self, max_samples: u32) -> &mut Self[src]

A builder function to set the maximum number of samples to be when attempting to find new points.

For an example, see the WrappingBlueNoise examples.

pub fn with_min_radius(&mut self, min_radius: f32) -> &mut Self[src]

A builder function to set the minimum radius between points.

For an example, see the WrappingBlueNoise examples.

pub fn reset(&mut self) -> &mut Self[src]

Resets the generator to begin creating noise from the beginning. This will not reset the prng so if you want deterministic ordering, make sure to set it explicitly.

use bluenoise::WrappingBlueNoise;
use rand_pcg::Pcg64Mcg;

let mut noise = WrappingBlueNoise::<Pcg64Mcg>::new(10.0, 10.0, 1.0);
let first_10 = noise.with_seed(25).take(10).collect::<Vec<_>>();

// make sure to re-initialise your seed!
noise.reset().with_seed(25);
let reset_10 = noise.take(10).collect::<Vec<_>>();

assert_eq!(first_10, reset_10);

Trait Implementations

impl<R: Clone + Rng> Clone for WrappingBlueNoise<R>[src]

impl<R: Debug + Rng> Debug for WrappingBlueNoise<R>[src]

impl<R: Rng> Iterator for WrappingBlueNoise<R>[src]

type Item = Vec2

The type of the elements being iterated over.

Auto Trait Implementations

impl<R> RefUnwindSafe for WrappingBlueNoise<R> where
    R: RefUnwindSafe
[src]

impl<R> Send for WrappingBlueNoise<R> where
    R: Send
[src]

impl<R> Sync for WrappingBlueNoise<R> where
    R: Sync
[src]

impl<R> Unpin for WrappingBlueNoise<R> where
    R: Unpin
[src]

impl<R> UnwindSafe for WrappingBlueNoise<R> where
    R: UnwindSafe
[src]

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<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

impl<I> IteratorRandom for I where
    I: Iterator
[src]

impl<T> Itertools for T where
    T: Iterator + ?Sized
[src]

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>,