com.aspose.imaging.fileformats.psd
Class PsdColorPalette

java.lang.Object
  extended by com.aspose.imaging.fileformats.psd.PsdColorPalette
All Implemented Interfaces:
IColorPalette, IPsdColorPalette

public class PsdColorPalette
extends java.lang.Object
implements IPsdColorPalette

The psd color palette.


Constructor Summary
PsdColorPalette(byte[] rawEntriesData)
           Initializes a new instance of the PsdColorPalette class.
PsdColorPalette(byte[] rawEntriesData, short transparentIndex)
           Initializes a new instance of the PsdColorPalette class.
PsdColorPalette(Color[] colorPaletteEntries)
           Initializes a new instance of the PsdColorPalette class.
PsdColorPalette(Color[] colorPaletteEntries, short transparentIndex)
           Initializes a new instance of the PsdColorPalette class.
PsdColorPalette(IColorPalette colorPalette)
           Initializes a new instance of the PsdColorPalette class.
PsdColorPalette(IColorPalette colorPalette, short transparentIndex)
           Initializes a new instance of the PsdColorPalette class.
 
Method Summary
 Color getColor(int index)
           Gets the palette color by index.
 Color[] getEntries()
           Gets an array of Color structures.
 int getEntriesCount()
           Gets the entries count.
 int getNearestColorIndex(Color color)
           Gets the index of the nearest color.
 byte[] getRawEntries()
           Gets the raw color palette entries data.
 int getRawEntriesCount()
           Gets the raw color palette entries count.
 Color getTransparentColor()
           Gets the transparent color.
 short getTransparentIndex()
           Gets the index of the transparent color.
 boolean hasTransparentColor()
           Gets a value indicating whether transparent color exists.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PsdColorPalette

public PsdColorPalette(byte[] rawEntriesData)

Initializes a new instance of the PsdColorPalette class.

Parameters:
rawEntriesData - The raw entries data.

PsdColorPalette

public PsdColorPalette(byte[] rawEntriesData,
                       short transparentIndex)

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.

PsdColorPalette

public PsdColorPalette(Color[] colorPaletteEntries)

Initializes a new instance of the PsdColorPalette class.

Parameters:
colorPaletteEntries - The color palette entries.

PsdColorPalette

public PsdColorPalette(Color[] colorPaletteEntries,
                       short transparentIndex)

Initializes a new instance of the PsdColorPalette class.

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

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.
Method Detail

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:
java.lang.IllegalArgumentException - if color palette index specified is out of the palette entries range.

getEntries

public Color[] getEntries()

Gets an array of Color structures.

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

getEntriesCount

public int getEntriesCount()

Gets the entries count.

Value: The entries count.

Specified by:
getEntriesCount in interface IColorPalette

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.

getRawEntries

public byte[] getRawEntries()

Gets the raw color palette entries data.

Value: The raw color palette entries data.

Specified by:
getRawEntries in interface IPsdColorPalette

getRawEntriesCount

public int getRawEntriesCount()

Gets the raw color palette entries count.

Value: The raw color palette entries count.

Specified by:
getRawEntriesCount in interface IPsdColorPalette

getTransparentColor

public Color getTransparentColor()

Gets the transparent color.

Value: The transparent color.

Specified by:
getTransparentColor in interface IPsdColorPalette

getTransparentIndex

public short getTransparentIndex()

Gets the index of the transparent color.

Value: The index of the transparent color.

Specified by:
getTransparentIndex in interface IPsdColorPalette

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