Class QuantizedPalette
- java.lang.Object
-
- org.apache.commons.imaging.palette.QuantizedPalette
-
-
Field Summary
Fields Modifier and Type Field Description private int
precision
private ColorSpaceSubset[]
straight
private java.util.List<ColorSpaceSubset>
subsets
-
Constructor Summary
Constructors Constructor Description QuantizedPalette(java.util.List<ColorSpaceSubset> subsets, int precision)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getEntry(int index)
Looks up the color for a given palette index.int
getPaletteIndex(int rgb)
Looks up the palette index for a given color.int
length()
The number of entries in the palette.
-
-
-
Field Detail
-
precision
private final int precision
-
subsets
private final java.util.List<ColorSpaceSubset> subsets
-
straight
private final ColorSpaceSubset[] straight
-
-
Constructor Detail
-
QuantizedPalette
public QuantizedPalette(java.util.List<ColorSpaceSubset> subsets, int precision)
-
-
Method Detail
-
getPaletteIndex
public int getPaletteIndex(int rgb) throws ImageWriteException
Description copied from interface:Palette
Looks up the palette index for a given color.- Specified by:
getPaletteIndex
in interfacePalette
- Parameters:
rgb
- the color to look up- Returns:
- the palette index
- Throws:
ImageWriteException
- if it fails to read the palette index
-
getEntry
public int getEntry(int index)
Description copied from interface:Palette
Looks up the color for a given palette index.
-
-