00001
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef JPEG_SOURCE_H
00023 #define JPEG_SOURCE_H
00024
00025 #include "ImageSource.h"
00026 #include "Image.h"
00027
00028 #include <stdio.h>
00029 #include <stdlib.h>
00030 #include <stddef.h>
00031 #include <unistd.h>
00032
00033 #include <iostream>
00034 #include <string>
00035 #include <strstream>
00036
00037 extern "C" {
00038 #include "jpeglib.h"
00039 }
00040
00041 using namespace std;
00042
00043 class JPEGSource : public ImageSource
00052 {
00053 private:
00054
00055
00056 int width, height;
00057 unsigned char* image;
00058
00059 public:
00061 JPEGSource(char* jpeg_name);
00062
00063
00064
00065 virtual ImageSource& operator >> (ImageRGB&);
00066 virtual ImageSource& operator >> (ImageGrey&);
00067 virtual ImageSource& operator >> (Image&);
00068
00069 void get_size(unsigned int &w, unsigned int &h)
00070 { w = width; h = height; }
00071 int get_height(){ return height;}
00072
00073 private:
00074
00075 void loadJPEG(char* filename);
00076 };
00077
00078
00079 #endif // JPEG_SOURCE_H