UtiLite  0.3.1
A lite utilities library
cv/include/utilite/UImageEvent.h
00001 /*
00002 *  utilite is a cross-platform library with
00003 *  useful utilities for fast and small developing.
00004 *  Copyright (C) 2010  Mathieu Labbe
00005 *
00006 *  utilite is free library: you can redistribute it and/or modify
00007 *  it under the terms of the GNU Lesser General Public License as published by
00008 *  the Free Software Foundation, either version 3 of the License, or
00009 *  (at your option) any later version.
00010 *
00011 *  utilite is distributed in the hope that it will be useful,
00012 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014 *  GNU Lesser General Public License for more details.
00015 *
00016 *  You should have received a copy of the GNU Lesser General Public License
00017 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
00018 */
00019 
00020 #ifndef UIMAGEEVENT_H_
00021 #define UIMAGEEVENT_H_
00022 
00023 #include <opencv2/core/core.hpp>
00024 #include <utilite/UEvent.h>
00025 
00029 class UImageEvent :
00030         public UEvent
00031 {
00032 public:
00033         enum Code {
00034                 kCodeImage,
00035                 kCodeNoMoreImages
00036         };
00037 
00038 public:
00039         UImageEvent(const cv::Mat & image, int cameraId = 0) :
00040                 UEvent(kCodeImage),
00041                 _cameraId(cameraId),
00042                 _image(image)
00043         {
00044         }
00045         UImageEvent(int cameraId = 0) :
00046                 UEvent(kCodeNoMoreImages),
00047                 _cameraId(cameraId)
00048         {
00049         }
00050 
00051         int cameraId() const {return _cameraId;}
00052 
00053         // Image or descriptors
00054         const cv::Mat & image() const {return _image;}
00055 
00056         virtual ~UImageEvent() {}
00057         virtual std::string getClassName() const {return std::string("UImageEvent");}
00058 
00059 private:
00060         int _cameraId;
00061         cv::Mat _image;
00062 };
00063 
00064 #endif /* UIMAGEEVENT_H_ */
 All Classes Files Functions Variables Enumerations Friends Defines