Class ImageHeightmap

java.lang.Object
com.sk89q.worldedit.util.asset.holder.ImageHeightmap

@Beta public class ImageHeightmap extends Object
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 Details

    • ImageHeightmap

      public ImageHeightmap(BufferedImage image)
      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 position
      y - The y position
      size - The size to sample the image as
      Returns:
      The height at the location