All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.jhlabs.image.OctTreeQuantizer

java.lang.Object
   |
   +----com.jhlabs.image.OctTreeQuantizer

public class OctTreeQuantizer
extends java.lang.Object
implements com.jhlabs.image.Quantizer
An image Quantizer based on the Octree algorithm. This is a very basic implementation at present and could be much improved by picking the nodes to reduce more carefully (i.e. not completely at random) when I get the time.


Constructor Index

 o OctTreeQuantizer()

Method Index

 o addPixels(int[], int, int)
Add pixels to the quantizer.
 o buildColorTable()
 o buildColorTable(int[], int[])
A quick way to use the quantizer.
 o getIndexForColor(int)
 o setup(int)
Initialize the quantizer.

Constructors

 o OctTreeQuantizer
 public OctTreeQuantizer()

Methods

 o setup
 public void setup(int numColors)
Initialize the quantizer. This should be called before adding any pixels.

Parameters:
numColors - the number of colors we're quantizing to.
 o addPixels
 public void addPixels(int pixels[],
                       int offset,
                       int count)
Add pixels to the quantizer.

Parameters:
pixels - the array of ARGB pixels
offset - the offset into the array
count - the count of pixels
 o getIndexForColor
 public int getIndexForColor(int rgb)
 o buildColorTable
 public int[] buildColorTable()
 o buildColorTable
 public void buildColorTable(int inPixels[],
                             int table[])
A quick way to use the quantizer. Just create a table the right size and pass in the pixels.


All Packages  Class Hierarchy  This Package  Previous  Next  Index