public abstract class ColorQuantizer extends Object
Modifier and Type | Field and Description |
---|---|
protected static int |
MAX_RGB |
Constructor and Description |
---|
ColorQuantizer() |
Modifier and Type | Method and Description |
---|---|
protected int |
findColorIndex(int p)
Finds the color table index of the color that is "closest" to the supplied
RGB color (minimum Euclidean distance in color space).
|
abstract int[][] |
getColorMap()
Retrieves the color map produced by this color quantizer.
|
protected int[] |
intToRgb(int rgb) |
void |
listColorMap() |
protected int |
log2(int n) |
ij.process.ByteProcessor |
quantize(ij.process.ColorProcessor cp)
Performs color quantization on the given full-color RGB image
and creates an indexed color image.
|
int |
quantize(int p)
Performs color quantization on the given ARGB-encoded color
value and returns the associated quantized color.
|
int[] |
quantize(int[] origPixels)
Performs color quantization on the given sequence of
ARGB-encoded color values and returns a new sequence
of quantized colors.
|
protected int |
rgbToInt(int red,
int grn,
int blu) |
protected int |
sqr(int k) |
protected static final int MAX_RGB
public ColorQuantizer()
public abstract int[][] getColorMap()
public ij.process.ByteProcessor quantize(ij.process.ColorProcessor cp)
cp
- The original full-color RGB image.public int[] quantize(int[] origPixels)
origPixels
- The original ARGB-encoded color values.public int quantize(int p)
p
- The original ARGB-encoded color value.protected int findColorIndex(int p)
p
- Original color, encoded as an ARGB integer.public void listColorMap()
protected int log2(int n)
protected int sqr(int k)
protected int[] intToRgb(int rgb)
protected int rgbToInt(int red, int grn, int blu)
Copyright © 2006–2017, Wilhelm Burger, Mark J. Burge (BSD 2-Clause Simplified License)