Class QuantizedPalette
java.lang.Object
org.apache.commons.imaging.palette.QuantizedPalette
- All Implemented Interfaces:
Palette
-
Constructor Summary
ConstructorDescriptionQuantizedPalette
(List<org.apache.commons.imaging.palette.ColorSpaceSubset> subsets, int precision) -
Method Summary
Modifier and TypeMethodDescriptionint
getEntry
(int index) Gets the color for a given palette index.int
getPaletteIndex
(int rgb) Gets the palette index for a given color.int
length()
Gets the number of entries in the palette.
-
Constructor Details
-
QuantizedPalette
public QuantizedPalette(List<org.apache.commons.imaging.palette.ColorSpaceSubset> subsets, int precision)
-
-
Method Details
-
getEntry
Description copied from interface:Palette
Gets the color for a given palette index. -
getPaletteIndex
Description copied from interface:Palette
Gets the palette index for a given color.- Specified by:
getPaletteIndex
in interfacePalette
- Parameters:
rgb
- the color to look up- Returns:
- the palette index
- Throws:
ImagingException
- if it fails to read the palette index
-
length
Description copied from interface:Palette
Gets the number of entries in the palette.
-