-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathClariusApi.h
58 lines (46 loc) · 1.54 KB
/
ClariusApi.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#include <ImFusion/Core/Mat.h>
#include <functional>
#include <memory>
namespace ImFusion
{
class IMURawMetadata;
template <typename T>
class TypedImage;
class ClariusApi
{
public:
virtual bool init() = 0;
virtual bool connect(const char* ipAddress, unsigned int port) = 0;
virtual void disconnect() = 0;
virtual void destroy() = 0;
virtual bool start() { return true; }
virtual bool loadCertificate(const std::string& path) = 0;
/// Set gain in percentage (range 0-100)
virtual bool setGain(double gain) = 0;
/// Set depth in millimeters
virtual bool setDepth(double depth) = 0;
/// Set resolution (width, height)
virtual bool setResolution(vec2i resolution) = 0;
std::function<void(std::unique_ptr<TypedImage<unsigned char>>&& frame, unsigned long long timestamp, std::unique_ptr<IMURawMetadata>&& imu)>
imageCallback = {};
std::function<void(double depth, double width)> measuresCallback = {};
std::function<void(bool frozen)> freezeCallback = {};
std::function<void(int btn, int clicks)> buttonCallback = {};
};
class ClariusCastApi : public ClariusApi
{
public:
static ClariusCastApi* get();
bool init() override;
bool connect(const char* ipAddress, unsigned int port) override;
void disconnect() override;
void destroy() override;
bool loadCertificate(const std::string& path) override;
bool setGain(double gain) override;
bool setDepth(double depth) override;
bool setResolution(vec2i resolution) override;
private:
ClariusCastApi();
static ClariusCastApi* m_singletonCastApiInstance;
};
}