BitmapToolkit Scol plugin
include
CameraInput.h
Go to the documentation of this file.
1
/*
2
-----------------------------------------------------------------------------
3
This source file is part of OpenSpace3D
4
For the latest info, see http://www.openspace3d.com
5
6
Copyright (c) 2012 I-maginer
7
8
This program is free software; you can redistribute it and/or modify it under
9
the terms of the GNU Lesser General Public License as published by the Free Software
10
Foundation; either version 2 of the License, or (at your option) any later
11
version.
12
13
This program is distributed in the hope that it will be useful, but WITHOUT
14
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15
FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
16
17
You should have received a copy of the GNU Lesser General Public License along with
18
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
19
Place - Suite 330, Boston, MA 02111-1307, USA, or go to
20
http://www.gnu.org/copyleft/lesser.txt
21
22
-----------------------------------------------------------------------------
23
*/
24
25
#ifndef __BTK_CAMERAINPUT_H__
26
#define __BTK_CAMERAINPUT_H__
27
28
#include "
prerequisites.h
"
29
30
#ifdef _WIN32
31
#include <videoInput.h>
32
#endif
33
34
#include <vector>
35
#include <opencv2/opencv.hpp>
36
#include <cassert>
37
38
class
CameraInput
{
39
40
public
:
41
static
std::vector<std::string>
GetDevicesList
();
42
static
void
SetCameraInputsState
(
bool
state);
43
44
protected
:
45
static
std::list<CameraInput*>
cameraInputsList
;
46
47
private
:
48
49
#ifdef _WIN32
50
videoInput* mVI;
51
#else
52
cv::VideoCapture* mVI;
53
#endif
54
int
mIndex;
55
56
std::vector<unsigned char> mBuffer;
57
bool
mMirrorMode;
58
cv::Size mBufferSize;
59
public
:
60
CameraInput
(
int
index);
61
~CameraInput
();
62
63
bool
Initialize
();
64
void
Close
();
65
bool
IsOpened
();
66
cv::Mat
UpdateImage
();
67
68
int
GetWidth
();
69
int
GetHeight
();
70
void
SetSize
(
int
width,
int
height);
71
bool
GetMirrorMode
();
72
void
SetMirrorMode
(
bool
mode);
73
74
// Capture a snapshot of current camera frame and store it to "path"
75
bool
TakeSnapshot
(std::string path);
76
77
// Render current frame to screen using android stuff
78
void
RenderToScreen
();
79
80
protected
:
81
82
private
:
83
CameraInput
();
84
85
};
86
87
#endif
Prerequisites.h
CameraInput
Definition
CameraInput.h:38
CameraInput::GetDevicesList
static std::vector< std::string > GetDevicesList()
Definition
CameraInput.cpp:261
CameraInput::Close
void Close()
Definition
CameraInput.cpp:123
CameraInput::~CameraInput
~CameraInput()
Definition
CameraInput.cpp:132
CameraInput::UpdateImage
cv::Mat UpdateImage()
Definition
CameraInput.cpp:153
CameraInput::SetSize
void SetSize(int width, int height)
Definition
CameraInput.cpp:209
CameraInput::GetHeight
int GetHeight()
Definition
CameraInput.cpp:195
CameraInput::IsOpened
bool IsOpened()
Definition
CameraInput.cpp:144
CameraInput::GetWidth
int GetWidth()
Definition
CameraInput.cpp:181
CameraInput::SetMirrorMode
void SetMirrorMode(bool mode)
Definition
CameraInput.cpp:256
CameraInput::cameraInputsList
static std::list< CameraInput * > cameraInputsList
Definition
CameraInput.h:45
CameraInput::SetCameraInputsState
static void SetCameraInputsState(bool state)
Definition
CameraInput.cpp:455
CameraInput::GetMirrorMode
bool GetMirrorMode()
Definition
CameraInput.cpp:251
CameraInput::TakeSnapshot
bool TakeSnapshot(std::string path)
Definition
CameraInput.cpp:371
CameraInput::RenderToScreen
void RenderToScreen()
Definition
CameraInput.cpp:398
CameraInput::Initialize
bool Initialize()
Definition
CameraInput.cpp:88
Generated by
1.9.8