Class HeightMapFilter
java.lang.Object
com.sk89q.worldedit.math.convolution.HeightMapFilter
Allows applications of Kernels onto the region's height map.
Only used for smoothing (with a GaussianKernel).
-
Constructor Summary
ConstructorDescriptionHeightMapFilter
(int kernelWidth, int kernelHeight, float[] kernelData) Construct the HeightMapFilter object.HeightMapFilter
(Kernel kernel) Construct the HeightMapFilter object. -
Method Summary
Modifier and TypeMethodDescriptionfloat[]
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
Set the kernel.
-
Constructor Details
-
HeightMapFilter
Construct the HeightMapFilter object.- Parameters:
kernel
- the kernel
-
HeightMapFilter
public HeightMapFilter(int kernelWidth, int kernelHeight, float[] kernelData) Construct the HeightMapFilter object.- Parameters:
kernelWidth
- the widthkernelHeight
- the heightkernelData
- the data
-
-
Method Details
-
getKernel
Get the kernel. -
setKernel
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 datawidth
- the widthheight
- 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 datawidth
- the widthheight
- the heightoffset
- 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 datawidth
- the widthheight
- the height- Returns:
- the modified height map
-