00001 /* 00002 /-------------------------------------------------------------------- 00003 | 00004 | $Id: pljpegdec.h,v 1.5 2003/04/13 21:51:43 uzadow Exp $ 00005 | 00006 | Copyright (c) 1996-2002 Ulrich von Zadow 00007 | 00008 \-------------------------------------------------------------------- 00009 */ 00010 00011 #ifndef INCL_PLJPEGDEC 00012 #define INCL_PLJPEGDEC 00013 00014 #ifndef INCL_PLPICDEC 00015 #include "plpicdec.h" 00016 #endif 00017 00018 #include <stdio.h> 00019 00020 extern "C" 00021 { 00022 #include "jpeglib.h" 00023 } 00024 00025 class PLExif; 00026 00027 //! JPEG file decoder. Uses the independent JPEG group's library 00028 //! to do the actual conversion. 00029 class PLJPEGDecoder : public PLPicDecoder 00030 { 00031 00032 public: 00033 //! Creates a decoder 00034 PLJPEGDecoder 00035 (); 00036 00037 //! Destroys a decoder 00038 ~PLJPEGDecoder 00039 (); 00040 00041 //! 00042 virtual void Open (PLDataSource * pDataSrc); 00043 00044 //! Fills the bitmap with the image. 00045 virtual void GetImage (PLBmp & Bmp); 00046 00047 void GetExifData(PLExif& ExifData); 00048 00049 virtual void Close(); 00050 00051 //! true (the default) selects fast but sloppy decoding. 00052 void SetFast 00053 ( bool bFast 00054 ); 00055 00056 // Jo Hagelberg 15.4.99 00057 // this must be static as it's passed to extern C 00058 //! callback for jpeglib's progress notification 00059 static void JNotification 00060 (j_common_ptr cinfo 00061 ); 00062 00063 private: 00064 // Assumes IJPEG decoder is already set up. 00065 void decodeGray 00066 ( PLBmp * pBmp); 00067 00068 // Assumes IJPEG decoder is already set up. 00069 void decodeRGB 00070 ( PLBmp * pBmp); 00071 00072 jpeg_decompress_struct cinfo; // IJPEG decoder state. 00073 jpeg_error_mgr jerr; // Custom error manager. 00074 00075 bool m_bFast; // true selects fast but sloppy decoding. 00076 PLExif * m_pExifData; 00077 }; 00078 00079 #endif 00080 /* 00081 /-------------------------------------------------------------------- 00082 | 00083 | $Log: pljpegdec.h,v $ 00084 | Revision 1.5 2003/04/13 21:51:43 uzadow 00085 | Added exif loading - windows ver. 00086 | 00087 | Revision 1.4 2002/08/04 20:08:01 uzadow 00088 | Added PLBmpInfo class, ability to extract metainformation from images without loading the whole image and proper greyscale support. 00089 | 00090 | Revision 1.3 2002/03/31 13:36:42 uzadow 00091 | Updated copyright. 00092 | 00093 | Revision 1.2 2001/10/21 17:12:40 uzadow 00094 | Added PSD decoder beta, removed BPPWanted from all decoders, added PLFilterPixel. 00095 | 00096 | Revision 1.1 2001/09/16 19:03:22 uzadow 00097 | Added global name prefix PL, changed most filenames. 00098 | 00099 | Revision 1.8 2001/09/15 21:02:44 uzadow 00100 | Cleaned up stdpch.h and config.h to make them internal headers. 00101 | 00102 | Revision 1.7 2000/12/18 22:42:52 uzadow 00103 | Replaced RGBAPIXEL with PLPixel32. 00104 | 00105 | Revision 1.6 2000/01/16 20:43:13 anonymous 00106 | Removed MFC dependencies 00107 | 00108 | Revision 1.5 1999/12/08 15:39:45 Ulrich von Zadow 00109 | Unix compatibility changes 00110 | 00111 | Revision 1.4 1999/11/27 18:45:48 Ulrich von Zadow 00112 | Added/Updated doc comments. 00113 | 00114 | 00115 \-------------------------------------------------------------------- 00116 */