Class OctTreeQuantizer
java.lang.Object
org.jivesoftware.smackx.jingleold.mediaimpl.sshare.api.OctTreeQuantizer
- All Implemented Interfaces:
 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 Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionvoidaddPixels(int[] pixels, int offset, int count) Add pixels to the quantizer.int[]Build the color table.voidbuildColorTable(int[] inPixels, int[] table) A quick way to use the quantizer.intgetIndexForColor(int rgb) Get the color table index for a color.voidsetup(int numColors) Initialize the quantizer. 
- 
Constructor Details
- 
OctTreeQuantizer
public OctTreeQuantizer() 
 - 
 - 
Method Details
- 
setup
Initialize the quantizer. This should be called before adding any pixels. - 
addPixels
Add pixels to the quantizer. - 
getIndexForColor
Get the color table index for a color.- Specified by:
 getIndexForColorin interfaceQuantizer- Parameters:
 rgb- the color- Returns:
 - the index
 
 - 
buildColorTable
Build the color table.- Specified by:
 buildColorTablein interfaceQuantizer- Returns:
 - the color table
 
 - 
buildColorTable
A quick way to use the quantizer. Just create a table the right size and pass in the pixels.- Parameters:
 inPixels- the input colorstable- the output color table
 
 -