MarsSDK
MarsSDK.h
Go to the documentation of this file.
1 
6 #pragma once
7 
8 #if _WIN32
9 # define EXPORT __declspec(dllexport)
10 #else
11 # define EXPORT __attribute__((visibility("default")))
12 #endif
13 
14 #include <libTof.h>
15 
19 class EXPORT Stream
20 {
21 protected:
25  CLibTof* camera;
26 
30  int width;
31 
35  int height;
36 
40  int size;
41 
42 public:
47  int getWidth();
48 
53  int getHeight();
54 
59  int getSize();
60 };
61 
65 class EXPORT DepthStream : public Stream
66 {
67  friend class Mars;
68 private:
73  DepthStream(CLibTof* _camera);
74 
79  FrameData_t* depthFrame;
80 
85  FrameDataRgb_t* colorFrame;
86 
90  unsigned short* irFrame;
91 
96  //unsigned char* pseudoColor;
97 
98 public:
102  ~DepthStream();
103 
108  int update();
109 
117  //int updatePseudoColor(float _min, float _max);
118 
124  FrameData_t* getFrame();
125 
131  FrameDataRgb_t* getColorFrame();
132 
138  unsigned short* getIrFrame();
139 
145  //unsigned char* getPseudoColorFrame();
146 };
147 
151 class EXPORT ColorStream : public Stream
152 {
153  friend class Mars;
154 private:
159  ColorStream(CLibTof* _camera);
160 
165  short* frame;
166 
167 public:
171  ~ColorStream();
172 
177  int update();
178 
184  short* getFrame();
185 };
186 
190 class EXPORT Mars
191 {
192 private:
196  CLibTof* camera;
197 
201  DeviceInfo_t* deviceInfo;
202 
207 
212 
213 public:
217  Mars();
218 
222  ~Mars();
223 
228  int connect();
229 
234  int disconnect();
235 
240  DepthStream* getDepthStream();
241 
246  ColorStream* getColorStream();
247 
252  int closeDepthStream();
253 
258  int closeColorStream();
259 
264  unsigned int getDeviceVersion();
265 
270  unsigned int getDeviceType();
271 
276  char* getDeviceId();
277 
282  char* getDriverVersion();
283 
290  int getTemp(float *_cpu, float *_sensor);
291 
298  int setCameraMode(int _mode);
299 
306  int setFps(int _fps);
307 
314  int setExposure(int _exposure);
315 
322  //int setIrExposure(int _exposure);
323 
329  int setImageRegistration(bool _status);
330 };
FrameData_t * depthFrame
Depth frame buffer. Has elements (float) x, y, and z.
Definition: MarsSDK.h:79
Parent class used for image streams from the camera.
Definition: MarsSDK.h:19
unsigned short * irFrame
Infrared frame buffer.
Definition: MarsSDK.h:90
Sunny Mars device.
Definition: MarsSDK.h:190
int width
Stream's width, in pixels.
Definition: MarsSDK.h:30
DeviceInfo_t * deviceInfo
Structure containing all the device-specific information, retrieved from the Sunny Mars API.
Definition: MarsSDK.h:201
ColorStream * colorStream
Instance of ColorStream within MarsSDK.
Definition: MarsSDK.h:211
int height
Stream's height, in pixels.
Definition: MarsSDK.h:35
CLibTof * camera
Instance of camera in external Sunny Mars API.
Definition: MarsSDK.h:25
Color image stream from the camera.
Definition: MarsSDK.h:151
Depth image stream from the camera.
Definition: MarsSDK.h:65
CLibTof * camera
Instance of camera in external Sunny Mars API.
Definition: MarsSDK.h:196
DepthStream * depthStream
Instance of DepthStream within MarsSDK.
Definition: MarsSDK.h:206
FrameDataRgb_t * colorFrame
Depth frame color from image registration. Has elements (unsigned char) r, g, and b.
Definition: MarsSDK.h:85
int size
Stream's size, in pixels.
Definition: MarsSDK.h:40
short * frame
Color frame buffer In YUV420 format.
Definition: MarsSDK.h:165