00001 /*********************************************************/ 00021 #ifndef CVIMAGESOURCE_H 00022 #define CVIMAGESOURCE_H 00023 00024 #include "cv.h" 00025 #include "highgui.h" 00026 #include "ImageSource.h" 00027 00031 class CVImageSource : public ImageSource 00032 { 00033 public: 00034 CVImageSource(); 00035 virtual ~CVImageSource(); 00036 00042 virtual IplImage* getNextImage(); 00043 00044 protected: 00045 CvCapture* capture; 00046 private: 00047 IplImage* copy; 00048 }; 00049 00053 class CVCameraSource : public CVImageSource 00054 { 00055 public: 00056 CVCameraSource(); 00057 virtual ~CVCameraSource(); 00058 00059 const char* getDescription() const; 00060 00067 int getNumberOfImages() const { return -1; }; 00068 00075 bool hasNextImage() { return true; }; 00076 }; 00077 00078 00082 class CVVideoSource : public CVImageSource 00083 { 00084 public: 00085 00091 CVVideoSource(const char* fileName); 00092 virtual ~CVVideoSource(); 00093 00094 const char* getDescription() const; 00095 00101 int getNumberOfImages() const; 00102 bool hasNextImage(); 00103 }; 00104 00105 #endif // !CVIMAGESOURCE_H