00001 /* 00002 /-------------------------------------------------------------------- 00003 | 00004 | $Id: pltiffdec.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_PLTIFFDEC 00012 #define INCL_PLTIFFDEC 00013 00014 #ifndef INCL_PLPICDEC 00015 #include "plpicdec.h" 00016 #endif 00017 00018 #ifndef INCL_PLPOINT 00019 #include "plpoint.h" 00020 #endif 00021 00022 extern "C" 00023 { 00024 #include "tiff.h" 00025 #include "tiffio.h" 00026 } 00027 00030 class PLTIFFDecoder : public PLPicDecoder 00031 { 00032 00033 friend class _tiff_helper; 00034 friend class PLTIFFEncoder; 00035 00036 public: 00038 PLTIFFDecoder 00039 (); 00040 00042 virtual ~PLTIFFDecoder 00043 (); 00044 /* 00045 PLBmp * MakeBmpFromFile 00046 ( char * pszFName 00047 ); 00048 */ 00049 protected: 00052 virtual void DoDecode 00053 ( PLBmp * pBmp, 00054 PLDataSource * pDataSrc 00055 ); 00056 00057 virtual void DoTiffDecode 00058 ( PLBmp * pBmp, 00059 PLDataSource * pDataSrc, 00060 TIFF* tiff 00061 ); 00062 00063 private: 00064 // these 2 helpers dedicated to hi/low bit-depths respectively 00065 void doHiColor 00066 ( TIFF * tif, 00067 PLBmp * pBmp, 00068 uint16 SamplePerPixel 00069 ); 00070 00071 void doLoColor 00072 ( TIFF * tif, 00073 PLBmp * pBmp 00074 ); 00075 00076 const PLPoint getResolution (TIFF* tif); 00077 00078 // Callback from the TIFF library. 00079 // Should be accessed only by the TIFF decoder and libtiff. 00080 static void Win32WarningHandler 00081 ( const char* module, 00082 const char* fmt, 00083 va_list ap 00084 ); 00085 00086 // Callback from the TIFF library. 00087 // Should be accessed only by the TIFF decoder and libtiff. 00088 static void Win32ErrorHandler 00089 ( const char* module, 00090 const char* fmt, 00091 va_list ap 00092 ); 00093 00094 private: 00095 // Temporary storage for an error message. 00096 // Used in the callbacks, so it's static. 00097 static char m_szLastErr[256]; 00098 }; 00099 00100 00101 #endif 00102 /* 00103 /-------------------------------------------------------------------- 00104 | 00105 | $Log: pltiffdec.h,v $ 00106 | Revision 1.1 2004/05/21 21:02:53 maxx 00107 | Initial Version of vuVolume, moderatly changed to make it compile on my windows and linux machine. 00108 | 00109 | Revision 1.1 2002/11/13 01:58:22 mspindle 00110 | *** empty log message *** 00111 | 00112 | Revision 1.3 2001/10/21 17:12:40 uzadow 00113 | Added PSD decoder beta, removed BPPWanted from all decoders, added PLFilterPixel. 00114 | 00115 | Revision 1.2 2001/10/17 13:19:47 uzadow 00116 | Added support for photoshop tiff alpha channels. 00117 | 00118 | Revision 1.1 2001/09/16 19:03:22 uzadow 00119 | Added global name prefix PL, changed most filenames. 00120 | 00121 | Revision 1.7 2000/12/18 22:42:52 uzadow 00122 | Replaced RGBAPIXEL with PLPixel32. 00123 | 00124 | Revision 1.6 2000/01/16 20:43:15 anonymous 00125 | Removed MFC dependencies 00126 | 00127 | Revision 1.5 2000/01/08 15:56:12 Ulrich von Zadow 00128 | Made sure change logging works in every file. 00129 | 00130 | Revision 1.4 1999/10/03 18:50:52 Ulrich von Zadow 00131 | Added automatic logging of changes. 00132 | 00133 | 00134 -------------------------------------------------------------------- 00135 */