public class OctTreeQuantizer extends java.lang.Object implements Quantizer
Modifier and Type | Class and Description |
---|---|
(package private) class |
OctTreeQuantizer.OctTreeNode
An Octtree node.
|
Modifier and Type | Field and Description |
---|---|
(package private) static int |
MAX_LEVEL
The greatest depth the tree is allowed to reach
|
Constructor and Description |
---|
OctTreeQuantizer() |
Modifier and Type | Method and Description |
---|---|
void |
addPixels(int[] pixels,
int offset,
int count)
Add pixels to the quantizer.
|
int[] |
buildColorTable()
Build the color table.
|
void |
buildColorTable(int[] inPixels,
int[] table)
A quick way to use the quantizer.
|
int |
getIndexForColor(int rgb)
Get the color table index for a color.
|
void |
setup(int numColors)
Initialize the quantizer.
|
static final int MAX_LEVEL
public void setup(int numColors)
public void addPixels(int[] pixels, int offset, int count)
public int getIndexForColor(int rgb)
getIndexForColor
in interface Quantizer
rgb
- the colorpublic int[] buildColorTable()
buildColorTable
in interface Quantizer
public void buildColorTable(int[] inPixels, int[] table)
inPixels
- the input colorstable
- the output color table