com.jhlabs.image
Class DiffusionFilter

java.lang.Object
  extended by com.jhlabs.image.AbstractBufferedImageOp
      extended by j2d.filters.WholeImageFilter
          extended by com.jhlabs.image.DiffusionFilter
All Implemented Interfaces:
ImageProcessorInterface, java.awt.image.BufferedImageOp, java.lang.Cloneable

public class DiffusionFilter
extends WholeImageFilter

A filter which uses Floyd-Steinberg error diffusion dithering to halftone an image.


Field Summary
 int levels
           
 
Constructor Summary
DiffusionFilter()
          Construct a DiffusionFilter
 
Method Summary
 boolean getColorDither()
           
 int getLevels()
           
 int[] getMatrix()
           
 boolean getSerpentine()
          Return the serpentine setting
 void 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.
 java.lang.String toString()
           
 
Methods inherited from class j2d.filters.WholeImageFilter
filter
 
Methods inherited from class com.jhlabs.image.AbstractBufferedImageOp
createCompatibleDestImage, getBounds2D, getPoint2D, getRenderingHints, getRGB, process, setRGB
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

levels

public int levels
Constructor Detail

DiffusionFilter

public DiffusionFilter()
Construct a DiffusionFilter

Method Detail

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()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object