Class SimplePalette
java.lang.Object
org.apache.commons.imaging.palette.SimplePalette
- All Implemented Interfaces:
Palette
- Direct Known Subclasses:
MedianCutPalette
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintgetEntry(int index) Gets the color for a given palette index.intgetPaletteIndex(int rgb) Gets the palette index for a given color.intlength()Gets the number of entries in the palette.
-
Field Details
-
palette
private final int[] palette
-
-
Constructor Details
-
SimplePalette
public SimplePalette(int[] palette) Constructs a new instance.- Parameters:
palette- palette to copy and store.
-
-
Method Details
-
getEntry
-
getPaletteIndex
public int getPaletteIndex(int rgb) Description copied from interface:PaletteGets the palette index for a given color.- Specified by:
getPaletteIndexin interfacePalette- Parameters:
rgb- the color to look up- Returns:
- the palette index
-
length
-