MarsSDK
MarsSDK.h
Go to the documentation of this file.
1 
6 #pragma once
7 
8 #if _WIN32
9 # define EXPORT __declspec(dllexport)
10 # define IMPORT __declspec(dllimport)
11 #else
12 # define EXPORT __attribute__((visibility("default")))
13 # define IMPORT __attribute__((visibility("default")))
14 #endif
15 
16 #if defined(COMPILING_DLL)
17 # define DLL_FUNCTION EXPORT
18 #else
19 # define DLL_FUNCTION IMPORT
20 #endif
21 
22 #include <libTof.h>
23 
27 class DLL_FUNCTION Stream
28 {
29 protected:
33  CLibTof* camera;
34 
38  int width;
39 
43  int height;
44 
48  int size;
49 
50 public:
55  int getWidth();
56 
61  int getHeight();
62 
67  int getSize();
68 };
69 
73 class DLL_FUNCTION DepthStream : public Stream
74 {
75  friend class Mars;
76 private:
81  DepthStream(CLibTof* _camera);
82 
87  float* depthFrame;
88 
93  unsigned char* colorFrame;
94 
99  unsigned short* irFrame;
100 
105  //unsigned char* pseudoColor;
106 
107 public:
111  ~DepthStream();
112 
117  int update();
118 
126  //int updatePseudoColor(float _min, float _max);
127 
133  float* getFrame();
134 
140  unsigned char* getColorFrame();
141 
147  unsigned short* getIrFrame();
148 
154  //unsigned char* getPseudoColorFrame();
155 };
156 
160 class DLL_FUNCTION ColorStream : public Stream
161 {
162  friend class Mars;
163 private:
168  ColorStream(CLibTof* _camera);
169 
174  short* frame;
175 
176 public:
180  ~ColorStream();
181 
186  int update();
187 
193  short* getFrame();
194 };
195 
199 class DLL_FUNCTION Mars
200 {
201 private:
205  CLibTof* camera;
206 
210  DeviceInfo_t* deviceInfo;
211 
216 
221 
222 public:
226  Mars();
227 
231  ~Mars();
232 
237  int connect();
238 
243  int disconnect();
244 
249  DepthStream* getDepthStream();
250 
255  ColorStream* getColorStream();
256 
261  int closeDepthStream();
262 
267  int closeColorStream();
268 
273  unsigned int getDeviceVersion();
274 
279  unsigned int getDeviceType();
280 
285  char* getDeviceId();
286 
291  char* getDriverVersion();
292 
299  int getTemp(float *_cpu, float *_sensor);
300 
307  int setCameraMode(int _mode);
308 
315  int setFps(int _fps);
316 
323  int setExposure(int _exposure);
324 
331  //int setIrExposure(int _exposure);
332 
338  int setImageRegistration(bool _status);
339 };
Parent class used for image streams from the camera.
Definition: MarsSDK.h:27
unsigned short * irFrame
Infrared frame buffer Each pixel is stored as 16-bit grayscale.
Definition: MarsSDK.h:99
Sunny Mars device.
Definition: MarsSDK.h:199
int width
Stream's width, in pixels.
Definition: MarsSDK.h:38
DeviceInfo_t * deviceInfo
Structure containing all the device-specific information, retrieved from the Sunny Mars API.
Definition: MarsSDK.h:210
ColorStream * colorStream
Instance of ColorStream within MarsSDK.
Definition: MarsSDK.h:220
unsigned char * colorFrame
Depth frame color from image registration. Pixel elements can be accessed as (location * 3) + color,...
Definition: MarsSDK.h:93
int height
Stream's height, in pixels.
Definition: MarsSDK.h:43
CLibTof * camera
Instance of camera in external Sunny Mars API.
Definition: MarsSDK.h:33
Color image stream from the camera.
Definition: MarsSDK.h:160
Depth image stream from the camera.
Definition: MarsSDK.h:73
CLibTof * camera
Instance of camera in external Sunny Mars API.
Definition: MarsSDK.h:205
DepthStream * depthStream
Instance of DepthStream within MarsSDK.
Definition: MarsSDK.h:215
float * depthFrame
Depth frame buffer. Pixel elements can be accessed as (location * 3) + axis, where axis is 0 = x,...
Definition: MarsSDK.h:87
int size
Stream's size, in pixels.
Definition: MarsSDK.h:48
short * frame
Color frame buffer In YUV420 format.
Definition: MarsSDK.h:174