com.jhlabs.image

Class ErodeFilter

Implemented Interfaces:
BufferedImageOp, Cloneable

public class ErodeFilter
extends BinaryFilter

Given a binary image, this filter performs binary erosion, setting all removed pixels to the given 'new' color.

Field Summary

Fields inherited from class com.jhlabs.image.BinaryFilter

blackFunction, colormap, iterations, newColor

Fields inherited from class com.jhlabs.image.WholeImageFilter

originalSpace, transformedSpace

Constructor Summary

ErodeFilter()
Construct a WholeImageFilter.

Method Summary

protected int[]
filterPixels(int width, int height, int[] inPixels, Rectangle transformedSpace)
Actually filter the pixels.
int
getThreshold()
Return the threshold - the number of neighbouring pixels for dilation to occur.
void
setThreshold(int threshold)
Set the threshold - the number of neighbouring pixels for dilation to occur.
String
toString()

Methods inherited from class com.jhlabs.image.BinaryFilter

getBlackFunction, getColormap, getIterations, getNewColor, setBlackFunction, setColormap, setIterations, setNewColor

Methods inherited from class com.jhlabs.image.WholeImageFilter

filter, filterPixels, transformSpace

Methods inherited from class com.jhlabs.image.AbstractBufferedImageOp

clone, createCompatibleDestImage, getBounds2D, getPoint2D, getRGB, getRenderingHints, setRGB

Constructor Details

ErodeFilter

public ErodeFilter()
Construct a WholeImageFilter.

Method Details

filterPixels

protected int[] filterPixels(int width,
                             int height,
                             int[] inPixels,
                             Rectangle transformedSpace)
Actually filter the pixels.
Overrides:
filterPixels in interface WholeImageFilter
Parameters:
width - the image width
height - the image height
inPixels - the image pixels
transformedSpace - the output bounds
Returns:
the output pixels

getThreshold

public int getThreshold()
Return the threshold - the number of neighbouring pixels for dilation to occur.
Returns:
the current threshold

setThreshold

public void setThreshold(int threshold)
Set the threshold - the number of neighbouring pixels for dilation to occur.
Parameters:
threshold - the new threshold

toString

public String toString()