org.jscience.media.pictures.filters.math
Class Noise

java.lang.Object
  extended by org.jscience.media.pictures.filters.math.Noise
All Implemented Interfaces:
Function1D, Function2D, Function3D

public class Noise
extends java.lang.Object
implements Function1D, Function2D, Function3D

Perlin Noise functions


Constructor Summary
Noise()
           
 
Method Summary
 float evaluate(float x)
          DOCUMENT ME!
 float evaluate(float x, float y)
          DOCUMENT ME!
 float evaluate(float x, float y, float z)
          DOCUMENT ME!
static float[] findRange(Function1D f, float[] minmax)
          Returns the minimum and maximum of a number of random values of the given function.
static float[] findRange(Function2D f, float[] minmax)
          Returns the minimum and maximum of a number of random values of the given function.
static float lerp(float t, float a, float b)
          DOCUMENT ME!
static float noise1(float x)
          Compute 1-dimensional Perlin noise.
static float noise2(float x, float y)
          Compute 2-dimensional Perlin noise.
static float noise3(float x, float y, float z)
          Compute 3-dimensional Perlin noise.
static float turbulence2(float x, float y, float octaves)
          Compute turbulence using Perlin noise.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Noise

public Noise()
Method Detail

evaluate

public float evaluate(float x)
DOCUMENT ME!

Specified by:
evaluate in interface Function1D
Parameters:
x - DOCUMENT ME!
Returns:
DOCUMENT ME!

evaluate

public float evaluate(float x,
                      float y)
DOCUMENT ME!

Specified by:
evaluate in interface Function2D
Parameters:
x - DOCUMENT ME!
y - DOCUMENT ME!
Returns:
DOCUMENT ME!

evaluate

public float evaluate(float x,
                      float y,
                      float z)
DOCUMENT ME!

Specified by:
evaluate in interface Function3D
Parameters:
x - DOCUMENT ME!
y - DOCUMENT ME!
z - DOCUMENT ME!
Returns:
DOCUMENT ME!

turbulence2

public static float turbulence2(float x,
                                float y,
                                float octaves)
Compute turbulence using Perlin noise.

Parameters:
x - the x value
y - the y value
octaves - number of octaves of turbulence
Returns:
turbulence value at (x,y)

noise1

public static float noise1(float x)
Compute 1-dimensional Perlin noise.

Parameters:
x - the x value
Returns:
noise value at x in the range -1..1

noise2

public static float noise2(float x,
                           float y)
Compute 2-dimensional Perlin noise.

Parameters:
x - the x coordinate
y - the y coordinate
Returns:
noise value at (x,y)

noise3

public static float noise3(float x,
                           float y,
                           float z)
Compute 3-dimensional Perlin noise.

Parameters:
x - the x coordinate
y - the y coordinate
y - the y coordinate
Returns:
noise value at (x,y,z)

lerp

public static float lerp(float t,
                         float a,
                         float b)
DOCUMENT ME!

Parameters:
t - DOCUMENT ME!
a - DOCUMENT ME!
b - DOCUMENT ME!
Returns:
DOCUMENT ME!

findRange

public static float[] findRange(Function1D f,
                                float[] minmax)
Returns the minimum and maximum of a number of random values of the given function. This is useful for making some stab at normalising the function.

Parameters:
f - DOCUMENT ME!
minmax - DOCUMENT ME!
Returns:
DOCUMENT ME!

findRange

public static float[] findRange(Function2D f,
                                float[] minmax)
Returns the minimum and maximum of a number of random values of the given function. This is useful for making some stab at normalising the function.

Parameters:
f - DOCUMENT ME!
minmax - DOCUMENT ME!
Returns:
DOCUMENT ME!