com.jmex.terrain.util
Class ImageBasedHeightMap

java.lang.Object
  extended by com.jmex.terrain.util.AbstractHeightMap
      extended by com.jmex.terrain.util.ImageBasedHeightMap

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.

Version:
$id$
Author:
Mike Kienenberger

Field Summary
 
Fields inherited from class com.jmex.terrain.util.AbstractHeightMap
filter, heightData, heightScale, NORMALIZE_RANGE, size
 
Constructor Summary
ImageBasedHeightMap(java.awt.Image colorImage)
          Creates a HeightMap from an Image.
 
Method Summary
 boolean load()
          load populates the height map data.
 
Methods inherited from class com.jmex.terrain.util.AbstractHeightMap
erodeTerrain, getHeightMap, getInterpolatedHeight, getScaledHeightAtPoint, getSize, getTrueHeightAtPoint, normalizeTerrain, save, setHeightAtPoint, setHeightScale, setMagnificationFilter, setSize, unloadHeightMap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageBasedHeightMap

public ImageBasedHeightMap(java.awt.Image colorImage)
Creates a HeightMap from an Image. The image will be converted to grayscale, and the grayscale values will be used to generate the height map. White is highest point while black is lowest point. Currently, the Image used must be square (width == height), but future work could rescale the image.

Parameters:
colorImage - Image to map to the height map.
Method Detail

load

public boolean load()
Description copied from class: AbstractHeightMap
load populates the height map data. This is dependent on the subclass's implementation.

Specified by:
load in class AbstractHeightMap
Returns:
true if the load was successful, false otherwise.