Logo Search packages:      
Sourcecode: paintlib version File versions

PLPSDDecoder Class Reference

#include <plpsddec.h>

Inheritance diagram for PLPSDDecoder:

PLPicDecoder PLBmpInfo

List of all members.


Detailed Description

Photoshop file decoder. Besides having the MakeBmpFromFile interface that the other decoders have, the photoshop decoder loads the layers of the image into separate bitmaps so they can be manipulated separately:
      vector<PLAnyBmp> Bmp;
      PLAnyBmp BaseBmp);
      Decoder->OpenFile ("face.psd");
      int NumLayers = Decoder->GetNumLayers();
      for (int i=0; i<NumLayers; i++)
      {
        GetNextLayer (Bmp[i]);
        LayerOffset = GetLayerOffset();
      }
      GetImage (&BaseBmp);
      Close();
    

Definition at line 53 of file plpsddec.h.


Public Member Functions

virtual void AssertValid () const
void AsString (char *psz, int len) const
virtual void Close ()
int GetBitsPerPixel () const
int GetHeight () const
virtual void GetImage (PLBmp &pBmp)
PLPoint GetLayerOffset ()
 Returns the origin of the layer data in the image.
void GetNextLayer (PLBmp &Bmp)
 Fills the bitmap with the layer data.
int GetNumLayers ()
 Returns number of layers in the image.
const PLPointGetResolution () const
const PLPointGetSize () const
int GetWidth () const
bool HasAlpha () const
bool IsGreyscale () const
virtual void MakeBmp (PLBmp *pBmp, int BPPWanted=0)
virtual void MakeBmpFromFile (const char *pszFName, PLBmp *pBmp, int BPPWanted=0, PLIProgressNotification *pProgNot=NULL)
virtual void MakeBmpFromMemory (unsigned char *ucMemSrc, int MemSrcSize, PLBmp *pBmp, int BPPWanted=0, PLIProgressNotification *pProgNot=NULL)
virtual void MakeBmpFromURL (const char *pszURL, PLBmp *pBmp, int BPPWanted=0, PLIProgressNotification *pProgNot=NULL)
virtual void Open (PLDataSource *pDataSrc)
void OpenFile (const char *pszFName, PLIProgressNotification *pProgNot=NULL)
bool operator== (const PLBmpInfo &Other) const
 PLPSDDecoder ()
 Creates a decoder.
void SetDataSrc (PLDataSource *pDataSrc)
virtual ~PLPSDDecoder ()
 Destroys a decoder.

Static Public Member Functions

static void raiseError (int Code, char *pszErr)
static void SetTraceConfig (int Level, char *pszFName)
static void Trace (int TraceLevel, const char *pszMessage)
 Called to output status messages to the current debug console.

Protected Member Functions

PLBYTE ReadByte (PLDataSource *pDataSrc)
PLLONG ReadILong (PLDataSource *pDataSrc)
PLWORD ReadIWord (PLDataSource *pDataSrc)
PLLONG ReadMLong (PLDataSource *pDataSrc)
PLWORD ReadMWord (PLDataSource *pDataSrc)
void SetBmpInfo (const PLBmpInfo &SrcInfo)
void SetBmpInfo (const PLPoint &Size, int bpp, const PLPoint &Resolution, bool bAlphaChannel, bool bIsGreyscale)
PLBYTE * unpackPictRow (PLBYTE *pLineBuf, PLDataSource *pDataSrc, int Width, int rowBytes, int SrcBytes)

Protected Attributes

bool m_bAlphaChannel
bool m_bIsGreyscale
int m_bpp
PLDataSourcem_pDataSrc
PLPoint m_Size

Private Member Functions

void cleanup ()
PLBmpInfocreateBmpInfo (int Mode, int Height, int Width, int Channels, const PLPoint &Resolution)
void readColorModeData (PLDataSource *pDataSrc)
void readHeader (PLDataSource *pDataSrc, PLPSDHeader *pPSDHeader)
void readImageData (PLDataSource *pDataSrc, PLBmp *pBmp, int Mode, int Height, int Width, int Channels)
void readImageResData (PLDataSource *pDataSrc, PLPoint &Resolution)
void readLayer (PLDataSource *pDataSrc, PLBmp &Bmp, int Mode)
void readLayerHeader (PLDataSource *pDataSrc)
void readRLEChannel (PLDataSource *pDataSrc, PLBmp *pBmp, int Mode, int Height, int Width, int ChannelNum, int *pRowLengths)
void readRLEImage (PLDataSource *pDataSrc, PLBmp *pBmp, int Mode, int Height, int Width, int Channels)
void readUncompressedImage (PLDataSource *pDataSrc, PLBmp *pBmp, int Mode, int Height, int Width, int Channels)
void skipLayerData (PLDataSource *pDataSrc)
void skipMaskData (PLDataSource *pDataSrc)
void traceCompressionMethod (PLWORD CompressionMethod)

Private Attributes

int m_LayersRead
int m_MiscDataSize
int m_NumLayers
std::vector< PLPSDLayerInfo * > m_pLayerInfo
PLBYTE * m_pMiscDataStart
PLPixel32 m_pPal [256]
PLPSDHeader m_PSDHeader
PLPoint m_Resolution

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index