com.davisor.graphics
Class DynamicColorReducer

java.lang.Object
  extended bycom.davisor.graphics.ColorReducer
      extended bycom.davisor.graphics.DynamicColorReducer
All Implemented Interfaces:
java.awt.image.BufferedImageOp
Direct Known Subclasses:
OctreeColorReducer

public abstract class DynamicColorReducer
extends ColorReducer

DynamicColorReducer implements an abstract base class for dynamic color reducers that can approximate given color sets with smaller ones.

DynamicColorReducer offers a common interface for different color quantization adaptation methods. It also provides a generic image scanner that can fill the reducer with colors taken from the image.

Since:
JDK1.3

Field Summary
 
Fields inherited from class com.davisor.graphics.ColorReducer
COLORMASK_12BITS, COLORMASK_18BITS, COLORMASK_24BITS, COLORMASK_6BITS, M_colorMask
 
Constructor Summary
DynamicColorReducer()
          Creates a new dynamic color reducer with default color quantization mask.
DynamicColorReducer(int colorMask)
          Creates a new dynamic color reducer with given color quantization mask.
 
Method Summary
abstract  void addColor(int argb)
          Adds a ARGB color into the reducer source color set
 void addColors(java.awt.image.RenderedImage image)
          Scans an image for image colors and adds them to current color reducer source color set.
 
Methods inherited from class com.davisor.graphics.ColorReducer
createCompatibleDestImage, filter, getBounds2D, getColor, getColor, getColorBits, getColorMask, getColorMask, getColorMask, getIndex, getPalette, getPoint2D, getRenderingHints, setAlphaBits, setAlphaMask, setBlueBits, setBlueMask, setColorBits, setColorMask, setGreenBits, setGreenMask, setRedBits, setRedMask
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DynamicColorReducer

public DynamicColorReducer()
Creates a new dynamic color reducer with default color quantization mask.


DynamicColorReducer

public DynamicColorReducer(int colorMask)
Creates a new dynamic color reducer with given color quantization mask.

Parameters:
colorMask - color quantization mask
See Also:
ColorReducer.setColorMask(int)
Method Detail

addColor

public abstract void addColor(int argb)
Adds a ARGB color into the reducer source color set

Parameters:
argb - standard 32 bit ARGB color value to add

addColors

public void addColors(java.awt.image.RenderedImage image)
Scans an image for image colors and adds them to current color reducer source color set.

Parameters:
image - image to scan colors from
See Also:
addColor(int)


Copyright © 2001-2004 Davisor Oy. All Rights Reserved.