public final class EfficientInverseColorMapComputation extends Object
This algorithm is adapted from the algorithm found in Graphics Gems volume 2 by Spencer W. Thomas "Efficient Inverse Color Map Computation".
Modifier and Type | Field and Description |
---|---|
protected int |
bits
Number of most significant bits we are going to use from the input color in order to quantize
them.
|
protected int |
blueQuantizationMask |
protected byte[][] |
colorMap
Forward color map.
|
protected int |
greenQuantizationMask |
protected byte[] |
mapBuf
inverse rgb color map
|
protected int |
redQuantizationMask |
protected int |
truncationBits |
Constructor and Description |
---|
EfficientInverseColorMapComputation(byte[][] rgbColorMap,
int quantizationBits)
EfficientInverseColorMapComputation that allows us to specify the number of bits we
are going to save from the quantization. |
Modifier and Type | Method and Description |
---|---|
int |
getIndexNearest(int red,
int green,
int blue)
This method is responsible for doing the actual lookup that given an rgb triple returns the
best, taking into account quantization, index in the forward color map.
|
protected final int bits
protected final int truncationBits
protected final int blueQuantizationMask
protected final int greenQuantizationMask
protected final int redQuantizationMask
protected final byte[][] colorMap
protected final byte[] mapBuf
public EfficientInverseColorMapComputation(byte[][] rgbColorMap, int quantizationBits)
EfficientInverseColorMapComputation
that allows us to specify the number of bits we
are going to save from the quantization.public int getIndexNearest(int red, int green, int blue)
red
- component.green
- component.blue
- component.Copyright © 1996–2023 Geotools. All rights reserved.