jvx.numeric
Class PnNoise
- java.lang.Object
-
- jvx.numeric.PnNoise
-
public class PnNoise extends java.lang.ObjectGenerates 2D procedural white noise by hashtable-like method to generate a gradient on an integer lattice that is made continuous by smoothed interpolation. Noise is 256-periodic.- Author:
- Eike Preuß
- Version:
- 15.05.05, 2.00 revised (kp) Formatted according to jv style.
20.02.03, 1.20 revised (ep) New methodintNoise. Check for negative (x,y) values added.
08.07.01, 1.10 revised (ep) Converted to float.
-
-
Field Summary
Fields Modifier and Type Field and Description int[][]m_preComputedNoise
-
Constructor Summary
Constructors Constructor and Description PnNoise()Creates and initializes new noise
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description intgetPreComputedNoise(int x, int y)CallpreComputeNoise(double, int, int, int, int)before using this.intintNoise(double x, double y)Value of white noise at given 2D point.floatnoise(float x, float y)Value of white noise at given 2D point.voidpreComputeNoise(double coarseness, int xmin, int ymin, int xmax, int ymax)
-
-
-
Method Detail
-
noise
public float noise(float x, float y)Value of white noise at given 2D point.- Returns:
- noise value [-1;1]
-
intNoise
public int intNoise(double x, double y)Value of white noise at given 2D point.- Returns:
- noise value [0;255]
-
preComputeNoise
public void preComputeNoise(double coarseness, int xmin, int ymin, int xmax, int ymax)- Since:
- JavaView 2.65.000
-
getPreComputedNoise
public int getPreComputedNoise(int x, int y)CallpreComputeNoise(double, int, int, int, int)before using this.- Since:
- JavaView 2.65.000
-
-
"