Gegl.Random

Fields

None

Methods

class

new ()

class

new_with_seed (seed)

duplicate ()

float (x, y, z, n)

float_range (x, y, z, n, min, max)

free ()

int (x, y, z, n)

int_range (x, y, z, n, min, max)

set_seed (seed)

Details

class Gegl.Random
classmethod new()
Return type:

Gegl.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();

classmethod new_with_seed(seed)
Parameters:

seed (int) – an integer seed, change for different permutation.

Return type:

Gegl.Random

Return an opaque structure associated to the seed. This structure needs to be freed by the user with Gegl.Random.free();

duplicate()
Return type:

Gegl.Random

Return a new copy of an existing Gegl.Random

float(x, y, z, n)
Parameters:
  • x (int) – x coordinate

  • y (int) – y coordinate

  • z (int) – z coordinate (mipmap level)

  • n (int) – number no (each x,y coordinate provides its own sequence of numbers

Return type:

float

Return a random floating point number in range 0.0 .. 1.0.

float_range(x, y, z, n, min, max)
Parameters:
  • x (int) – x coordinate

  • y (int) – y coordinate

  • z (int) – z coordinate (mipmap level)

  • n (int) – number no (each x,y coordinate provides its own sequence of numbers

  • min (float) – minimum value

  • max (float) – maximum value

Return type:

float

Return a random floating point number in the range specified, for the given x,y coordinates and Gegl.Random provided, if multiple different numbers are needed pass in incrementing n’s.

free()

Free a Gegl.Random structure created with Gegl.Random.new() or Gegl.Random.new_with_seed()

int(x, y, z, n)
Parameters:
  • x (int) – x coordinate

  • y (int) – y coordinate

  • z (int) – z coordinate (mipmap level)

  • n (int) – number no (each x,y coordinate provides its own sequence of numbers

Return type:

int

Return a random integer number in range 0 .. MAX_UINT

int_range(x, y, z, n, min, max)
Parameters:
  • x (int) – x coordinate

  • y (int) – y coordinate

  • z (int) – z coordinate (mipmap level)

  • n (int) – number no (each x,y coordinate provides its own sequence of numbers

  • min (int) – minimum value

  • max (int) – maximum value+1

Return type:

int

Return a random integer point number in the range specified, for the given x,y coordinates and Gegl.Random provided, if multiple different numbers are needed pass in incrementing n’s.

set_seed(seed)
Parameters:

seed (int) – an integer seed, change for different permutation.

Change the seed of an existing Gegl.Random.