public class ImageBasedHeightMap extends AbstractHeightMap
ImageBasedHeightMap
is a height map created from the grayscale
conversion of an image. The image used currently must have an equal height
and width, although future work could scale an incoming image to a specific
height and width.Modifier and Type | Field and Description |
---|---|
protected Image |
colorImage |
filter, heightData, heightScale, NORMALIZE_RANGE, size
Constructor and Description |
---|
ImageBasedHeightMap(Image colorImage)
Creates a HeightMap from an Image.
|
ImageBasedHeightMap(Image colorImage,
float heightScale) |
Modifier and Type | Method and Description |
---|---|
protected float |
calculateHeight(ColorRGBA color) |
protected float |
calculateHeight(float red,
float green,
float blue)
Get the grayscale value, or override in your own sub-classes
|
protected ImageRaster |
getImageRaster() |
boolean |
load()
Loads the image data from top left to bottom right
|
boolean |
load(boolean flipX,
boolean flipY) |
void |
setImage(Image image) |
erodeTerrain, findMinMaxHeights, flatten, getHeightMap, getInterpolatedHeight, getScaledHeightAtPoint, getScaledHeightMap, getSize, getTrueHeightAtPoint, normalizeTerrain, save, setHeightAtPoint, setHeightScale, setMagnificationFilter, setSize, smooth, smooth, unloadHeightMap
protected Image colorImage
public ImageBasedHeightMap(Image colorImage)
colorImage
- Image to map to the height map.public ImageBasedHeightMap(Image colorImage, float heightScale)
public void setImage(Image image)
public boolean load()
protected float calculateHeight(float red, float green, float blue)
protected float calculateHeight(ColorRGBA color)
protected ImageRaster getImageRaster()
public boolean load(boolean flipX, boolean flipY)