Package com.jhlabs.image
Class DiffusionFilter
java.lang.Object
com.jhlabs.image.AbstractBufferedImageOp
com.jhlabs.image.WholeImageFilter
com.jhlabs.image.DiffusionFilter
- All Implemented Interfaces:
BufferedImageOp
,Serializable
,Cloneable
A filter which uses Floyd-Steinberg error diffusion dithering to halftone an image.
- See Also:
-
Field Summary
FieldsFields inherited from class com.jhlabs.image.WholeImageFilter
originalSpace, transformedSpace
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected int[]
filterPixels
(int width, int height, int[] inPixels, Rectangle transformedSpace) boolean
int
int[]
boolean
Return the serpentine settingvoid
setColorDither
(boolean colorDither) void
setLevels
(int levels) void
setMatrix
(int[] matrix) void
setSerpentine
(boolean serpentine) Set whether to use a serpentine pattern for return or not.toString()
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
-
Field Details
-
diffusionMatrix
protected static final int[] diffusionMatrix -
levels
public int levels
-
-
Constructor Details
-
DiffusionFilter
public DiffusionFilter()Construct a DiffusionFilter
-
-
Method Details
-
setSerpentine
public void setSerpentine(boolean serpentine) Set whether to use a serpentine pattern for return or not. This can reduce 'avalanche' artifacts in the output.- Parameters:
serpentine
- true to use serpentine pattern
-
getSerpentine
public boolean getSerpentine()Return the serpentine setting- Returns:
- the current setting
-
setColorDither
public void setColorDither(boolean colorDither) -
getColorDither
public boolean getColorDither() -
setMatrix
public void setMatrix(int[] matrix) -
getMatrix
public int[] getMatrix() -
setLevels
public void setLevels(int levels) -
getLevels
public int getLevels() -
filterPixels
- Specified by:
filterPixels
in classWholeImageFilter
-
toString
-