Class MedianCutPalette
java.lang.Object
org.apache.commons.imaging.palette.SimplePalette
org.apache.commons.imaging.palette.MedianCutPalette
- All Implemented Interfaces:
Palette
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
getPaletteIndex
(int rgb) Looks up the palette index for a given color.Methods inherited from class org.apache.commons.imaging.palette.SimplePalette
getEntry, length
-
Field Details
-
root
-
-
Constructor Details
-
MedianCutPalette
MedianCutPalette(ColorGroup root, int[] palette)
-
-
Method Details
-
getPaletteIndex
public int getPaletteIndex(int rgb) Description copied from interface:Palette
Looks up the palette index for a given color.- Specified by:
getPaletteIndex
in interfacePalette
- Overrides:
getPaletteIndex
in classSimplePalette
- Parameters:
rgb
- the color to look up- Returns:
- the palette index
-