Class HeightMapFilter

java.lang.Object
com.sk89q.worldedit.math.convolution.HeightMapFilter

public class HeightMapFilter extends Object
Allows applications of Kernels onto the region's height map.

Only used for smoothing (with a GaussianKernel).

  • Constructor Summary

    Constructors
    Constructor
    Description
    HeightMapFilter(int kernelWidth, int kernelHeight, float[] kernelData)
    Construct the HeightMapFilter object.
    Construct the HeightMapFilter object.
  • Method Summary

    Modifier and Type
    Method
    Description
    float[]
    filter(float[] inData, int width, int height, float offset)
    Filter with a 2D kernel for float values.
    int[]
    filter(int[] inData, int width, int height)
    Filter with a 2D kernel.
    int[]
    filter(int[] inData, int width, int height, float offset)
    Filter with a 2D kernel.
    Get the kernel.
    void
    setKernel(Kernel kernel)
    Set the kernel.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • HeightMapFilter

      public HeightMapFilter(Kernel kernel)
      Construct the HeightMapFilter object.
      Parameters:
      kernel - the kernel
    • HeightMapFilter

      public HeightMapFilter(int kernelWidth, int kernelHeight, float[] kernelData)
      Construct the HeightMapFilter object.
      Parameters:
      kernelWidth - the width
      kernelHeight - the height
      kernelData - the data
  • Method Details

    • getKernel

      public Kernel getKernel()
      Get the kernel.
    • setKernel

      public void setKernel(Kernel kernel)
      Set the kernel.
      Parameters:
      kernel - the kernel
    • filter

      public int[] filter(int[] inData, int width, int height)
      Filter with a 2D kernel.
      Parameters:
      inData - the data
      width - the width
      height - the height
      Returns:
      the modified height map
    • filter

      public int[] filter(int[] inData, int width, int height, float offset)
      Filter with a 2D kernel.
      Parameters:
      inData - the data
      width - the width
      height - the height
      offset - the offset added to the height
      Returns:
      the modified height map
    • filter

      public float[] filter(float[] inData, int width, int height, float offset)
      Filter with a 2D kernel for float values.
      Parameters:
      inData - the data
      width - the width
      height - the height
      Returns:
      the modified height map