Class SimplePalette
- java.lang.Object
-
- org.apache.commons.imaging.palette.SimplePalette
-
- All Implemented Interfaces:
Palette
- Direct Known Subclasses:
MedianCutPalette
public class SimplePalette extends java.lang.Object implements Palette
-
-
Field Summary
Fields Modifier and Type Field Description private int[]palette
-
Constructor Summary
Constructors Constructor Description SimplePalette(int[] palette)Constructs a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetEntry(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.
-
-
-
Method Detail
-
getEntry
public int getEntry(int index)
Description copied from interface:PaletteGets the color for a given palette index.
-
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
-
-