com.aspose.imaging.fileformats.psd
Class PsdImage

java.lang.Object
  extended by com.aspose.imaging.DisposableObject
      extended by com.aspose.imaging.DataStreamSupporter
          extended by com.aspose.imaging.Image
              extended by com.aspose.imaging.RasterImage
                  extended by com.aspose.imaging.fileformats.psd.PsdImage
All Implemented Interfaces:
IObjectWithBounds

public class PsdImage
extends RasterImage

A psd image.


Field Summary
static int DefaultVersion
           The default psd version.
 
Constructor Summary
PsdImage(PsdHeader psdHeader, ColorData colorData, ImageResources imageResources, LayerAndMaskInfo layerAndMaskInfo, ImageData imageData, IColorPalette colorPalette, boolean useCompactPalette, int version)
           Initializes a new instance of the PsdImage class.
 
Method Summary
 int getBitsPerChannel()
           Gets the bits per channel.
 int getBitsPerPixel()
           Gets the image bits per pixel count.
 int getChannelsCount()
           Gets the psd channels count.
 short getColorMode()
           Gets the color mode.
 short getCompression()
           Gets the compression method.
 int getHeight()
           Gets the image height.
 java.lang.String getImageLoaderDescriptorName()
           Gets the name of the image loader descriptor.
 ResourceBlock[] getResources()
           Gets the psd resources.
 PsdSaveOptions getSaveOptions()
           Gets the save options which may be used to save this image with the same settings.
 int getVersion()
           Gets or sets the version.
 int getWidth()
           Gets the image width.
protected  Color[] loadPixelsInternal(Rectangle rectangle)
           Loads pixels (format specific method).
protected  void onCompactPaletteUsageChanged()
           Called when compact palette usage is changed.
protected  void onDataStreamContainerChanging(StreamContainer streamContainer)
           Called when data stream container is changing.
protected  void onPaletteChanged(IColorPalette oldPalette, IColorPalette newPalette)
           Called when palette is changed.
 void resize(int newWidth, int newHeight, int resizeType)
           Resizes the specified new width.
protected  void rotateFlip(Color[] rotatedPixels, int newWidth, int newHeight)
           Performs (completes) rotate, flip or both rotate and flip operation.
protected  void savePixelsInternal(Rectangle rectangle, Color[] pixels)
           Saves pixels (format specific method).
 void setVersion(int value)
           
 
Methods inherited from class com.aspose.imaging.RasterImage
getHorizontalResolution, getPixel, getVerticalResolution, loadPixels, readScanLine, releaseManagedResources, rotateFlip, savePixels, setHorizontalResolution, setPalette, setPixel, setResolution, setVerticalResolution, writeScanLine
 
Methods inherited from class com.aspose.imaging.Image
canLoad, canLoad, canLoad, canLoad, canSave, create, getBounds, getContainer, getFileFormat, getFileFormat, getFitRectangle, getFitRectangle, getFittingRectangle, getFittingRectangle, getPalette, getSize, getUseCompactPalette, load, load, onPaletteChanging, resize, save, save, save, setContainer, setPalette, setUseCompactPalette
 
Methods inherited from class com.aspose.imaging.DataStreamSupporter
flush, getDataStreamContainer, save, save, setDataStreamContainer
 
Methods inherited from class com.aspose.imaging.DisposableObject
dispose, getDisposed, releaseUnmanagedResources, verifyNotDisposed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DefaultVersion

public static final int DefaultVersion

The default psd version.

See Also:
Constant Field Values
Constructor Detail

PsdImage

public PsdImage(PsdHeader psdHeader,
                ColorData colorData,
                ImageResources imageResources,
                LayerAndMaskInfo layerAndMaskInfo,
                ImageData imageData,
                IColorPalette colorPalette,
                boolean useCompactPalette,
                int version)

Initializes a new instance of the PsdImage class.

Parameters:
psdHeader - The PSD header.
colorData - The color data.
imageResources - The image resources.
layerAndMaskInfo - The layer and mask info.
imageData - The image data.
colorPalette - The color palette.
useCompactPalette - if set to true compact palette is used.
version - The psd version.
Method Detail

getBitsPerChannel

public int getBitsPerChannel()

Gets the bits per channel.

Value: The bits per channel.


getBitsPerPixel

public int getBitsPerPixel()

Gets the image bits per pixel count.

Value: The image bits per pixel count.

Specified by:
getBitsPerPixel in class Image

getChannelsCount

public int getChannelsCount()

Gets the psd channels count.

Value: The psd channels count.


getColorMode

public short getColorMode()

Gets the color mode.

Value: The color mode.


getCompression

public short getCompression()

Gets the compression method.

Value: The compression.


getHeight

public int getHeight()

Gets the image height.

Value: The image height.

Specified by:
getHeight in interface IObjectWithBounds
Specified by:
getHeight in class Image

getImageLoaderDescriptorName

public java.lang.String getImageLoaderDescriptorName()

Gets the name of the image loader descriptor.

Value: The name of the image loader descriptor.


This value is used later for proper image deserialization, thus specify valid registered descriptor here. During deserialization each descriptor type name is validated against this value.

Specified by:
getImageLoaderDescriptorName in class Image

getResources

public ResourceBlock[] getResources()

Gets the psd resources.

Value: The psd resources.


getSaveOptions

public PsdSaveOptions getSaveOptions()

Gets the save options which may be used to save this image with the same settings.

Value: The save options.


getVersion

public int getVersion()

Gets or sets the version.

Value: The version.


getWidth

public int getWidth()

Gets the image width.

Value: The image width.

Specified by:
getWidth in interface IObjectWithBounds
Specified by:
getWidth in class Image

loadPixelsInternal

protected Color[] loadPixelsInternal(Rectangle rectangle)

Loads pixels (format specific method).

Specified by:
loadPixelsInternal in class RasterImage
Parameters:
rectangle - The rectangle to load pixels from.
Returns:
The loaded pixels array.

onCompactPaletteUsageChanged

protected void onCompactPaletteUsageChanged()

Called when compact palette usage is changed.

Overrides:
onCompactPaletteUsageChanged in class Image

onDataStreamContainerChanging

protected void onDataStreamContainerChanging(StreamContainer streamContainer)

Called when data stream container is changing.

Overrides:
onDataStreamContainerChanging in class DataStreamSupporter
Parameters:
streamContainer - The stream container.

onPaletteChanged

protected void onPaletteChanged(IColorPalette oldPalette,
                                IColorPalette newPalette)

Called when palette is changed.

Overrides:
onPaletteChanged in class Image
Parameters:
oldPalette - The old palette.
newPalette - The new palette.

resize

public void resize(int newWidth,
                   int newHeight,
                   int resizeType)

Resizes the specified new width.

Overrides:
resize in class RasterImage
Parameters:
newWidth - The new width.
newHeight - The new height.
resizeType - Type of the resize.

rotateFlip

protected void rotateFlip(Color[] rotatedPixels,
                          int newWidth,
                          int newHeight)

Performs (completes) rotate, flip or both rotate and flip operation. This method is called to update the data stream.

Overrides:
rotateFlip in class RasterImage
Parameters:
rotatedPixels - The already rotated pixels.
newWidth - The new estimated width.
newHeight - The new estimated height.

savePixelsInternal

protected void savePixelsInternal(Rectangle rectangle,
                                  Color[] pixels)

Saves pixels (format specific method).

Specified by:
savePixelsInternal in class RasterImage
Parameters:
rectangle - The rectangle to save pixels to.
pixels - The pixels array.

setVersion

public void setVersion(int value)