#[repr(transparent)]pub struct Random { /* private fields */ }
Expand description
GLib type: Boxed type with copy-on-clone semantics.
Implementations§
source§impl Random
impl Random
sourcepub fn as_ptr(&self) -> *mut GeglRandom
pub fn as_ptr(&self) -> *mut GeglRandom
Return the inner pointer to the underlying C value.
sourcepub unsafe fn from_glib_ptr_borrow(ptr: &*mut GeglRandom) -> &Self
pub unsafe fn from_glib_ptr_borrow(ptr: &*mut GeglRandom) -> &Self
Borrows the underlying C value.
sourcepub unsafe fn from_glib_ptr_borrow_mut(ptr: &mut *mut GeglRandom) -> &mut Self
pub unsafe fn from_glib_ptr_borrow_mut(ptr: &mut *mut GeglRandom) -> &mut Self
Borrows the underlying C value mutably.
source§impl Random
impl Random
sourcepub fn new() -> Random
pub fn new() -> Random
Creates a new random number generator initialized with a random seed.
This structure needs to be freed by the user with gegl_random_free()
;
sourcepub fn with_seed(seed: u32) -> Random
pub fn with_seed(seed: u32) -> Random
Return an opaque structure associated to the seed.
This structure needs to be freed by the user with gegl_random_free()
;
seed
an integer seed, change for different permutation.
sourcepub fn float_range(
&self,
x: i32,
y: i32,
z: i32,
n: i32,
min: f32,
max: f32
) -> f32
pub fn float_range( &self, x: i32, y: i32, z: i32, n: i32, min: f32, max: f32 ) -> f32
Return a random floating point number in the range specified, for the given x,y coordinates and GeglRandom provided, if multiple different numbers are needed pass in incrementing n’s.
x
x coordinate
y
y coordinate
z
z coordinate (mipmap level)
n
number no (each x,y coordinate provides its own sequence of numbers
min
minimum value
max
maximum value
sourcepub fn int_range(
&self,
x: i32,
y: i32,
z: i32,
n: i32,
min: i32,
max: i32
) -> i32
pub fn int_range( &self, x: i32, y: i32, z: i32, n: i32, min: i32, max: i32 ) -> i32
Return a random integer point number in the range specified, for the given x,y coordinates and GeglRandom provided, if multiple different numbers are needed pass in incrementing n’s.
x
x coordinate
y
y coordinate
z
z coordinate (mipmap level)
n
number no (each x,y coordinate provides its own sequence of numbers
min
minimum value
max
maximum value+1
Trait Implementations§
source§impl Ord for Random
impl Ord for Random
source§impl PartialEq<Random> for Random
impl PartialEq<Random> for Random
source§impl PartialOrd<Random> for Random
impl PartialOrd<Random> for Random
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl StaticType for Random
impl StaticType for Random
source§fn static_type() -> Type
fn static_type() -> Type
Self
.