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 CAPTUREPLUGINFILE_H 00025 #define CAPTUREPLUGINFILE_H 00026 00033 #ifdef WIN32 00034 #ifdef ALVAR_Capture_Plugin_File_BUILD 00035 #define ALVAR_CAPTURE_PLUGIN_FILE_EXPORT __declspec(dllexport) 00036 #else 00037 #define ALVAR_CAPTURE_PLUGIN_FILE_EXPORT __declspec(dllimport) 00038 #endif 00039 #else 00040 #define ALVAR_CAPTURE_PLUGIN_FILE_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_FILE_EXPORT CaptureFile 00059 : public alvar::Capture 00060 { 00061 public: 00067 CaptureFile(const CaptureDevice captureDevice); 00071 ~CaptureFile(); 00072 bool start(); 00073 void stop(); 00074 IplImage *captureImage(); 00075 bool showSettingsDialog(); 00076 std::string SerializeId(); 00077 bool Serialize(Serialization *serialization); 00078 private: 00079 cv::VideoCapture mVideoCapture; 00080 cv::Mat mMatrix; 00081 IplImage mImage; 00082 }; 00083 00087 class ALVAR_CAPTURE_PLUGIN_FILE_EXPORT CapturePluginFile 00088 : public alvar::CapturePlugin 00089 { 00090 public: 00096 CapturePluginFile(const std::string &captureType); 00100 ~CapturePluginFile(); 00101 CaptureDeviceVector enumerateDevices(); 00102 Capture *createCapture(const CaptureDevice captureDevice); 00103 }; 00104 00105 extern "C" ALVAR_CAPTURE_PLUGIN_FILE_EXPORT void registerPlugin(const std::string &captureType, alvar::CapturePlugin *&capturePlugin); 00106 00107 } // namespace plugins 00108 } // namespace alvar 00109 00110 #endif