Vista     Main Page   Class List   Function List   File List   Examples  


CReader.h

Go to the documentation of this file.
00001 /*
00002 
00003   Copyright (c) 1995-2005 by INRIA.
00004   All Rights Reserved.
00005 
00006   This software was developed at:
00007   IRISA/INRIA Rennes
00008   Campus Universitaire de Beaulieu
00009   35042 Rennes Cedex
00010 
00011   http://www.irisa.fr
00012 
00013 */
00014 
00020 #ifndef CReader_h
00021 #define CReader_h
00022 
00023 #include <string>
00024 #include <CMotion2DImage.h>
00025 
00026 #if defined (WIN32)
00027 #  if defined MOTION2D_DLL_EXPORTS
00028 #     define MOTION2D_API __declspec( dllexport )
00029 #  elif defined MOTION2D_DLL_IMPORTS
00030 #     define MOTION2D_API __declspec( dllimport )
00031 #  else
00032 #     define MOTION2D_API
00033 #  endif
00034 #else
00035 #     define MOTION2D_API
00036 #endif
00037 
00038 
00039 // Supported image format
00040 #ifndef __NO_IMAGEIO_PNG_
00041 #  define _PNG  "PNG"
00042 #  define _png  "png"
00043 #endif
00044 #define _PGM   "PGM"
00045 #define _pgm   "pgm"
00046 #define _PPM   "PPM"
00047 #define _ppm   "ppm"
00048 #define _RAW8  "RAW8"
00049 #define _raw8  "raw8"
00050 #define _RAW16 "RAW16"
00051 #define _raw16 "raw16"
00052 
00053 #define _mpeg "mpeg"
00054 #define _mpg  "mpg"
00055 
00056 
00057 using namespace std;
00058 
00059 class MOTION2D_API CReader
00060 {
00061  protected:
00062   unsigned long frame;
00063   string streamName;
00064   unsigned nbsubsample;
00065 
00066  public:
00072   enum EReaderFormat {
00073     FORMAT_NOT_RECOGNIZED, 
00074     FORMAT_PGM,            
00075     FORMAT_PPM,            
00076     FORMAT_RAW8,           
00077     FORMAT_RAW16,          
00078 #ifndef __NO_IMAGEIO_PNG_
00079     FORMAT_PNG,            
00080 #endif
00081     FORMAT_MPEG2           
00082   };
00083 
00084   CReader();
00085 
00091   virtual ~CReader() { };
00092 
00093   void setFileName(const char *filename);
00094   void setFileName(string filename);
00095   bool setFrameNumber(unsigned long framenumber);
00101   virtual EReaderFormat getFormat() {return FORMAT_NOT_RECOGNIZED;};
00102 
00108   virtual string getFileName() {return "No filename";};
00109 
00115   virtual bool getFrame(CMotion2DImage<unsigned char> & I,
00116                         unsigned nbsubsample=0,
00117                         unsigned nrows=0, unsigned ncols=0)
00118   {
00119     cout <<" Reader "<<endl;
00120     return false;
00121   };
00122 
00128   virtual bool getFrame(CMotion2DImage<short> & I,
00129                         unsigned nbsubsample=0,
00130                         unsigned nrows=0, unsigned ncols=0)
00131   {
00132     cout <<" Reader "<<endl;
00133     return false;
00134   };
00135 
00141   virtual bool openStream() {return true;};
00147   virtual bool closeStream() {return true;};
00153   virtual void getType() {
00154     cout << " Reader"<<endl;
00155   };
00156 
00163   virtual unsigned getNbSubsample() {return 0;};
00164 };
00165 
00166 
00167 #endif

Motion2D is Copyright © 1995-2005 by Inria
This documentation was generated on 31 Jan 2005 by Fabien Spindler for Motion2D 1.3.11 using doxygen1.2.18 written by Dimitri van Heesch, © 1997-2005