00001 /* 00002 /-------------------------------------------------------------------- 00003 | 00004 | $Id: planydec_8h-source.html,v 1.4 2004/09/15 15:26:26 uzadow Exp $ 00005 | 00006 | Copyright (c) 1996-2002 Ulrich von Zadow 00007 | 00008 \-------------------------------------------------------------------- 00009 */ 00010 00011 #ifndef INCL_PLANYDEC 00012 #define INCL_PLANYDEC 00013 00014 #ifndef INCL_PLPICDEC 00015 #include "plpicdec.h" 00016 #endif 00017 00018 class CBitmap; 00019 00020 class PLPictDecoder; 00021 class PLTGADecoder; 00022 class PLTIFFDecoder; 00023 class PLJPEGDecoder; 00024 class PLPNGDecoder; 00025 class PLWEMFDecoder; 00026 class PLPCXDecoder; 00027 class PLPGMDecoder; 00028 class PLGIFDecoder; 00029 class PLBmpDecoder; 00030 class PLPPMDecoder; 00031 class PLPSDDecoder; 00032 class PLSGIDecoder; 00033 class PLIFF85Decoder; 00034 00035 #define PL_FT_UNKNOWN 0 00036 #define PL_FT_WINBMP 1 00037 #define PL_FT_MACPICT 2 00038 #define PL_FT_TARGA 3 00039 #define PL_FT_TIFF 4 00040 #define PL_FT_JPEG 5 00041 #define PL_FT_PNG 6 00042 #define PL_FT_EPSTIFF 7 00043 #define PL_FT_WMF 8 00044 #define PL_FT_EMF 9 00045 #define PL_FT_PCX 10 00046 #define PL_FT_PGM 11 00047 #define PL_FT_GIF 12 00048 #define PL_FT_PPM 13 00049 #define PL_FT_PSD 14 00050 #define PL_FT_SGI 15 00051 #define PL_FT_IFF85 16 00052 00053 //! Class which decodes pictures with any known format. 00054 //! It auto-detects the format to use and delegates the work to one of 00055 //! the other decoder classes. 00056 //! The interface to PLAnyPicDecoder is the same as PLPicDecoder. 00057 class PLAnyPicDecoder : public PLPicDecoder 00058 { 00059 00060 public: 00061 //! Creates a decoder. 00062 PLAnyPicDecoder 00063 (); 00064 00065 //! Destroys the decoder. 00066 ~PLAnyPicDecoder 00067 (); 00068 00069 //! Returns the actual file type loaded. Can be called after open. 00070 int GetFileFormat (); 00071 00072 //! Opens a data source and prepares decoding. 00073 virtual void Open (PLDataSource * pDataSrc); 00074 00075 //! Decodes the actual image 00076 virtual void GetImage (PLBmpBase & Bmp); 00077 00078 //! Terminates decoding. 00079 virtual void Close (); 00080 00081 private: 00082 // Check for file-format-specific data & return the file type if 00083 // something fits. 00084 int getFileType 00085 ( PLBYTE * pData, 00086 int DataLen 00087 ); 00088 00089 long epsLongVal 00090 ( unsigned char *p 00091 ); 00092 00093 /////////////////////////////////////////////////////////////////// 00094 // Member variables. 00095 int m_Type; 00096 PLPicDecoder * m_pCurDec; 00097 00098 PLBmpDecoder * m_pBmpDec; 00099 PLPictDecoder * m_pPictDec; 00100 PLTGADecoder * m_pTGADec; 00101 PLTIFFDecoder * m_pTIFFDec; 00102 PLJPEGDecoder * m_pJPEGDec; 00103 PLPNGDecoder * m_pPNGDec; 00104 PLWEMFDecoder * m_pWEMFDec; 00105 PLPCXDecoder * m_pPCXDec; 00106 PLPGMDecoder * m_pPGMDec; 00107 PLGIFDecoder * m_pGIFDec; 00108 PLPPMDecoder * m_pPPMDec; 00109 PLPSDDecoder * m_pPSDDec; 00110 PLSGIDecoder * m_pSGIDec; 00111 PLIFF85Decoder* m_pIFF85Dec; 00112 00113 }; 00114 00115 #endif 00116 00117 /* 00118 /-------------------------------------------------------------------- 00119 | 00120 | $Log: planydec_8h-source.html,v $ 00120 | Revision 1.4 2004/09/15 15:26:26 uzadow 00120 | Linux compatibility changes, doc update. 00120 | 00121 | Revision 1.11 2004/06/19 16:49:07 uzadow 00122 | Changed GetImage so it works with PLBmpBase 00123 | 00124 | Revision 1.10 2004/06/06 12:56:38 uzadow 00125 | Doxygenified documentation. 00126 | 00127 | Revision 1.9 2004/03/13 19:40:23 uzadow 00128 | Added Rupert Welchs iff decoder. 00129 | 00130 | Revision 1.8 2003/06/01 21:12:06 uzadow 00131 | Added sgi rgb file format. 00132 | 00133 | Revision 1.7 2002/08/04 20:08:01 uzadow 00134 | Added PLBmpInfo class, ability to extract metainformation from 00135 | images without loading the whole image and proper greyscale support. 00136 | 00137 | Revision 1.6 2002/03/06 22:46:54 uzadow 00138 | Fixed major PLAnyDec bug 00139 | 00140 | Revision 1.5 2001/10/21 17:12:39 uzadow 00141 | Added PSD decoder beta, removed BPPWanted from all decoders, added 00142 | PLFilterPixel. 00143 | 00144 | Revision 1.4 2001/10/16 17:51:32 uzadow 00145 | Added ppm support (Todd Harris) 00146 | 00147 | Revision 1.3 2001/10/06 22:37:08 uzadow 00148 | Linux compatibility. 00149 | 00150 | Revision 1.2 2001/10/03 13:58:21 uzadow 00151 | Removed references to config.h 00152 | 00153 | Revision 1.1 2001/09/16 19:03:22 uzadow 00154 | Added global name prefix PL, changed most filenames. 00155 | 00156 | Revision 1.12 2001/09/15 21:02:44 uzadow 00157 | Cleaned up stdpch.h and config.h to make them internal headers. 00158 | 00159 | Revision 1.11 2001/01/14 13:36:15 uzadow 00160 | Added PLAnyPicDecoder::GetFileFormat() 00161 | 00162 | Revision 1.10 2000/12/08 12:32:00 uzadow 00163 | Added gif decoder by Michael Salzlechner. 00164 | 00165 | Revision 1.9 2000/03/31 11:53:29 Ulrich von Zadow 00166 | Added quantization support. 00167 | 00168 | Revision 1.8 2000/03/16 13:56:37 Ulrich von Zadow 00169 | Added pgm decoder by Jose Miguel Buenaposada Biencinto 00170 | 00171 | Revision 1.7 2000/01/16 20:43:12 anonymous 00172 | Removed MFC dependencies 00173 | 00174 | Revision 1.6 1999/12/08 15:39:45 Ulrich von Zadow 00175 | Unix compatibility changes 00176 | 00177 | 00178 \-------------------------------------------------------------------- 00179 */