00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00024
00025 #ifndef QVOPENCVREADER_H
00026 #define QVOPENCVREADER_H
00027
00028 #include <opencv/cv.h>
00029 #include <opencv/highgui.h>
00030
00031 #include <QVBaseReader>
00032
00033 class QVOpenCVReader : public QVBaseReader
00034 {
00035 public:
00036 QVOpenCVReader() : QVBaseReader() { video_capture = 0; };
00037
00038 ~QVOpenCVReader() { this->close(); };
00039
00040 private:
00041 cv::VideoCapture *video_capture;
00042 int total_frames;
00043 bool noLoop,isCamera,isFile;
00044
00045 protected:
00046 bool open(const QString & url_string,
00047 unsigned int & suggested_cols, unsigned int & suggested_rows,
00048 unsigned int & suggested_fps, QVVideoReader::OpenOptions & suggested_opts,
00049 QVVideoReader::TSourceMode & source_mode);
00050 bool close();
00051 bool grab(QVImage<uChar,1> &imgR, QVImage<uChar,1> &imgG, QVImage<uChar,1> &imgB);
00052 int getLength();
00053 int getPos();
00054 bool seek(int pos);
00055 };
00056
00057 #endif // QVOPENCVREADER_H