00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00020 #ifndef CMpeg2Reader_h
00021 #define CMpeg2Reader_h
00022
00023
00024 #include <CReader.h>
00025 #include <CMotion2DVideo_Mpeg2.h>
00026
00027 #if defined (WIN32)
00028 # if defined MOTION2D_DLL_EXPORTS
00029 # define MOTION2D_API __declspec( dllexport )
00030 # elif defined MOTION2D_DLL_IMPORTS
00031 # define MOTION2D_API __declspec( dllimport )
00032 # else
00033 # define MOTION2D_API
00034 # endif
00035 #else
00036 # define MOTION2D_API
00037 #endif
00038
00039 class MOTION2D_API CMpeg2Reader: public CReader
00040 {
00041 private:
00042 CMotion2DVideo_Mpeg2 codec;
00043 unsigned long currentFrame;
00044
00045 public:
00046 CMpeg2Reader();
00047 ~CMpeg2Reader();
00048 string getFileName();
00049 bool getFrame(CMotion2DImage<unsigned char> & I, unsigned nbsubsample,
00050 unsigned nrows=0, unsigned ncols=0);
00051 bool getFrame(CMotion2DImage<short> & I, unsigned nbsubsample,
00052 unsigned nrows=0, unsigned ncols=0);
00053 bool getFrame(unsigned char **rgbpixel, unsigned &nrows, unsigned &ncols);
00054 bool initStream();
00055 bool closeStream();
00056 bool openStream();
00057 void getType() { cout << " Mpeg2Reader"<<endl;};
00058 EReaderFormat getFormat();
00059 unsigned getNbSubsample();
00060 };
00061
00062 #endif