public class RawHeightMap extends AbstractHeightMap
RawHeightMap
creates a height map from a RAW image file. The
greyscale image denotes height based on the value of the pixel for each
point. Where pure black the lowest point and pure white denotes the highest.Modifier and Type | Field and Description |
---|---|
static int |
FORMAT_16BITBE
Format specification for 16 bit big endian heightmaps
|
static int |
FORMAT_16BITLE
Format specification for 16 bit little endian heightmaps
|
static int |
FORMAT_8BIT
Format specification for 8 bit precision heightmaps
|
filter, heightData, heightScale, NORMALIZE_RANGE, size
Constructor and Description |
---|
RawHeightMap(float[] heightData) |
RawHeightMap(java.io.InputStream stream,
int size,
int format,
boolean swapxy) |
RawHeightMap(java.lang.String filename,
int size)
Constructor creates a new
RawHeightMap object and loads a
RAW image file to use as a height field. |
RawHeightMap(java.lang.String filename,
int size,
int format,
boolean swapXy) |
RawHeightMap(java.net.URL resource,
int size,
int format,
boolean swapxy) |
Modifier and Type | Method and Description |
---|---|
boolean |
load()
load fills the height data array with the appropriate data
from the set RAW image. |
void |
setFilename(java.lang.String filename)
setFilename sets the file to use for the RAW data. |
void |
setHeightStream(java.io.InputStream stream)
setHeightStream sets the stream to use for the RAW data. |
erodeTerrain, findMinMaxHeights, flatten, getHeightMap, getInterpolatedHeight, getScaledHeightAtPoint, getScaledHeightMap, getSize, getTrueHeightAtPoint, normalizeTerrain, save, setHeightAtPoint, setHeightScale, setMagnificationFilter, setSize, smooth, smooth, unloadHeightMap
public static final int FORMAT_8BIT
public static final int FORMAT_16BITLE
public static final int FORMAT_16BITBE
public RawHeightMap(java.lang.String filename, int size) throws java.lang.Exception
RawHeightMap
object and loads a
RAW image file to use as a height field. The greyscale image denotes the
height of the terrain, where dark is low point and bright is high point.
The values of the RAW correspond directly with the RAW values or 0 - 255.filename
- the RAW file to use as the heightmap.size
- the size of the RAW (must be square).java.lang.Exception
- if the filename is null or not RAW, and if the size is 0 or
less.public RawHeightMap(float[] heightData)
public RawHeightMap(java.lang.String filename, int size, int format, boolean swapXy) throws java.lang.Exception
java.lang.Exception
public RawHeightMap(java.io.InputStream stream, int size, int format, boolean swapxy) throws java.lang.Exception
java.lang.Exception
public RawHeightMap(java.net.URL resource, int size, int format, boolean swapxy) throws java.lang.Exception
java.lang.Exception
public boolean load()
load
fills the height data array with the appropriate data
from the set RAW image.java.lang.RuntimeException
- if the RAW image has not been setpublic void setFilename(java.lang.String filename) throws java.lang.Exception
setFilename
sets the file to use for the RAW data. A call
to load
is required to put the changes into effect.filename
- the new file to use for the height data.java.lang.Exception
- if the file is null or not RAW.public void setHeightStream(java.io.InputStream stream) throws java.lang.Exception
setHeightStream
sets the stream to use for the RAW data. A call
to load
is required to put the changes into effect.stream
- the new stream to use for the height data.java.lang.Exception
- if the stream is null or not RAW.