|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jhlabs.image.OctTreeQuantizer
public class OctTreeQuantizer
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 Summary | |
---|---|
OctTreeQuantizer()
|
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public OctTreeQuantizer()
Method Detail |
---|
public void setup(int numColors)
setup
in interface Quantizer
numColors
- the number of colors we're quantizing to.public void addPixels(int[] pixels, int offset, int count)
addPixels
in interface Quantizer
pixels
- the array of ARGB pixelsoffset
- the offset into the arraycount
- the count of pixelspublic int getIndexForColor(int rgb)
getIndexForColor
in interface Quantizer
rgb
- the color
public int[] buildColorTable()
buildColorTable
in interface Quantizer
public void buildColorTable(int[] inPixels, int[] table)
inPixels
- the input colorstable
- the output color table
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |