Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

plpsddec.h

Go to the documentation of this file.
00001 /*
00002 /--------------------------------------------------------------------
00003 |
00004 |      $Id: plpsddec.h,v 1.1 2004/05/21 21:02:53 maxx Exp $
00005 |
00006 |      Copyright (c) 1996-1998 Ulrich von Zadow
00007 |
00008 \--------------------------------------------------------------------
00009 */
00010 
00011 #ifndef INCL_PLPSDDEC
00012 #define INCL_PLPSDDEC
00013 
00014 #ifndef INCL_PLPICDEC
00015 #include "plpicdec.h"
00016 #endif
00017 
00018 #include <vector>
00019 
00020 class PLDataSource;
00021 class PLPoint;
00022 
00023 struct PLPSDHeader
00024 {
00025   char     Signature[4];
00026   PLWORD   Version;
00027   PLBYTE   Reserved[6];
00028   PLWORD   Channels;
00029   int      Rows;
00030   int      Columns;
00031   PLWORD   BPP;
00032   PLWORD   Mode;
00033 };
00034 
00035 struct PLPSDLayerInfo;
00036 
00052 class PLPSDDecoder : public PLPicDecoder
00053 {
00054 public:
00056   PLPSDDecoder
00057     ();
00058 
00060   virtual ~PLPSDDecoder
00061     ();
00062 
00064   int GetNumLayers
00065     ();
00066 
00068   void GetNextLayer
00069     ( PLBmp& Bmp
00070     );
00071 
00073   PLPoint GetLayerOffset
00074     ();
00075 
00078   void GetImage
00079     ( PLBmp& Bmp
00080     );
00081 
00082 protected:
00085   virtual void DoDecode
00086     ( PLBmp * pBmp,
00087       PLDataSource * pDataSrc
00088     );
00089 
00090 private:
00091   void readHeader
00092     ( PLDataSource * pDataSrc,
00093       PLPSDHeader * pPSDHeader
00094     );
00095 
00096   void readColorModeData 
00097     ( PLDataSource * pDataSrc
00098     );
00099 
00100   void createBmp 
00101     ( PLBmp *pBmp, 
00102       int Mode,
00103       int Height,
00104       int Width,
00105       int Channels,
00106       const PLPoint& Resolution
00107     );
00108 
00109   void readImageResData 
00110     ( PLDataSource * pDataSrc,
00111       PLPoint& Resolution
00112     );
00113 
00114   void readLayerHeader 
00115     ( PLDataSource * pDataSrc
00116     );
00117 
00118   void skipLayerData
00119     ( PLDataSource * pDataSrc
00120     );
00121 
00122   void skipMaskData
00123     ( PLDataSource * pDataSrc
00124     );
00125 
00126   void readLayer 
00127     ( PLDataSource * pDataSrc, 
00128       PLBmp& Bmp,
00129       int Mode
00130     );
00131 
00132   void readImageData
00133     ( PLDataSource * pDataSrc,
00134       PLBmp * pBmp,
00135       int Mode,
00136       int Height,
00137       int Width,
00138       int Channels 
00139     );
00140 
00141   void traceCompressionMethod
00142     ( PLWORD CompressionMethod
00143     );
00144 
00145   void readRLEImage 
00146     ( PLDataSource * pDataSrc,
00147       PLBmp * pBmp,
00148       int Mode,
00149       int Height,
00150       int Width,
00151       int Channels 
00152     );
00153 
00154   void readRLEChannel 
00155     ( PLDataSource * pDataSrc,
00156       PLBmp * pBmp,
00157       int Mode,
00158       int Height,
00159       int Width,
00160       int ChannelNum,
00161       int * pRowLengths 
00162     );
00163 
00164   void cleanup
00165     ();
00166 
00167   PLPSDHeader m_PSDHeader;
00168   PLPoint m_Resolution;
00169   PLPixel32 m_pPal[256];
00170   PLBYTE * m_pMiscDataStart;
00171   int m_MiscDataSize;
00172   int m_NumLayers;
00173   int m_LayersRead;
00174   std::vector<PLPSDLayerInfo *> m_pLayerInfo;
00175 };
00176 
00177 #endif
00178 
00179 /*
00180 /--------------------------------------------------------------------
00181 |
00182 |      $Log: plpsddec.h,v $
00183 |      Revision 1.1  2004/05/21 21:02:53  maxx
00184 |      Initial Version of vuVolume, moderatly changed to make it compile on my windows and linux machine.
00185 |
00186 |      Revision 1.1  2002/11/13 01:58:22  mspindle
00187 |      *** empty log message ***
00188 |
00189 |      Revision 1.1  2001/10/21 17:12:40  uzadow
00190 |      Added PSD decoder beta, removed BPPWanted from all decoders, added PLFilterPixel.
00191 |
00192 |
00193 \--------------------------------------------------------------------
00194 */

Generated on Wed Dec 15 21:20:30 2004 for vuVolume by  doxygen 1.3.9.1