Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members   Related Pages  

JPEGSource.h

Go to the documentation of this file.
00001 /*************************************************************************
00008  *
00009  * Source code for Real Time Image Library (libRTImage) 
00010  *
00011  * Leeds Vision Group give permission for this code to be copied, modified 
00012  * and distributed within the University of Leeds subject to the following
00013  * conditions:-
00014  *
00015  * - The code is not to be used for commercial gain.
00016  * - The code and use thereof will be attributed to the authors where
00017  *   appropriate (including demonstrations which rely on it's use).
00018  * - All modified, distributions of the source files will retain this header.
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 /* Private Members */
00055 
00056     int width, height;  
00057     unsigned char* image;
00058 
00059 public:
00061     JPEGSource(char* jpeg_name);
00062 
00063     /* Extraction operators */
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 /* private functions */
00075     void loadJPEG(char* filename);
00076 };
00077 
00078 
00079 #endif  // JPEG_SOURCE_H

Generated at Fri Aug 13 17:29:21 2004 for libRTImage by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001