PsdColorPalette

Inheritance: java.lang.Object

All Implemented Interfaces: com.aspose.psd.IPsdColorPalette

public class PsdColorPalette implements IPsdColorPalette

The PSD color palette.

Constructors

ConstructorDescription
PsdColorPalette(IColorPalette colorPalette)Initializes a new instance of the PsdColorPalette class.
PsdColorPalette(IColorPalette colorPalette, short transparentIndex)Initializes a new instance of the PsdColorPalette class.
PsdColorPalette(byte[] rawEntriesData, boolean isCompactPalette)Initializes a new instance of the PsdColorPalette class.
PsdColorPalette(byte[] rawEntriesData)Initializes a new instance of the PsdColorPalette class and IsCompactPalette is false.
PsdColorPalette(byte[] rawEntriesData, short transparentIndex, boolean useCompactPalette)Initializes a new instance of the PsdColorPalette class.
PsdColorPalette(byte[] rawEntriesData, short transparentIndex)Initializes a new instance of the PsdColorPalette class and IsCompactPalette is false.
PsdColorPalette(int[] colorPaletteArgb32Entries, boolean isCompactPalette)Initializes a new instance of the PsdColorPalette class.
PsdColorPalette(Color[] colorPaletteEntries, boolean isCompactPalette)Initializes a new instance of the PsdColorPalette class.
PsdColorPalette(Color[] colorPaletteEntries)Initializes a new instance of the PsdColorPalette class and IsCompactPalette is false.
PsdColorPalette(Color[] colorPaletteEntries, short transparentIndex, boolean useCompactPalette)Initializes a new instance of the PsdColorPalette class.
PsdColorPalette(Color[] colorPaletteEntries, short transparentIndex)Initializes a new instance of the PsdColorPalette class and IsCompactPalette is false.

Methods

MethodDescription
copyPalette(IColorPalette colorPalette)Copies the palette.
copyPalette(IColorPalette colorPalette, boolean useCompactPalette)Copies the palette.
equals(Object arg0)
getArgb32Color(int index)Gets the 32-bit ARGB palette color by index.
getArgb32Entries()Gets an array of 32-bit ARGB colors.
getClass()
getColor(int index)Gets the palette color by index.
getEntries()Gets an array of Color structures.
getEntriesCount()Gets the entries count.
getNearestColorIndex(Color color)Gets the index of the nearest color.
getNearestColorIndex(int argb32Color)Gets the index of the nearest color.
getRawEntries()Gets the raw color palette entries data.
getRawEntriesCount()Gets the raw color palette entries count.
getTransparentColor()Gets the transparent color.
getTransparentIndex()Gets the index of the transparent color.
hasTransparentColor()Gets a value indicating whether transparent color exists.
hashCode()
isCompactPalette()Gets a value indicating whether compact it palette.
notify()
notifyAll()
toString()
wait()
wait(long arg0)
wait(long arg0, int arg1)

PsdColorPalette(IColorPalette colorPalette)

public PsdColorPalette(IColorPalette colorPalette)

Initializes a new instance of the PsdColorPalette class.

Parameters:

ParameterTypeDescription
colorPaletteIColorPaletteThe color palette.

PsdColorPalette(IColorPalette colorPalette, short transparentIndex)

public PsdColorPalette(IColorPalette colorPalette, short transparentIndex)

Initializes a new instance of the PsdColorPalette class.

Parameters:

ParameterTypeDescription
colorPaletteIColorPaletteThe color palette.
transparentIndexshortThe transparent color index.

PsdColorPalette(byte[] rawEntriesData, boolean isCompactPalette)

public PsdColorPalette(byte[] rawEntriesData, boolean isCompactPalette)

Initializes a new instance of the PsdColorPalette class.

Parameters:

ParameterTypeDescription
rawEntriesDatabyte[]The raw entries data.
isCompactPalettebooleanIndicating whether compact it palette.

PsdColorPalette(byte[] rawEntriesData)

public PsdColorPalette(byte[] rawEntriesData)

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

Parameters:

ParameterTypeDescription
rawEntriesDatabyte[]The raw entries data.

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

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

Initializes a new instance of the PsdColorPalette class.

Parameters:

ParameterTypeDescription
rawEntriesDatabyte[]The raw entries data.
transparentIndexshortThe transparent color index. Note the index is not the raw entries index instead it is for the converted color array.
useCompactPalettebooleanIndicating whether compact it palette.

PsdColorPalette(byte[] rawEntriesData, short transparentIndex)

public PsdColorPalette(byte[] rawEntriesData, short transparentIndex)

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

Parameters:

ParameterTypeDescription
rawEntriesDatabyte[]The raw entries data.
transparentIndexshortThe transparent color index. Note the index is not the raw entries index instead it is for the converted color array.

PsdColorPalette(int[] colorPaletteArgb32Entries, boolean isCompactPalette)

public PsdColorPalette(int[] colorPaletteArgb32Entries, boolean isCompactPalette)

Initializes a new instance of the PsdColorPalette class.

Parameters:

ParameterTypeDescription
colorPaletteArgb32Entriesint[]The color palette 32-bit ARGB entries.
isCompactPalettebooleanIndicating whether compact it palette.

PsdColorPalette(Color[] colorPaletteEntries, boolean isCompactPalette)

public PsdColorPalette(Color[] colorPaletteEntries, boolean isCompactPalette)

Initializes a new instance of the PsdColorPalette class.

Parameters:

ParameterTypeDescription
colorPaletteEntriesColor[]The color palette entries.
isCompactPalettebooleanIndicating whether compact it palette.

PsdColorPalette(Color[] colorPaletteEntries)

public PsdColorPalette(Color[] colorPaletteEntries)

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

Parameters:

ParameterTypeDescription
colorPaletteEntriesColor[]The color palette entries.

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

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

Initializes a new instance of the PsdColorPalette class.

Parameters:

ParameterTypeDescription
colorPaletteEntriesColor[]The color palette entries.
transparentIndexshortThe transparent color index.
useCompactPalettebooleanIndicating whether compact it palette.

PsdColorPalette(Color[] colorPaletteEntries, short transparentIndex)

public PsdColorPalette(Color[] colorPaletteEntries, short transparentIndex)

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

Parameters:

ParameterTypeDescription
colorPaletteEntriesColor[]The color palette entries.
transparentIndexshortThe transparent color index.

copyPalette(IColorPalette colorPalette)

public static PsdColorPalette copyPalette(IColorPalette colorPalette)

Copies the palette.

Parameters:

ParameterTypeDescription
colorPaletteIColorPaletteThe color palette.

Returns: PsdColorPalette - The newly created and copied palette or null if null palette passed.

copyPalette(IColorPalette colorPalette, boolean useCompactPalette)

public static PsdColorPalette copyPalette(IColorPalette colorPalette, boolean useCompactPalette)

Copies the palette.

Parameters:

ParameterTypeDescription
colorPaletteIColorPaletteThe color palette.
useCompactPalettebooleanIndicating whether compact palette.

Returns: PsdColorPalette - The newly created and copied palette or null if null palette passed.

equals(Object arg0)

public boolean equals(Object arg0)

Parameters:

ParameterTypeDescription
arg0java.lang.Object

Returns: boolean

getArgb32Color(int index)

public final int getArgb32Color(int index)

Gets the 32-bit ARGB palette color by index.

Parameters:

ParameterTypeDescription
indexintThe 32-bit ARGB palette color index.

Returns: int - The color palette entry specified by the index .

getArgb32Entries()

public final int[] getArgb32Entries()

Gets an array of 32-bit ARGB colors.

Returns: int[] - The array of 32-bit ARGB structure that make up this ColorPalette. Value: The entries.

getClass()

public final native Class<?> getClass()

Returns: java.lang.Class

getColor(int index)

public final Color getColor(int index)

Gets the palette color by index.

Parameters:

ParameterTypeDescription
indexintThe palette color index.

Returns: Color - The color palette entry specified by the index .

getEntries()

public final Color[] getEntries()

Gets an array of Color structures.

Returns: com.aspose.psd.Color[] - The array of Color structure that make up this ColorPalette. Value: The entries.

getEntriesCount()

public final int getEntriesCount()

Gets the entries count.

Value: The entries count.

Returns: int

getNearestColorIndex(Color color)

public final int getNearestColorIndex(Color color)

Gets the index of the nearest color.

Parameters:

ParameterTypeDescription
colorColorThe color.

Returns: int - The index of the nearest color.

getNearestColorIndex(int argb32Color)

public final int getNearestColorIndex(int argb32Color)

Gets the index of the nearest color.

Parameters:

ParameterTypeDescription
argb32ColorintThe 32-bit ARGB color.

Returns: int - The index of the nearest color.

getRawEntries()

public final byte[] getRawEntries()

Gets the raw color palette entries data.

Value: The raw color palette entries data.

Returns: byte[]

getRawEntriesCount()

public final int getRawEntriesCount()

Gets the raw color palette entries count.

Value: The raw color palette entries count.

Returns: int

getTransparentColor()

public final Color getTransparentColor()

Gets the transparent color.

Value: The transparent color.

Returns: Color

getTransparentIndex()

public final short getTransparentIndex()

Gets the index of the transparent color.

Value: The index of the transparent color.

Returns: short

hasTransparentColor()

public final boolean hasTransparentColor()

Gets a value indicating whether transparent color exists.

Value: true if transparent color exists; otherwise, false .

Returns: boolean

hashCode()

public native int hashCode()

Returns: int

isCompactPalette()

public final 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.

Returns: boolean

notify()

public final native void notify()

notifyAll()

public final native void notifyAll()

toString()

public String toString()

Returns: java.lang.String

wait()

public final void wait()

wait(long arg0)

public final void wait(long arg0)

Parameters:

ParameterTypeDescription
arg0long

wait(long arg0, int arg1)

public final void wait(long arg0, int arg1)

Parameters:

ParameterTypeDescription
arg0long
arg1int