00001 /* 00002 * This file is part of ALVAR, A Library for Virtual and Augmented Reality. 00003 * 00004 * Copyright 2007-2012 VTT Technical Research Centre of Finland 00005 * 00006 * Contact: VTT Augmented Reality Team <alvar.info@vtt.fi> 00007 * <http://www.vtt.fi/multimedia/alvar.html> 00008 * 00009 * ALVAR is free software; you can redistribute it and/or modify it under the 00010 * terms of the GNU Lesser General Public License as published by the Free 00011 * Software Foundation; either version 2.1 of the License, or (at your option) 00012 * any later version. 00013 * 00014 * This library is distributed in the hope that it will be useful, but WITHOUT 00015 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00016 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License 00017 * for more details. 00018 * 00019 * You should have received a copy of the GNU Lesser General Public License 00020 * along with ALVAR; if not, see 00021 * <http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html>. 00022 */ 00023 00024 #ifndef CAPTUREPLUGINHIGHGUI_H 00025 #define CAPTUREPLUGINHIGHGUI_H 00026 00033 #ifdef WIN32 00034 #ifdef ALVAR_Capture_Plugin_Highgui_BUILD 00035 #define ALVAR_CAPTURE_PLUGIN_HIGHGUI_EXPORT __declspec(dllexport) 00036 #else 00037 #define ALVAR_CAPTURE_PLUGIN_HIGHGUI_EXPORT __declspec(dllimport) 00038 #endif 00039 #else 00040 #define ALVAR_CAPTURE_PLUGIN_HIGHGUI_EXPORT 00041 #endif 00042 00043 #include "Capture.h" 00044 #include "CapturePlugin.h" 00045 00046 #include "highgui.h" 00047 00048 namespace alvar { 00049 00053 namespace plugins { 00054 00058 class ALVAR_CAPTURE_PLUGIN_HIGHGUI_EXPORT CaptureHighgui 00059 : public alvar::Capture 00060 { 00061 public: 00067 CaptureHighgui(const CaptureDevice captureDevice); 00071 ~CaptureHighgui(); 00072 void setResolution(const unsigned long xResolution, const unsigned long yResolution); 00073 bool start(); 00074 void stop(); 00075 IplImage *captureImage(); 00076 bool showSettingsDialog(); 00077 std::string SerializeId(); 00078 bool Serialize(Serialization *serialization); 00079 private: 00080 cv::VideoCapture mVideoCapture; 00081 cv::Mat mMatrix; 00082 IplImage mImage; 00083 }; 00084 00088 class ALVAR_CAPTURE_PLUGIN_HIGHGUI_EXPORT CapturePluginHighgui 00089 : public alvar::CapturePlugin 00090 { 00091 public: 00097 CapturePluginHighgui(const std::string &captureType); 00101 ~CapturePluginHighgui(); 00102 CaptureDeviceVector enumerateDevices(); 00103 Capture *createCapture(const CaptureDevice captureDevice); 00104 }; 00105 00106 extern "C" ALVAR_CAPTURE_PLUGIN_HIGHGUI_EXPORT void registerPlugin(const std::string &captureType, alvar::CapturePlugin *&capturePlugin); 00107 00108 } // namespace plugins 00109 } // namespace alvar 00110 00111 #endif