Package com.jhlabs.image
Interface Quantizer
-
- All Known Implementing Classes:
OctTreeQuantizer
public interface QuantizerThe interface for an image quantizer. The addColor method is called (repeatedly if necessary) with all the image pixels. A color table can then be returned by calling the buildColorTable method.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddPixels(int[] pixels, int offset, int count)Add pixels to the quantizer.int[]buildColorTable()intgetIndexForColor(int rgb)voidsetup(int numColors)Initialize the quantizer.
-
-
-
Method Detail
-
setup
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.
-
addPixels
void addPixels(int[] pixels, int offset, int count)Add pixels to the quantizer.- Parameters:
pixels- the array of ARGB pixelsoffset- the offset into the arraycount- the count of pixels
-
buildColorTable
int[] buildColorTable()
-
getIndexForColor
int getIndexForColor(int rgb)
-
-