org.jscience.media.pictures.filters
Class DiffusionFilter

java.lang.Object
  extended by java.awt.image.ImageFilter
      extended by org.jscience.media.pictures.filters.WholeImageFilter
          extended by org.jscience.media.pictures.filters.DiffusionFilter
All Implemented Interfaces:
java.awt.image.ImageConsumer, java.io.Serializable, java.lang.Cloneable

public class DiffusionFilter
extends WholeImageFilter

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

See Also:
Serialized Form

Field Summary
protected static int[] diffusionMatrix
          DOCUMENT ME!
 int levels
          DOCUMENT ME!
 
Fields inherited from class org.jscience.media.pictures.filters.WholeImageFilter
canFilterIndexColorModel, defaultRGBModel, inBytePixels, inPixels, originalSpace, transformedSpace
 
Fields inherited from class java.awt.image.ImageFilter
consumer
 
Fields inherited from interface java.awt.image.ImageConsumer
COMPLETESCANLINES, IMAGEABORTED, IMAGEERROR, RANDOMPIXELORDER, SINGLEFRAME, SINGLEFRAMEDONE, SINGLEPASS, STATICIMAGEDONE, TOPDOWNLEFTRIGHT
 
Constructor Summary
DiffusionFilter()
          Construct a DiffusionFilter
 
Method Summary
 boolean getColorDither()
          DOCUMENT ME!
 int getLevels()
          DOCUMENT ME!
 int[] getMatrix()
          DOCUMENT ME!
 boolean getSerpentine()
          Return the serpentine setting
 void imageComplete(int status)
          DOCUMENT ME!
 void setColorDither(boolean colorDither)
          DOCUMENT ME!
 void setLevels(int levels)
          DOCUMENT ME!
 void setMatrix(int[] matrix)
          DOCUMENT ME!
 void setSerpentine(boolean serpentine)
          Set whether to use a serpentine pattern for return or not.
 java.lang.String toString()
          DOCUMENT ME!
 
Methods inherited from class org.jscience.media.pictures.filters.WholeImageFilter
setColorModel, setDimensions, setPixels, setPixels, transformSpace
 
Methods inherited from class java.awt.image.ImageFilter
clone, getFilterInstance, resendTopDownLeftRight, setHints, setProperties
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

diffusionMatrix

protected static final int[] diffusionMatrix
DOCUMENT ME!


levels

public int levels
DOCUMENT ME!

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)
DOCUMENT ME!

Parameters:
colorDither - DOCUMENT ME!

getColorDither

public boolean getColorDither()
DOCUMENT ME!

Returns:
DOCUMENT ME!

setMatrix

public void setMatrix(int[] matrix)
DOCUMENT ME!

Parameters:
matrix - DOCUMENT ME!

getMatrix

public int[] getMatrix()
DOCUMENT ME!

Returns:
DOCUMENT ME!

setLevels

public void setLevels(int levels)
DOCUMENT ME!

Parameters:
levels - DOCUMENT ME!

getLevels

public int getLevels()
DOCUMENT ME!

Returns:
DOCUMENT ME!

imageComplete

public void imageComplete(int status)
DOCUMENT ME!

Specified by:
imageComplete in interface java.awt.image.ImageConsumer
Overrides:
imageComplete in class java.awt.image.ImageFilter
Parameters:
status - DOCUMENT ME!

toString

public java.lang.String toString()
DOCUMENT ME!

Overrides:
toString in class java.lang.Object
Returns:
DOCUMENT ME!