Package com.jhlabs.image
Class ErodeFilter
- java.lang.Object
-
- com.jhlabs.image.AbstractBufferedImageOp
-
- com.jhlabs.image.WholeImageFilter
-
- com.jhlabs.image.BinaryFilter
-
- com.jhlabs.image.ErodeFilter
-
- All Implemented Interfaces:
java.awt.image.BufferedImageOp
,java.lang.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
Constructors Constructor Description ErodeFilter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected int[]
filterPixels(int width, int height, int[] inPixels, java.awt.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.java.lang.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, transformSpace
-
Methods inherited from class com.jhlabs.image.AbstractBufferedImageOp
clone, createCompatibleDestImage, getBounds2D, getPoint2D, getRenderingHints, getRGB, setRGB, stringToColor
-
-
-
-
Method Detail
-
setThreshold
public void setThreshold(int threshold)
Set the threshold - the number of neighbouring pixels for dilation to occur.- Parameters:
threshold
- the new threshold- See Also:
getThreshold()
-
getThreshold
public int getThreshold()
Return the threshold - the number of neighbouring pixels for dilation to occur.- Returns:
- the current threshold
- See Also:
setThreshold(int)
-
filterPixels
protected int[] filterPixels(int width, int height, int[] inPixels, java.awt.Rectangle transformedSpace)
Description copied from class:WholeImageFilter
Actually filter the pixels.- Specified by:
filterPixels
in classWholeImageFilter
- Parameters:
width
- the image widthheight
- the image heightinPixels
- the image pixelstransformedSpace
- the output bounds- Returns:
- the output pixels
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-