Packages

 

com.aspose.imaging

Interfaces

Classes

Exceptions

com.aspose.imaging

Interface IColorPalette

    • Method Detail

      • getEntriesCount

        int getEntriesCount()

        Gets the entries count.

        Returns:
        The entries count.
      • getArgb32Entries

        int[] getArgb32Entries()

        Gets an array of 32-bit ARGB structures.

        Returns:
        The 32-bit ARGB entries. The array of 32-bit ARGB structure that make up this com.aspose.imaging.ColorPalette.
      • getEntries

        Color[] getEntries()

        Gets an array of com.aspose.imaging.Color structures.

        Returns:
        The entries. The array of com.aspose.imaging.Color structure that make up this com.aspose.imaging.ColorPalette.
      • isCompactPalette

        boolean isCompactPalette()

        Gets a value indicating whether compact palette is used.

        Compact palette means that image will contain only the specified palette entries if possible or in other words the image will be more compact and occupy less space; otherwise there will be 2^BitsPerPixel entries and image will reserve more space for all possible palette entries. Setting this value to true and changing palette entries may cause performance penalty since data movement may occur so use it carefully.

        Returns:
        true if compact palette is used; otherwise, false.
      • getNearestColorIndex

        int getNearestColorIndex(int argb32Color)

        Gets the index of the nearest 32-bit ARGB color.

        Parameters:
        argb32Color - The 32-bit ARGB color.
        Returns:
        The index of the nearest color.
      • getNearestColorIndex

        int getNearestColorIndex(Color color)

        Gets the index of the nearest color.

        Parameters:
        color - The color.
        Returns:
        The index of the nearest color.
      • getArgb32Color

        int getArgb32Color(int index)

        Gets the 32-bit ARGB palette color by index.

        Parameters:
        index - The 32-bit ARGB palette color index.
        Returns:
        The color palette entry specified by the index.
        Throws:
        RuntimeException - if color palette index specified is out of the palette entries range.
      • getColor

        Color getColor(int index)

        Gets the palette color by index.

        Parameters:
        index - The palette color index.
        Returns:
        The color palette entry specified by the index.
        Throws:
        RuntimeException - if color palette index specified is out of the palette entries range.