Simulated Reality SDK 7500c78d v1.30.2.51085 2024-04-26T11:23:03Z
Stable
cameracontroller.h
Go to the documentation of this file.
1
10#pragma once
11
12#include <mutex>
13
16
17#ifdef WIN32
18# ifdef COMPILING_DLL_SimulatedRealityCameras
19# define DIMENCOSR_API __declspec(dllexport)
20# else
21# define DIMENCOSR_API __declspec(dllimport)
22# endif
23#else
24# define DIMENCOSR_API
25#endif
26
27namespace SR {
28
37public:
43 CameraControllerUnavailableException(std::string identifier);
44};
45
46//forward declaration
48
53
61DIMENCOSR_API std::map<std::string, CameraControlFunction*>& cameraControlFunctions();
62
69public:
76 static void addImplementation(CameraControlFunction* controlFunction, std::string cameraType);
77
86
95 virtual void setShuttertime(float shutterTime) = 0;
96
105 virtual void setGain(float gain) = 0;
106
115 virtual float getShuttertime() = 0;
116
126 virtual float getGain() = 0;
127};
128
140#pragma warning(suppress: 4251)
141 static std::map<std::string, std::mutex> mutex;
142
143 Camera::Descriptor descriptor;
144 CameraController* controller;
145
146 UniqueCameraController(const UniqueCameraController&) = delete; // non construction-copyable
147 UniqueCameraController& operator=(const UniqueCameraController&) = delete; // non copyable
148
149public:
150 UniqueCameraController(UniqueCameraController && other) : descriptor(other.descriptor), controller(other.controller){};
152
157
164
169
170 // Inherited via CameraController
171 virtual void setShuttertime(float shutterTime);
172 virtual void setGain(float gain);
173 virtual float getShuttertime();
174 virtual float getGain();
175};
176
177}
178
179#undef DIMENCOSR_API
#define DIMENCOSR_API
Definition: cameracontroller.h:24
Class of Exception which indicates the CameraController can not be used at this point in time.
Definition: cameracontroller.h:36
CameraControllerUnavailableException(std::string identifier)
Construct a new CameraControllerUnavailableException.
Interface defining camera functions to control sensor parameters.
Definition: cameracontroller.h:68
virtual float getShuttertime()=0
Get current shutter / exposure time in seconds.
virtual float getGain()=0
Get current camera gain factor.
virtual void setShuttertime(float shutterTime)=0
Set camera shutter / exposure time in seconds.
static UniqueCameraController control(Camera *camera)
Attempt to gain control of camera sensor.
static void addImplementation(CameraControlFunction *controlFunction, std::string cameraType)
Static function to make a CameraController implementation available through the CameraController::con...
virtual void setGain(float gain)=0
Set camera gain.
Class describing a physical camera.
Definition: camera.h:77
Class of Sense dealing with video data.
Definition: camera.h:71
Class of exception which indicates a general SR logic error.
Definition: exception.h:40
Non-copyable class of CameraController interface that can only be constructed once per Camera (Camera...
Definition: cameracontroller.h:134
UniqueCameraController & operator=(UniqueCameraController &&other)
virtual void setGain(float gain)
Set camera gain.
UniqueCameraController(UniqueCameraController &&other)
Definition: cameracontroller.h:150
UniqueCameraController(Camera *camera, CameraController *controller)
Construct instance of UniqueCameraController of that can only be created for a specific Camera if ano...
virtual float getShuttertime()
Get current shutter / exposure time in seconds.
~UniqueCameraController()
Destructs UniqueCameraController instance and allow a new one to be acquired.
virtual void setShuttertime(float shutterTime)
Set camera shutter / exposure time in seconds.
virtual float getGain()
Get current camera gain factor.
UniqueCameraController()
Construct UniqueCameraController to reserve memory.
Namespace containing all C++ Simulated Reality classes.
Definition: srconfiguration.h:25
DIMENCOSR_API std::map< std::string, CameraControlFunction * > & cameraControlFunctions()
Map of camera type to functions to create cameras of that type.
UniqueCameraController() CameraControlFunction(Camera *)
Type of function used for gaining control of camera sensor parameters.
Definition: cameracontroller.h:52