Packages

 

com.aspose.imaging.fileformats.psd

Class PsdColorPalette

    • Constructor Detail

      • PsdColorPalette

        public PsdColorPalette(IColorPalette colorPalette)

        Initializes a new instance of the PsdColorPalette class.

        Parameters:
        colorPalette - The color palette.
      • PsdColorPalette

        public PsdColorPalette(IColorPalette colorPalette,
                               short transparentIndex)

        Initializes a new instance of the PsdColorPalette class.

        Parameters:
        colorPalette - The color palette.
        transparentIndex - The transparent color index.
      • PsdColorPalette

        public PsdColorPalette(byte[] rawEntriesData,
                               boolean isCompactPalette)

        Initializes a new instance of the PsdColorPalette class.

        Parameters:
        rawEntriesData - The raw entries data.
        isCompactPalette - Indicating whether compact it palette.
      • PsdColorPalette

        public PsdColorPalette(byte[] rawEntriesData)

        Initializes a new instance of the PsdColorPalette class and IsCompactPalette is false.

        Parameters:
        rawEntriesData - The raw entries data.
      • PsdColorPalette

        public PsdColorPalette(byte[] rawEntriesData,
                               short transparentIndex,
                               boolean useCompactPalette)

        Initializes a new instance of the PsdColorPalette class.

        Parameters:
        rawEntriesData - The raw entries data.
        transparentIndex - The transparent color index. Note the index is not the raw entries index instead it is for the converted color array.
        useCompactPalette - Indicating whether compact it palette.
      • PsdColorPalette

        public PsdColorPalette(byte[] rawEntriesData,
                               short transparentIndex)

        Initializes a new instance of the PsdColorPalette class and IsCompactPalette is false.

        Parameters:
        rawEntriesData - The raw entries data.
        transparentIndex - The transparent color index. Note the index is not the raw entries index instead it is for the converted color array.
      • PsdColorPalette

        public PsdColorPalette(int[] colorPaletteArgb32Entries,
                               boolean isCompactPalette)

        Initializes a new instance of the PsdColorPalette class.

        Parameters:
        colorPaletteArgb32Entries - The color palette 32-bit ARGB entries.
        isCompactPalette - Indicating whether compact it palette.
      • PsdColorPalette

        public PsdColorPalette(Color[] colorPaletteEntries,
                               boolean isCompactPalette)

        Initializes a new instance of the PsdColorPalette class.

        Parameters:
        colorPaletteEntries - The color palette entries.
        isCompactPalette - Indicating whether compact it palette.
      • PsdColorPalette

        public PsdColorPalette(Color[] colorPaletteEntries)

        Initializes a new instance of the PsdColorPalette class and IsCompactPalette is false.

        Parameters:
        colorPaletteEntries - The color palette entries.
      • PsdColorPalette

        public PsdColorPalette(Color[] colorPaletteEntries,
                               short transparentIndex,
                               boolean useCompactPalette)

        Initializes a new instance of the PsdColorPalette class.

        Parameters:
        colorPaletteEntries - The color palette entries.
        transparentIndex - The transparent color index.
        useCompactPalette - Indicating whether compact it palette.
      • PsdColorPalette

        public PsdColorPalette(Color[] colorPaletteEntries,
                               short transparentIndex)

        Initializes a new instance of the PsdColorPalette class and IsCompactPalette is false.

        Parameters:
        colorPaletteEntries - The color palette entries.
        transparentIndex - The transparent color index.
    • Method Detail

      • getRawEntriesCount

        public int getRawEntriesCount()

        Gets the raw color palette entries count.

        Value: The raw color palette entries count.
        Specified by:
        getRawEntriesCount in interface IPsdColorPalette
        Returns:
        The raw color palette entries count.
      • getEntriesCount

        public int getEntriesCount()

        Gets the entries count.

        Value: The entries count.
        Specified by:
        getEntriesCount in interface IColorPalette
        Returns:
        The entries count.
      • getArgb32Entries

        public int[] getArgb32Entries()

        Gets an array of 32-bit ARGB colors.

        Specified by:
        getArgb32Entries in interface IColorPalette
        Returns:
        The array of 32-bit ARGB structure that make up this Aspose.Imaging.ColorPalette. Value: The entries.
      • getEntries

        public Color[] getEntries()

        Gets an array of Aspose.Imaging.Color structures.

        Specified by:
        getEntries in interface IColorPalette
        Returns:
        The array of Aspose.Imaging.Color structure that make up this Aspose.Imaging.ColorPalette. Value: The entries.
      • getTransparentIndex

        public short getTransparentIndex()

        Gets the index of the transparent color.

        Value: The index of the transparent color.
        Specified by:
        getTransparentIndex in interface IPsdColorPalette
        Returns:
        The index of the transparent color.
      • hasTransparentColor

        public boolean hasTransparentColor()

        Gets a value indicating whether transparent color exists.

        Value: true if transparent color exists; otherwise, false.
        Specified by:
        hasTransparentColor in interface IPsdColorPalette
        Returns:
        true if transparent color exists; otherwise, false.
      • getTransparentColor

        public Color getTransparentColor()

        Gets the transparent color.

        Value: The transparent color.
        Specified by:
        getTransparentColor in interface IPsdColorPalette
        Returns:
        The transparent color.
      • getRawEntries

        public byte[] getRawEntries()

        Gets the raw color palette entries data.

        Value: The raw color palette entries data.
        Specified by:
        getRawEntries in interface IPsdColorPalette
        Returns:
        The raw color palette entries data.
      • isCompactPalette

        public boolean isCompactPalette()

        Gets a value indicating whether compact it palette.

        Value: true if compact it palette; otherwise, false.

        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.

        Specified by:
        isCompactPalette in interface IColorPalette
        Returns:
        true if compact palette is used; otherwise, false.
      • copyPalette

        public static PsdColorPalette copyPalette(IColorPalette colorPalette,
                                                  boolean useCompactPalette)

        Copies the palette.

        Parameters:
        colorPalette - The color palette.
        useCompactPalette - Indicating whether compact palette.
        Returns:
        The newly created and copied palette or null if null palette passed.
      • copyPalette

        public static PsdColorPalette copyPalette(IColorPalette colorPalette)

        Copies the palette.

        Parameters:
        colorPalette - The color palette.
        Returns:
        The newly created and copied palette or null if null palette passed.
      • getNearestColorIndex

        public int getNearestColorIndex(int argb32Color)

        Gets the index of the nearest color.

        Specified by:
        getNearestColorIndex in interface IColorPalette
        Parameters:
        argb32Color - The 32-bit ARGB color.
        Returns:
        The index of the nearest color.
      • getNearestColorIndex

        public int getNearestColorIndex(Color color)

        Gets the index of the nearest color.

        Specified by:
        getNearestColorIndex in interface IColorPalette
        Parameters:
        color - The color.
        Returns:
        The index of the nearest color.
      • getArgb32Color

        public int getArgb32Color(int index)

        Gets the 32-bit ARGB palette color by index.

        Specified by:
        getArgb32Color in interface IColorPalette
        Parameters:
        index - The 32-bit ARGB palette color index.
        Returns:
        The color palette entry specified by the index.
        Throws:
        com.aspose.ms.System.ArgumentOutOfRangeException - if color palette index specified is out of the palette entries range.
      • getColor

        public Color getColor(int index)

        Gets the palette color by index.

        Specified by:
        getColor in interface IColorPalette
        Parameters:
        index - The palette color index.
        Returns:
        The color palette entry specified by the index.
        Throws:
        com.aspose.ms.System.ArgumentOutOfRangeException - if color palette index specified is out of the palette entries range.