Class ImageHeightmap
java.lang.Object
com.sk89q.worldedit.util.asset.holder.ImageHeightmap
Represents an image that acts as a heightmap.
Height is determined by how light each pixel of the image is, from black (0) to white (1). Lightness is determined by an average of the 3 color channels.
-
Constructor Summary
ConstructorDescriptionImageHeightmap
(BufferedImage image) Create a new image heightmap from an image. -
Method Summary
Modifier and TypeMethodDescriptiondouble
getHeightAt
(int x, int y, int size) Gets the height at the given position with scaling applied.
-
Constructor Details
-
ImageHeightmap
Create a new image heightmap from an image.- Parameters:
image
- The image
-
-
Method Details
-
getHeightAt
public double getHeightAt(int x, int y, int size) Gets the height at the given position with scaling applied.- Parameters:
x
- The x positiony
- The y positionsize
- The size to sample the image as- Returns:
- The height at the location
-