Class QuantizedPalette

  • All Implemented Interfaces:
    Palette

    public class QuantizedPalette
    extends java.lang.Object
    implements Palette
    • Constructor Detail

      • QuantizedPalette

        public QuantizedPalette​(java.util.List<ColorSpaceSubset> subsets,
                                int precision)
    • Method Detail

      • getPaletteIndex

        public int getPaletteIndex​(int rgb)
                            throws ImageWriteException
        Description copied from interface: Palette
        Looks up the palette index for a given color.
        Specified by:
        getPaletteIndex in interface Palette
        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.
        Specified by:
        getEntry in interface Palette
        Parameters:
        index - the palette index to look up
        Returns:
        the color in ARGB format
      • length

        public int length()
        Description copied from interface: Palette
        The number of entries in the palette.
        Specified by:
        length in interface Palette
        Returns:
        the number of palette entries