public class PsdColorPalette extends Object implements IPsdColorPalette
The PSD color palette.
Constructor and Description |
---|
PsdColorPalette(byte[] rawEntriesData)
Initializes a new instance of the
PsdColorPalette class and IsCompactPalette is false. |
PsdColorPalette(byte[] rawEntriesData,
boolean isCompactPalette)
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(byte[] rawEntriesData,
short transparentIndex,
boolean useCompactPalette)
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,
boolean isCompactPalette)
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. |
PsdColorPalette(Color[] colorPaletteEntries,
short transparentIndex,
boolean useCompactPalette)
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. |
PsdColorPalette(int[] colorPaletteArgb32Entries,
boolean isCompactPalette)
Initializes a new instance of the
PsdColorPalette class. |
Modifier and Type | Method and Description |
---|---|
static PsdColorPalette |
copyPalette(IColorPalette colorPalette)
Copies the palette.
|
static PsdColorPalette |
copyPalette(IColorPalette colorPalette,
boolean useCompactPalette)
Copies the palette.
|
int |
getArgb32Color(int index)
Gets the 32-bit ARGB palette color by index.
|
int[] |
getArgb32Entries()
Gets an array of 32-bit ARGB colors.
|
Color |
getColor(int index)
Gets the palette color by index.
|
Color[] |
getEntries()
Gets an array of
Aspose.Imaging.Color structures. |
int |
getEntriesCount()
Gets the entries count.
|
int |
getNearestColorIndex(Color color)
Gets the index of the nearest color.
|
int |
getNearestColorIndex(int argb32Color)
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.
|
int |
getTransparentArgbColor()
Gets the transparent color.
|
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.
|
boolean |
isCompactPalette()
Gets a value indicating whether compact it palette.
|
public PsdColorPalette(IColorPalette colorPalette)
Initializes a new instance of the PsdColorPalette
class.
colorPalette
- The color palette.public PsdColorPalette(IColorPalette colorPalette, short transparentIndex)
Initializes a new instance of the PsdColorPalette
class.
colorPalette
- The color palette.transparentIndex
- The transparent color index.public PsdColorPalette(byte[] rawEntriesData, boolean isCompactPalette)
Initializes a new instance of the PsdColorPalette
class.
rawEntriesData
- The raw entries data.isCompactPalette
- Indicating whether compact it palette.public PsdColorPalette(byte[] rawEntriesData)
Initializes a new instance of the PsdColorPalette
class and IsCompactPalette is false.
rawEntriesData
- The raw entries data.public PsdColorPalette(byte[] rawEntriesData, short transparentIndex, boolean useCompactPalette)
Initializes a new instance of the PsdColorPalette
class.
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.public PsdColorPalette(byte[] rawEntriesData, short transparentIndex)
Initializes a new instance of the PsdColorPalette
class and IsCompactPalette is false.
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.public PsdColorPalette(int[] colorPaletteArgb32Entries, boolean isCompactPalette)
Initializes a new instance of the PsdColorPalette
class.
colorPaletteArgb32Entries
- The color palette 32-bit ARGB entries.isCompactPalette
- Indicating whether compact it palette.public PsdColorPalette(Color[] colorPaletteEntries, boolean isCompactPalette)
Initializes a new instance of the PsdColorPalette
class.
colorPaletteEntries
- The color palette entries.isCompactPalette
- Indicating whether compact it palette.public PsdColorPalette(Color[] colorPaletteEntries)
Initializes a new instance of the PsdColorPalette
class and IsCompactPalette is false.
colorPaletteEntries
- The color palette entries.public PsdColorPalette(Color[] colorPaletteEntries, short transparentIndex, boolean useCompactPalette)
Initializes a new instance of the PsdColorPalette
class.
colorPaletteEntries
- The color palette entries.transparentIndex
- The transparent color index.useCompactPalette
- Indicating whether compact it palette.public PsdColorPalette(Color[] colorPaletteEntries, short transparentIndex)
Initializes a new instance of the PsdColorPalette
class and IsCompactPalette is false.
colorPaletteEntries
- The color palette entries.transparentIndex
- The transparent color index.public int getRawEntriesCount()
Gets the raw color palette entries count.
Value: The raw color palette entries count.getRawEntriesCount
in interface IPsdColorPalette
public int getEntriesCount()
Gets the entries count.
Value: The entries count.getEntriesCount
in interface IColorPalette
public int[] getArgb32Entries()
Gets an array of 32-bit ARGB colors.
getArgb32Entries
in interface IColorPalette
Aspose.Imaging.ColorPalette
.
Value: The entries.public Color[] getEntries()
Gets an array of Aspose.Imaging.Color
structures.
getEntries
in interface IColorPalette
Aspose.Imaging.Color
structure that make up this Aspose.Imaging.ColorPalette
.
Value: The entries.public short getTransparentIndex()
Gets the index of the transparent color.
Value: The index of the transparent color.getTransparentIndex
in interface IPsdColorPalette
public boolean hasTransparentColor()
Gets a value indicating whether transparent color exists.
Value:true
if transparent color exists; otherwise, false
.hasTransparentColor
in interface IPsdColorPalette
true
if transparent color exists; otherwise, false
.public Color getTransparentColor()
Gets the transparent color.
Value: The transparent color.getTransparentColor
in interface IPsdColorPalette
public byte[] getRawEntries()
Gets the raw color palette entries data.
Value: The raw color palette entries data.getRawEntries
in interface IPsdColorPalette
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.
isCompactPalette
in interface IColorPalette
true
if compact palette is used; otherwise, false
.public static PsdColorPalette copyPalette(IColorPalette colorPalette, boolean useCompactPalette)
Copies the palette.
colorPalette
- The color palette.useCompactPalette
- Indicating whether compact palette.public static PsdColorPalette copyPalette(IColorPalette colorPalette)
Copies the palette.
colorPalette
- The color palette.public int getNearestColorIndex(int argb32Color)
Gets the index of the nearest color.
getNearestColorIndex
in interface IColorPalette
argb32Color
- The 32-bit ARGB color.public int getNearestColorIndex(Color color)
Gets the index of the nearest color.
getNearestColorIndex
in interface IColorPalette
color
- The color.public int getArgb32Color(int index)
Gets the 32-bit ARGB palette color by index.
getArgb32Color
in interface IColorPalette
index
- The 32-bit ARGB palette color index.index
.com.aspose.ms.System.ArgumentOutOfRangeException
- if color palette index
specified is out of the palette entries range.public Color getColor(int index)
Gets the palette color by index.
getColor
in interface IColorPalette
index
- The palette color index.index
.com.aspose.ms.System.ArgumentOutOfRangeException
- if color palette index
specified is out of the palette entries range.public int getTransparentArgbColor()
IPsdColorPalette
Gets the transparent color.
getTransparentArgbColor
in interface IPsdColorPalette