public interface HeightMap
Modifier and Type | Method and Description |
---|---|
default HeightMap |
clamped(double min,
double max)
Create a new height map that constrains the value of another height map to a given range.
|
HeightMap |
clone()
Create a deep copy of the height map.
|
double |
getBaseHeight()
Get the base height of this height map, in other words the lowest value
it can have.
|
int |
getColour(int x,
int y)
Get the colour of the height map at a particular location as a combined
RGB value consisting of the red component in bits 16-23, the green
component in bits 8-15, and the blue component in bits 0-7.
|
double |
getConstantValue()
If the height map is
constant : returns the constant
value that would be returned for any location from
getHeight(int, int) and getHeight(float, float) . |
java.awt.Rectangle |
getExtent()
Get the extent of the height map, if any.
|
double |
getHeight(float x,
float y)
Get the height of the height map at a particular location.
|
double |
getHeight(int x,
int y)
Get the height of the height map at a particular location.
|
javax.swing.Icon |
getIcon()
Get a 16x16 icon representing this height map.
|
java.lang.String |
getName()
Get the name of the height map.
|
double[] |
getRange()
Get the range of this height map, i.e.
|
long |
getSeed()
Get the seed of the height map.
|
boolean |
isConstant()
Indicate whether the height map is constant, i.e.
|
default HeightMap |
minus(double subtrahend)
Create a new height map which is the difference of this and a constant
value.
|
default HeightMap |
minus(HeightMap subtrahend)
Create a new height map which is the difference of this and another
height map.
|
default HeightMap |
plus(double addend)
Create a new height map which is the sum of this and a constant value.
|
default HeightMap |
plus(HeightMap addend)
Create a new height map which is the sum of this and another height map.
|
default HeightMap |
scaled(float scale)
Create a new height map that is another height map scaled up by a given factor.
|
void |
setSeed(long seed)
Set the seed of the height map.
|
default HeightMap |
smoothed()
Create a new height map which uses bicubic interpolation to interpolate values between the integer coordinates
of another height map.
|
default HeightMap |
times(double factor)
Create a new height map which is the product of this and a constant
value.
|
default HeightMap |
times(HeightMap subtrahend)
Create a new height map which is the product of this and another
height map.
|
java.lang.String getName()
long getSeed()
void setSeed(long seed)
seed
- The new seed of the height map.double getHeight(int x, int y)
x
- The X coordinate of the location of which to get the height.y
- The Y coordinate of the location of which to get the height.double getHeight(float x, float y)
x
- The X coordinate of the location of which to get the height.y
- The Y coordinate of the location of which to get the height.double getBaseHeight()
HeightMap clone()
java.awt.Rectangle getExtent()
null
.null
if it is
unbounded.int getColour(int x, int y)
x
- The X coordinate of the location of which to get the colour.y
- The Y coordinate of the location of which to get the colour.boolean isConstant()
true
if the height map is constant.double getConstantValue()
constant
: returns the constant
value that would be returned for any location from
getHeight(int, int)
and getHeight(float, float)
. If the
height map is not constant the behaviour is undefined.isConstant()
.javax.swing.Icon getIcon()
double[] getRange()
getBaseHeight()
) and the upper bound in
index 1.default HeightMap plus(HeightMap addend)
default HeightMap plus(double addend)
default HeightMap minus(HeightMap subtrahend)
default HeightMap minus(double subtrahend)
default HeightMap times(HeightMap subtrahend)
default HeightMap times(double factor)
default HeightMap smoothed()
default HeightMap scaled(float scale)
default HeightMap clamped(double min, double max)