|
|||||||||
| 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()
|
void |
buildColorTable(int[] inPixels,
int[] table)
A quick way to use the quantizer. |
int |
getIndexForColor(int rgb)
|
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 QuantizernumColors - the number of colors we're quantizing to.
public void addPixels(int[] pixels,
int offset,
int count)
addPixels in interface Quantizerpixels - the array of ARGB pixelsoffset - the offset into the arraycount - the count of pixelspublic int getIndexForColor(int rgb)
getIndexForColor in interface Quantizerpublic int[] buildColorTable()
buildColorTable in interface Quantizer
public void buildColorTable(int[] inPixels,
int[] table)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||