Vista     Main Page   Class List   Function List   File List   Examples  


CWriter.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 CWriter_h
 00021 #define CWriter_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 CWriter
 00060 {
 00061 
 00062  protected:
 00063   unsigned long frame;
 00064   string streamName;
 00065 
 00066  public:
 00072   enum EWriterFormat {
 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   };
 00082 
 00083   CWriter();
 00084   virtual ~CWriter() { };
 00085 
 00086   void setFileName(const char *filename);
 00087   void setFileName(string filename);
 00088   bool setFrameNumber(unsigned long framenumber);
 00094   virtual EWriterFormat getFormat() {return FORMAT_NOT_RECOGNIZED;};
 00100   virtual string getFileName() {return "No filename";};
 00106   virtual bool writeFrame(CMotion2DImage<unsigned char> & I)
 00107   {
 00108     cout <<" Writer "<<endl;
 00109     return false;
 00110   };
 00116   virtual bool writeFrame(CMotion2DImage<short> & I)
 00117   {
 00118     cout <<" Writer "<<endl;
 00119     return false;
 00120   };
 00126   virtual bool openStream() {return true;};
 00132   virtual bool closeStream() {return true;};
 00138   virtual void getType() {
 00139     cout << " Writer"<<endl;
 00140   };
 00141 
 00142 };
 00143 
 00144 
 00145 #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