|
j3d.org Code | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.j3d.geom.terrain.HeightImageCreator
public class HeightImageCreator
A converter utility for changing height map information to and from images.
Height maps are designed to use a single colour range - for example grey scale. They do not generate multiple colour values for different heights like the a colour ramp generator might produce. There is one colour for the minimum height and one colour for the maximum and the range blends between them.
When generating an image, the values works along the X part of image being equated to the X axis of the coordinates. The Y axis of the image is equivalent to the Z axis of the coordinates.
Constructor Summary | |
---|---|
HeightImageCreator()
Create a default map converter. |
|
HeightImageCreator(javax.vecmath.Color4b min,
javax.vecmath.Color4b max)
Create a new height map convertor that uses color range values when creating an image.If a parameter is null, it will set the color to either black or white depending on which is null. |
Method Summary | |
---|---|
java.awt.image.BufferedImage |
createColorImage(float[][] data)
Create a color model image from the set of terrain points. |
java.awt.image.BufferedImage |
createGreyScaleImage(float[][] data)
Create a greyscale image from a set of terrain points. |
void |
setColorRange(javax.vecmath.Color4b min,
javax.vecmath.Color4b max)
Set the colours for the minimum and maximum height. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HeightImageCreator()
public HeightImageCreator(javax.vecmath.Color4b min, javax.vecmath.Color4b max)
min
- The colour of the minimum heightmax
- The colour of the maximum heightMethod Detail |
---|
public void setColorRange(javax.vecmath.Color4b min, javax.vecmath.Color4b max)
min
- The colour of the minimum heightmax
- The colour of the maximum heightpublic java.awt.image.BufferedImage createGreyScaleImage(float[][] data)
data
- The map of terrain coordinate values
java.lang.NullPointerException
- The data reference is null
java.lang.IllegalArgumentException
- Values in the data array are nullpublic java.awt.image.BufferedImage createColorImage(float[][] data)
data
- The map of terrain coordinate values
java.lang.NullPointerException
- The data reference is null
java.lang.IllegalArgumentException
- Values in the data array are null
|
j3d.org Code | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |