My Project
CapturePluginCmu.h
Go to the documentation of this file.
1 /*
2  * This file is part of ALVAR, A Library for Virtual and Augmented Reality.
3  *
4  * Copyright 2007-2012 VTT Technical Research Centre of Finland
5  *
6  * Contact: VTT Augmented Reality Team <alvar.info@vtt.fi>
7  * <http://www.vtt.fi/multimedia/alvar.html>
8  *
9  * ALVAR is free software; you can redistribute it and/or modify it under the
10  * terms of the GNU Lesser General Public License as published by the Free
11  * Software Foundation; either version 2.1 of the License, or (at your option)
12  * any later version.
13  *
14  * This library is distributed in the hope that it will be useful, but WITHOUT
15  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
17  * for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public License
20  * along with ALVAR; if not, see
21  * <http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html>.
22  */
23 
24 #ifndef CAPTUREPLUGINCMU_H
25 #define CAPTUREPLUGINCMU_H
26 
33 #ifdef WIN32
34 # ifdef ALVAR_Capture_Plugin_CMU_BUILD
35 # define ALVAR_CAPTURE_PLUGIN_CMU_EXPORT __declspec(dllexport)
36 # else
37 # define ALVAR_CAPTURE_PLUGIN_CMU_EXPORT __declspec(dllimport)
38 # endif
39 #else
40 # define ALVAR_CAPTURE_PLUGIN_CMU_EXPORT
41 #endif
42 
43 #include "1394camera.h"
44 #include "Capture.h"
45 #include "CapturePlugin.h"
46 
47 namespace alvar {
48 
52 namespace plugins {
53 
57 class ALVAR_CAPTURE_PLUGIN_CMU_EXPORT CaptureCmu : public alvar::Capture
58 {
59 public:
65  CaptureCmu(const CaptureDevice captureDevice);
70  bool start();
71  void stop();
72  cv::Mat captureImage();
74  std::string SerializeId();
75  bool Serialize(Serialization *serialization);
76 
77 private:
78  C1394Camera *mCamera;
79  int mChannels;
80  cv::Mat mReturnFrame;
81 };
82 
86 class ALVAR_CAPTURE_PLUGIN_CMU_EXPORT CapturePluginCmu : public alvar::CapturePlugin
87 {
88 public:
94  CapturePluginCmu(const std::string &captureType);
100  Capture * createCapture(const CaptureDevice captureDevice);
101 };
102 
103 extern "C" ALVAR_CAPTURE_PLUGIN_CMU_EXPORT void
104 registerPlugin(const std::string &captureType, alvar::CapturePlugin *&capturePlugin);
105 
106 } // namespace plugins
107 } // namespace alvar
108 
109 #endif
This file implements a capture interface.
This file implements a capture plugin interface.
CaptureDevice holder for camera information.
Definition: CaptureDevice.h:45
Capture interface that plugins must implement.
Definition: Capture.h:47
CapturePlugin interface that plugins must implement.
Definition: CapturePlugin.h:45
std::vector< CaptureDevice > CaptureDeviceVector
Vector of CaptureDevices.
Definition: CapturePlugin.h:59
Class for serializing class content to/from file or std::iostream.
Definition: Util.h:371
Implementation of Capture interface for Cmu plugin.
bool Serialize(Serialization *serialization)
Performs serialization of the class members and configuration.
cv::Mat captureImage()
Capture one image from the camera.
void stop()
Stops the camera capture.
bool start()
Starts the camera capture.
bool showSettingsDialog()
Show the settings dialog of the camera.
CaptureCmu(const CaptureDevice captureDevice)
Constructor.
std::string SerializeId()
The identification of the class for serialization.
Implementation of CapturePlugin interface for Cmu plugin.
CapturePluginCmu(const std::string &captureType)
Constructor.
Capture * createCapture(const CaptureDevice captureDevice)
Create Capture class. Transfers onwership to the caller.
CaptureDeviceVector enumerateDevices()
Enumerate capture devices currently available.
Main ALVAR namespace.
Definition: Alvar.h:174