Project

General

Profile

BitmapToolkit Scol plugin
ICameraInput.h
Go to the documentation of this file.
1/*
2-----------------------------------------------------------------------------
3This source file is part of OpenSpace3D
4For the latest info, see http://www.openspace3d.com
5
6Copyright (c) 2012 I-maginer
7
8This program is free software; you can redistribute it and/or modify it under
9the terms of the GNU Lesser General Public License as published by the Free Software
10Foundation; either version 2 of the License, or (at your option) any later
11version.
12
13This program is distributed in the hope that it will be useful, but WITHOUT
14ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
16
17You should have received a copy of the GNU Lesser General Public License along with
18this program; if not, write to the Free Software Foundation, Inc., 59 Temple
19Place - Suite 330, Boston, MA 02111-1307, USA, or go to
20http://www.gnu.org/copyleft/lesser.txt
21
22-----------------------------------------------------------------------------
23*/
24
25#ifndef __BTK_ICAMERAINPUT_H__
26#define __BTK_ICAMERAINPUT_H__
27
28#include "Prerequisites.h"
29
30#ifdef _WIN32
31 #include <videoInput.h>
32#endif
33
34#include <cassert>
35
40
41 // Static methods
42 public:
43 static std::vector<std::string> GetDevicesList();
44 static void SetCameraInputsState(bool state); // true : on, false : off
45
46 // Static members
47 protected:
48 static std::list<ICameraInput*> cameraInputsList;
49
50 protected:
51 int mIndex;
53 cv::Size mBufferSize;
54
55 public:
56 ICameraInput(int index);
57 virtual ~ICameraInput();
58
59 // Pure virtual methods
60 virtual bool Initialize() = 0;
61 virtual void Close() = 0;
62 virtual bool IsOpened() = 0;
63 virtual cv::Mat UpdateImage() = 0;
64 virtual int GetWidth() = 0;
65 virtual int GetHeight() = 0;
66 virtual void SetSize(int width, int height) = 0;
67
68 // Virtual methods
69 virtual bool TakeSnapshot(std::string path); // Store current frame to a file
70 virtual void RenderToScreen();
71 virtual bool SetFocusPoint(int x, int y);
72 virtual void SetTorchState(bool state);
73
74 // Common methods
75 bool GetMirrorMode();
76 void SetMirrorMode(bool mode);
77};
78
79#endif
Interface for camera management. Concrete classes are written for Windows, Android and OpenCV native ...
bool GetMirrorMode()
void SetMirrorMode(bool mode)
static std::list< ICameraInput * > cameraInputsList
virtual void SetSize(int width, int height)=0
virtual bool TakeSnapshot(std::string path)
virtual bool IsOpened()=0
cv::Size mBufferSize
virtual bool Initialize()=0
virtual int GetHeight()=0
virtual int GetWidth()=0
virtual cv::Mat UpdateImage()=0
static void SetCameraInputsState(bool state)
virtual bool SetFocusPoint(int x, int y)
static std::vector< std::string > GetDevicesList()
virtual void SetTorchState(bool state)
virtual void Close()=0
virtual ~ICameraInput()
virtual void RenderToScreen()