org.jscience.media.pictures.filters
Class DitherFilter

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

public class DitherFilter
extends java.awt.image.RGBImageFilter
implements java.io.Serializable

DOCUMENT ME!

See Also:
Serialized Form

Field Summary
 boolean colorDither
          DOCUMENT ME!
 int cols
          DOCUMENT ME!
static int[] dither90Halftone6x6Matrix
          DOCUMENT ME!
static int[] ditherCluster3Matrix
          DOCUMENT ME!
static int[] ditherCluster4Matrix
          DOCUMENT ME!
static int[] ditherCluster8Matrix
          DOCUMENT ME!
static int[] ditherLines4x4Matrix
          DOCUMENT ME!
protected static int[] ditherMagic2x2Matrix
          DOCUMENT ME!
protected static int[] ditherMagic4x4Matrix
          DOCUMENT ME!
static int[] ditherOrdered4x4Matrix
          DOCUMENT ME!
static int[] ditherOrdered6x6Matrix
          DOCUMENT ME!
static int[] ditherOrdered8x8Matrix
          DOCUMENT ME!
protected  int[] div
          DOCUMENT ME!
 int levels
          DOCUMENT ME!
protected  int[] map
          DOCUMENT ME!
 int[] matrix
          DOCUMENT ME!
protected  int[] mod
          DOCUMENT ME!
 int rows
          DOCUMENT ME!
 
Fields inherited from class java.awt.image.RGBImageFilter
canFilterIndexColorModel, newmodel, origmodel
 
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
DitherFilter()
          Creates a new DitherFilter object.
 
Method Summary
 int filterRGB(int x, int y, int rgb)
          DOCUMENT ME!
 int getLevels()
          DOCUMENT ME!
 int[] getMatrix()
          DOCUMENT ME!
protected  void initialize()
          DOCUMENT ME!
 void setLevels(int levels)
          DOCUMENT ME!
 void setMatrix(int[] matrix)
          DOCUMENT ME!
 java.lang.String toString()
          DOCUMENT ME!
 
Methods inherited from class java.awt.image.RGBImageFilter
filterIndexColorModel, filterRGBPixels, setColorModel, setPixels, setPixels, substituteColorModel
 
Methods inherited from class java.awt.image.ImageFilter
clone, getFilterInstance, imageComplete, resendTopDownLeftRight, setDimensions, setHints, setProperties
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ditherMagic2x2Matrix

protected static final int[] ditherMagic2x2Matrix
DOCUMENT ME!


ditherMagic4x4Matrix

protected static final int[] ditherMagic4x4Matrix
DOCUMENT ME!


ditherOrdered4x4Matrix

public static final int[] ditherOrdered4x4Matrix
DOCUMENT ME!


ditherLines4x4Matrix

public static final int[] ditherLines4x4Matrix
DOCUMENT ME!


dither90Halftone6x6Matrix

public static final int[] dither90Halftone6x6Matrix
DOCUMENT ME!


ditherOrdered6x6Matrix

public static final int[] ditherOrdered6x6Matrix
DOCUMENT ME!


ditherOrdered8x8Matrix

public static final int[] ditherOrdered8x8Matrix
DOCUMENT ME!


ditherCluster3Matrix

public static final int[] ditherCluster3Matrix
DOCUMENT ME!


ditherCluster4Matrix

public static final int[] ditherCluster4Matrix
DOCUMENT ME!


ditherCluster8Matrix

public static final int[] ditherCluster8Matrix
DOCUMENT ME!


matrix

public int[] matrix
DOCUMENT ME!


rows

public int rows
DOCUMENT ME!


cols

public int cols
DOCUMENT ME!


levels

public int levels
DOCUMENT ME!


mod

protected int[] mod
DOCUMENT ME!


div

protected int[] div
DOCUMENT ME!


map

protected int[] map
DOCUMENT ME!


colorDither

public boolean colorDither
DOCUMENT ME!

Constructor Detail

DitherFilter

public DitherFilter()
Creates a new DitherFilter object.

Method Detail

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!

initialize

protected void initialize()
DOCUMENT ME!


filterRGB

public int filterRGB(int x,
                     int y,
                     int rgb)
DOCUMENT ME!

Specified by:
filterRGB in class java.awt.image.RGBImageFilter
Parameters:
x - DOCUMENT ME!
y - DOCUMENT ME!
rgb - DOCUMENT ME!
Returns:
DOCUMENT ME!

toString

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

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