net.sourceforge.jiu.color.quantization
Class UniformPaletteQuantizer
- RGBIndex, RGBQuantizer
public class UniformPaletteQuantizer
A color quantizer that maps to a palette which is equidistantly distributed
in the RGB color cube.
Equidistantly distributed only within each channel.
Palette | createPalette()- Return a Palette object with the list of colors to be used in the quantization
process.
|
int | map(int[] origRgb, int[] quantizedRgb)- This method maps a triplet of intensity values to its quantized counterpart
and returns the palette index of that quantized color.
|
int | mapToIndex(int red, int green, int blue)
|
void | process()- This method does the actual work of the operation.
|
private void | process(RGB24Image in, Paletted8Image out)
|
BLUE_BITS
private final int BLUE_BITS
BLUE_RIGHT_SHIFT
private final int BLUE_RIGHT_SHIFT
BLUE_VALUES
private final int[] BLUE_VALUES
GREEN_BITS
private final int GREEN_BITS
GREEN_LEFT_SHIFT
private final int GREEN_LEFT_SHIFT
GREEN_RIGHT_SHIFT
private final int GREEN_RIGHT_SHIFT
GREEN_VALUES
private final int[] GREEN_VALUES
PALETTE_BLUE
private int[] PALETTE_BLUE
PALETTE_GREEN
private int[] PALETTE_GREEN
PALETTE_RED
private int[] PALETTE_RED
RED_BITS
private final int RED_BITS
RED_LEFT_SHIFT
private final int RED_LEFT_SHIFT
RED_RIGHT_SHIFT
private final int RED_RIGHT_SHIFT
RED_VALUES
private final int[] RED_VALUES
TOTAL_BITS
private final int TOTAL_BITS
UniformPaletteQuantizer
public UniformPaletteQuantizer(int redBits,
int greenBits,
int blueBits)
createPalette
public Palette createPalette()
Return a Palette object with the list of colors to be used in the quantization
process.
That palette may be fixed or created specifically for a given input image.
- createPalette in interface RGBQuantizer
- Palette object for destination image
map
public int map(int[] origRgb,
int[] quantizedRgb) This method maps a triplet of intensity values to its quantized counterpart
and returns the palette index of that quantized color.
The index values for the two arrays are taken from RGBIndex.
- map in interface RGBQuantizer
origRgb - the three samples red, green and blue for which a good match is searched in the palettequantizedRgb - will hold the three samples found to be closest to origRgb after the call to this method
- int index in the palette of the match quantizedRgb
mapToIndex
public final int mapToIndex(int red,
int green,
int blue)
process
public void process()
This method does the actual work of the operation.
It must be called after all parameters have been given to the operation object.
- process in interface Operation