Class QuantizedPalette
java.lang.Object
org.apache.commons.imaging.palette.QuantizedPalette
- All Implemented Interfaces:
Palette
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final int
private final ColorSpaceSubset[]
private final List<ColorSpaceSubset>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
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 Details
-
precision
private final int precision -
subsets
-
straight
-
-
Constructor Details
-
QuantizedPalette
-
-
Method Details
-
getPaletteIndex
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. -
length
public int length()Description copied from interface:Palette
The number of entries in the palette.
-