00001 /* 00002 /-------------------------------------------------------------------- 00003 | 00004 | $Id: pljpegenc.h,v 1.1 2004/05/21 21:02:52 maxx Exp $ 00005 | 00006 | Copyright (c) 1996-2002 Ulrich von Zadow 00007 | 00008 \-------------------------------------------------------------------- 00009 */ 00010 00011 #ifndef INCL_PLJPEGENC 00012 #define INCL_PLJPEGENC 00013 00014 #ifndef INCL_PLPICENC 00015 #include "plpicenc.h" 00016 #endif 00017 00018 struct jpeg_compress_struct; 00019 struct jpeg_error_mgr; 00020 00023 class PLJPEGEncoder : public PLPicEncoder 00024 { 00025 00026 public: 00028 PLJPEGEncoder 00029 (); 00030 00032 ~PLJPEGEncoder 00033 (); 00034 00035 // todo: Notification not yet implemented for encoding - ms 3.6.99 00036 /* 00037 static void JNotification 00038 (j_common_ptr cinfo 00039 ); 00040 */ 00041 00043 void SetQuality(int iQuality); 00045 void SetOptimizeCoding(bool bOptimizeCoding); 00047 void SetSmoothingFactor(int iSmoothingFactor); 00049 void SetDensity(unsigned int uiX, unsigned int uiY); 00050 00051 protected: 00052 // Sets up the jpeg library data source and error handler and 00053 // calls the jpeg encoder. 00054 void DoEncode 00055 ( PLBmp * pBmp, 00056 PLDataSink * pDataSink 00057 ); 00058 00059 private: 00060 jpeg_compress_struct * m_pcinfo; // IJPEG encoder state. 00061 jpeg_error_mgr * m_pjerr; // Custom error manager. 00062 00063 int iQuality_; 00064 bool bOptimizeCoding_; 00065 int iSmoothingFactor_; 00066 unsigned int uiDensityX_; 00067 unsigned int uiDensityY_; 00068 00069 // Assumes IJPEG decoder is already set up. 00070 void encodeRGB 00071 ( PLBmp * pBmp, 00072 int iScanLines 00073 ); 00074 00075 }; 00076 00077 #endif 00078 00079 /* 00080 /-------------------------------------------------------------------- 00081 | 00082 | $Log: pljpegenc.h,v $ 00083 | Revision 1.1 2004/05/21 21:02:52 maxx 00084 | Initial Version of vuVolume, moderatly changed to make it compile on my windows and linux machine. 00085 | 00086 | Revision 1.1 2002/11/13 01:58:21 mspindle 00087 | *** empty log message *** 00088 | 00089 | Revision 1.3 2002/02/24 13:00:21 uzadow 00090 | Documentation update; removed buggy PLFilterRotate. 00091 | 00092 | Revision 1.2 2001/10/06 20:44:45 uzadow 00093 | Linux compatibility 00094 | 00095 | Revision 1.1 2001/09/16 19:03:22 uzadow 00096 | Added global name prefix PL, changed most filenames. 00097 | 00098 | Revision 1.5 2000/05/22 17:43:25 Ulrich von Zadow 00099 | Added SetQuality(), SetDensity(), SetOptimizeCoding() and 00100 | SetSmoothingFactor(). 00101 | 00102 | Revision 1.4 2000/01/16 20:43:13 anonymous 00103 | Removed MFC dependencies 00104 | 00105 | Revision 1.3 1999/12/08 15:39:45 Ulrich von Zadow 00106 | Unix compatibility changes 00107 | 00108 | Revision 1.2 1999/11/27 18:45:48 Ulrich von Zadow 00109 | Added/Updated doc comments. 00110 | 00111 | Revision 1.1 1999/10/19 21:28:05 Ulrich von Zadow 00112 | Added jpeg encoder 00113 | 00114 | 00115 \-------------------------------------------------------------------- 00116 */