SLProject  4.3.020
A platform independent 3D computer graphics framework for desktop OS, Android, iOS and online in web browsers
SENSARBaseCamera.h
Go to the documentation of this file.
1 /**
2  * \file SENSARBaseCamera.h
3  * \authors Michael Goettlicher, Marcus Hudritsch
4  * \date Winter 2021
5  * \remarks Please use clangformat to format the code. See more code style on
6  * https://github.com/cpvrlab/SLProject4/wiki/SLProject-Coding-Style
7  * \copyright http://opensource.org/licenses/GPL-3.0
8 */
9 
10 #ifndef SENS_ARBASECAMERA_H
11 #define SENS_ARBASECAMERA_H
12 
13 #include <mutex>
14 #include <atomic>
15 #include <vector>
16 #include <thread>
17 #include <Utils.h>
18 #include <opencv2/opencv.hpp>
19 #include <SENS.h>
20 #include <SENSFrame.h>
21 #include <SENSCalibration.h>
22 #include <SENSCamera.h>
23 
24 //-----------------------------------------------------------------------------
25 /// Provides interface for the AR frameworks such as ARKit and ARCore
27 {
28 public:
30  virtual ~SENSARBaseCamera() {}
31  virtual bool init(unsigned int textureId = 0,
32  bool retrieveCpuImg = false,
33  int targetWidth = -1) = 0;
34  virtual bool isReady() = 0;
35  virtual bool resume() = 0;
36  virtual void reset() = 0;
37  virtual void pause() = 0;
38 
39  /*! Returns true if in tracking state. If correctly initialized, it will
40  update the camera frame that may be retrieved with latestFrame() */
41  virtual bool update(cv::Mat& view) { return false; }
42  virtual void lightComponentIntensity(float* components) {}
43 
44  virtual bool isInstalled() { return false; };
45  virtual bool isAvailable() { return false; };
46  virtual bool install() { return false; };
47  virtual bool installRefused() { return false; };
48  virtual void installRefused(bool b){};
49  bool isRunning() { return !_pause; }
50 
51  void fetchPointCloud(bool s) { _fetchPointCloud = s; }
52  cv::Mat pointCloud() { return _pointCloud; }
53  cv::Size inputFrameSize() { return cv::Size(_inputFrameW, _inputFrameH); }
54  cv::Size cpuFrameSize() { return cv::Size(_cpuImgTargetWidth, _cpuImgTargetHeight); }
55 
56 protected:
57  bool _running = false;
58  bool _pause = true;
59  int _inputFrameW = 0;
60  int _inputFrameH = 0;
61  bool _retrieveCpuImg = false;
64  bool _fetchPointCloud = false;
65  cv::Mat _pointCloud;
66 };
67 //-----------------------------------------------------------------------------
68 #endif
SLScene * s
Definition: SLScene.h:31
Provides interface for the AR frameworks such as ARKit and ARCore.
virtual ~SENSARBaseCamera()
cv::Size inputFrameSize()
virtual bool update(cv::Mat &view)
cv::Size cpuFrameSize()
virtual void pause()=0
virtual bool isInstalled()
virtual bool init(unsigned int textureId=0, bool retrieveCpuImg=false, int targetWidth=-1)=0
virtual bool resume()=0
void fetchPointCloud(bool s)
virtual void installRefused(bool b)
virtual void reset()=0
virtual bool isAvailable()
virtual bool isReady()=0
virtual bool installRefused()
virtual bool install()
virtual void lightComponentIntensity(float *components)
Implementation of common functionality and members.
Definition: SENSCamera.h:197
The SLScene class represents the top level instance holding the scene structure.
Definition: SLScene.h:47