com.jhlabs.image
Class DiffusionFilter
- BufferedImageOp, Cloneable
public class DiffusionFilter
A filter which uses Floyd-Steinberg error diffusion dithering to halftone an image.
protected int[] | filterPixels(int width, int height, int[] inPixels, Rectangle transformedSpace) - Actually filter the pixels.
|
boolean | getColorDither() - Get whether to use a color dither.
|
int | getLevels() - Get the number of dither levels.
|
int[] | getMatrix() - Get the dither matrix.
|
boolean | getSerpentine() - Return the serpentine setting.
|
void | setColorDither(boolean colorDither) - Set whether to use a color dither.
|
void | setLevels(int levels) - Set the number of dither levels.
|
void | setMatrix(int[] matrix) - Set the dither matrix.
|
void | setSerpentine(boolean serpentine) - Set whether to use a serpentine pattern for return or not.
|
String | toString()
|
DiffusionFilter
public DiffusionFilter()
Construct a DiffusionFilter.
filterPixels
protected int[] filterPixels(int width,
int height,
int[] inPixels,
Rectangle transformedSpace)
Actually filter the pixels.
- filterPixels in interface WholeImageFilter
width
- the image widthheight
- the image heightinPixels
- the image pixelstransformedSpace
- the output bounds
getColorDither
public boolean getColorDither()
Get whether to use a color dither.
- true to use a color dither
getLevels
public int getLevels()
Get the number of dither levels.
getMatrix
public int[] getMatrix()
Get the dither matrix.
getSerpentine
public boolean getSerpentine()
Return the serpentine setting.
setColorDither
public void setColorDither(boolean colorDither)
Set whether to use a color dither.
colorDither
- true to use a color dither
setLevels
public void setLevels(int levels)
Set the number of dither levels.
levels
- the number of levels
setMatrix
public void setMatrix(int[] matrix)
Set the dither matrix.
matrix
- the dither matrix
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.
serpentine
- true to use serpentine pattern
toString
public String toString()