PARP Research Group University of Murcia, Spain


src/qvio/qvcameraworker.h

Go to the documentation of this file.
00001 /*
00002  *      Copyright (C) 2007, 2008. PARP Research Group.
00003  *      <http://perception.inf.um.es>
00004  *      University of Murcia, Spain.
00005  *
00006  *      This file is part of the QVision library.
00007  *
00008  *      QVision is free software: you can redistribute it and/or modify
00009  *      it under the terms of the GNU Lesser General Public License as
00010  *      published by the Free Software Foundation, version 3 of the License.
00011  *
00012  *      QVision is distributed in the hope that it will be useful,
00013  *      but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  *      GNU Lesser General Public License for more details.
00016  *
00017  *      You should have received a copy of the GNU Lesser General Public
00018  *      License along with QVision. If not, see <http://www.gnu.org/licenses/>.
00019  */
00020 
00024 
00025 #ifndef QVCAMERAWORKER_H
00026 #define QVCAMERAWORKER_H
00027 
00028 #include <QVWorker>
00029 #include <QVImage>
00030 
00081 class QVCameraWorker: public QVWorker
00082         {
00083         Q_OBJECT
00084         public:
00088                 QVCameraWorker(QString name = QString(""));
00089 
00091                 ~QVCameraWorker();
00092 
00103                 bool linkUnspecifiedOutputProperty(QVPropertyContainer *dstCont, QString dstProp);
00104 
00117                 bool linkUnspecifiedOutputProperty(QVPropertyContainer *dstCont, QString dstProp1, QString dstProp2, QString dstProp3);
00118 
00119         protected:
00120                 bool realTime, noLoop;
00121 
00134                 virtual bool openCam(QString urlName, int &cols, int &rows, int &fps) = 0;
00135 
00139                 virtual void closeCam() = 0;
00140 
00150                 virtual bool grab(QVImage<uChar,1> &imgY, QVImage<uChar,1> &imgU, QVImage<uChar,1> &imgV) = 0;
00151 
00152         private:
00153                 bool newGrabbedFrame,flush_pending_images;
00154                 QString urlName;
00155                 QVImage<uChar,1> imageY, imageU, imageV;
00156 
00157                 void tryOpeningCam();
00158                 void resetCameraWorker();
00159                 void iterate();
00160                 void processTrigger(QString str);
00161 
00162         private slots:
00163                 void grabFrame();
00164         };
00165 
00166 #endif



QVision framework. PARP research group, copyright 2007, 2008.