2 Copyright (C) 2012 Intel Corporation
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public
6 License as published by the Free Software Foundation; either
7 version 2.1 of the License, or (at your option) any later version.
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Lesser General Public License for more details.
14 You should have received a copy of the GNU Lesser General Public
15 License along with this library; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 #ifndef OPENCVLUXPLUGIN_H
20 #define OPENCVLUXPLUGIN_H
22 #include <abstractsource.h>
25 #include <opencv/cv.h>
26 #include <opencv2/highgui/highgui.hpp>
32 class OpenCvLuxPlugin: public QObject, public AbstractSource
39 cv::VideoCapture *m_capture;
40 PropertyList mRequests;
41 OpenCvLuxPlugin* parent;
52 OpenCvLuxPlugin(AbstractRoutingEngine* re, map<string, string> config);
55 void getPropertyAsync(AsyncPropertyReply *reply);
56 void getRangePropertyAsync(AsyncRangePropertyReply *reply);
57 AsyncPropertyReply * setProperty(AsyncSetPropertyRequest request);
58 void subscribeToPropertyChanges(VehicleProperty::Property property);
59 void unsubscribeToPropertyChanges(VehicleProperty::Property property);
60 PropertyList supported();
62 int supportedOperations();
64 void supportedChanged(PropertyList) {}
66 void updateProperty(uint lux);
78 std::list<AsyncPropertyReply*> replyQueue;
83 static int grabImage(void *data);
84 static uint evalImage(cv::Mat qImg, OpenCvLuxPlugin::Shared *shared);
86 namespace TrafficLight
97 TrafficLight::Color detectLight(cv::Mat img, OpenCvLuxPlugin::Shared* shared);
99 #endif // EXAMPLEPLUGIN_H