00001
00002
00003
00004
00005
00006
00007 #ifndef __JPEGImage_h_
00008 #define __JPEGImage_h_
00009
00010 #include "Image.h"
00011 #include <stdio.h>
00012
00013
00014 #define INT32 _INT32
00015 #undef FAR
00016 #include "Tools/JPEGlib/jpeglib.h"
00017 #undef INT32
00018 #undef FAR
00019
00020 class JPEGImage;
00021
00022
00023
00024
00025
00026
00027
00028 Out& operator<<(Out& stream,const JPEGImage& image);
00029
00030
00031
00032
00033
00034
00035
00036 In& operator>>(In& stream,JPEGImage& image);
00037
00038
00039
00040
00041 class JPEGImage : public Image
00042 {
00043 private:
00044
00045
00046
00047
00048 class DestDescriptor : public jpeg_destination_mgr
00049 {
00050 public:
00051 JPEGImage* theObject;
00052 };
00053
00054 unsigned size;
00055
00056
00057
00058 static void onDestInit(j_compress_ptr cInfo);
00059 static int onDestEmpty(j_compress_ptr);
00060 static void onDestTerm(j_compress_ptr cInfo);
00061
00062 static void onSrcSkip(j_decompress_ptr cInfo,long numBytes);
00063 static int onSrcEmpty(j_decompress_ptr);
00064 static void onSrcIgnore(j_decompress_ptr);
00065
00066
00067 public:
00068
00069
00070
00071 JPEGImage() {size = 0;}
00072
00073
00074
00075
00076
00077 JPEGImage(const Image& src);
00078
00079
00080
00081
00082
00083
00084 JPEGImage& operator=(const Image& src);
00085
00086
00087
00088
00089
00090 void toImage(Image& dest) const;
00091
00092 friend Out& operator<<(Out& stream,const JPEGImage& image);
00093 friend In& operator>>(In& stream,JPEGImage& image);
00094 };
00095
00096 #endif //__JPEGImage_h_