00001
00008 #ifndef __JPEGDECOMPRESSOR_HPP__
00009 #define __JPEGDECOMPRESSOR_HPP__
00010
00011
00012 #include <iostream>
00013
00014
00015 extern "C"
00016 {
00017 #include <jpeglib.h>
00018 #include <jerror.h>
00019 }
00020
00021
00022
00023 typedef struct
00024 {
00025
00026 jpeg_source_mgr pub;
00027
00028 unsigned char* stream;
00029
00030 int size;
00031 } JpegInformations;
00032
00033
00034 static inline void mem_init_source(j_decompress_ptr cinfo)
00035 { }
00036
00037
00038 boolean mem_fill_input_buffer(j_decompress_ptr cinfo);
00039
00040
00041 void mem_ram_src(j_decompress_ptr cinfo, char *data, int len);
00042
00043
00044 void mem_skip_input_data(j_decompress_ptr cinfo, long num_bytes);
00045
00046
00047 static inline void mem_term_source(j_decompress_ptr cinfo)
00048 { }
00049
00050
00051 namespace ipsi
00052 {
00053 class JpegDecompressor
00054 {
00055 public:
00056
00057 JpegDecompressor();
00058
00059 ~JpegDecompressor();
00060
00061 void decompress(unsigned char *stream, int size);
00062
00063 unsigned char *getImage();
00064
00065 int getHeight();
00066
00067 int getWidth();
00068
00069 private:
00070
00071 unsigned char* outputImage;
00072
00073 int height;
00074
00075 int width;
00076 };
00077 }
00078
00079 #endif // __JPEGDECOMPRESSOR_H__