public class UniformPaletteQuantizer extends ImageToImageOperation implements RGBIndex, RGBQuantizer
Modifier and Type | Field and Description |
---|---|
private int |
BLUE_BITS |
private int |
BLUE_RIGHT_SHIFT |
private int[] |
BLUE_VALUES |
private int |
GREEN_BITS |
private int |
GREEN_LEFT_SHIFT |
private int |
GREEN_RIGHT_SHIFT |
private int[] |
GREEN_VALUES |
private int[] |
PALETTE_BLUE |
private int[] |
PALETTE_GREEN |
private int[] |
PALETTE_RED |
private int |
RED_BITS |
private int |
RED_LEFT_SHIFT |
private int |
RED_RIGHT_SHIFT |
private int[] |
RED_VALUES |
private int |
TOTAL_BITS |
INDEX_BLUE, INDEX_GREEN, INDEX_RED
Constructor and Description |
---|
UniformPaletteQuantizer(int redBits,
int greenBits,
int blueBits) |
Modifier and Type | Method and Description |
---|---|
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) |
canInputAndOutputBeEqual, ensureImagesHaveSameResolution, ensureInputImageIsAvailable, ensureOutputImageResolution, getInputImage, getOutputImage, setCanInputAndOutputBeEqual, setInputImage, setOutputImage
addProgressListener, addProgressListeners, getAbort, removeProgressListener, setAbort, setProgress, setProgress
private final int RED_BITS
private final int RED_LEFT_SHIFT
private final int RED_RIGHT_SHIFT
private final int[] RED_VALUES
private final int GREEN_BITS
private final int GREEN_LEFT_SHIFT
private final int GREEN_RIGHT_SHIFT
private final int[] GREEN_VALUES
private final int BLUE_BITS
private final int BLUE_RIGHT_SHIFT
private final int[] BLUE_VALUES
private final int TOTAL_BITS
private int[] PALETTE_RED
private int[] PALETTE_GREEN
private int[] PALETTE_BLUE
public UniformPaletteQuantizer(int redBits, int greenBits, int blueBits)
public Palette createPalette()
RGBQuantizer
createPalette
in interface RGBQuantizer
public int map(int[] origRgb, int[] quantizedRgb)
RGBQuantizer
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 methodpublic final int mapToIndex(int red, int green, int blue)
private void process(RGB24Image in, Paletted8Image out)