rs_advanced_mode.hpp
Go to the documentation of this file.
1 /* License: Apache 2.0. See LICENSE file in root directory.
2  Copyright(c) 2017 Intel Corporation. All Rights Reserved. */
3 
4 #ifndef R4XX_ADVANCED_MODE_HPP
5 #define R4XX_ADVANCED_MODE_HPP
6 
7 #include <cmath>
8 #include "rs.hpp"
9 #include "rs_advanced_mode.h"
11 
12 namespace rs400
13 {
15  {
16  public:
19  {
20  rs2_error* e = nullptr;
22  {
23  _dev = nullptr;
24  }
26  }
27 
29  {
30  rs2_error* e = nullptr;
33  }
34 
35  bool is_enabled() const
36  {
37  rs2_error* e = nullptr;
38  int enabled=0;
39  rs2_is_enabled(_dev.get(), &enabled, &e);
41 
42  return !!enabled;
43  }
44 
46  {
47  rs2_error* e = nullptr;
48  rs2_set_depth_control(_dev.get(), &group, &e);
50  }
51 
53  {
54  rs2_error* e = nullptr;
58 
59  return group;
60  }
61 
62  void set_rsm(const STRsm& group)
63  {
64  rs2_error* e = nullptr;
65  rs2_set_rsm(_dev.get(), &group, &e);
67  }
68 
69  STRsm get_rsm(int mode = 0) const
70  {
71  rs2_error* e = nullptr;
72  STRsm group{};
73  rs2_get_rsm(_dev.get(), &group, mode, &e);
75 
76  return group;
77  }
78 
80  {
81  rs2_error* e = nullptr;
84  }
85 
87  {
88  rs2_error* e = nullptr;
92 
93  return group;
94  }
95 
97  {
98  rs2_error* e = nullptr;
99  rs2_set_color_control(_dev.get(), &group, &e);
101  }
102 
104  {
105  rs2_error* e = nullptr;
107  rs2_get_color_control(_dev.get(), &group, mode, &e);
109 
110  return group;
111  }
112 
114  {
115  rs2_error* e = nullptr;
118  }
119 
121  {
122  rs2_error* e = nullptr;
126 
127  return group;
128  }
129 
131  {
132  rs2_error* e = nullptr;
135  }
136 
138  {
139  rs2_error* e = nullptr;
143 
144  return group;
145  }
146 
148  {
149  rs2_error* e = nullptr;
152  }
153 
155  {
156  rs2_error* e = nullptr;
160 
161  return group;
162  }
163 
164  void set_hdad(const STHdad& group)
165  {
166  rs2_error* e = nullptr;
167  rs2_set_hdad(_dev.get(), &group, &e);
169  }
170 
171  STHdad get_hdad(int mode = 0) const
172  {
173  rs2_error* e = nullptr;
174  STHdad group{};
175  rs2_get_hdad(_dev.get(), &group, mode, &e);
177 
178  return group;
179  }
180 
182  {
183  rs2_error* e = nullptr;
186  }
187 
189  {
190  rs2_error* e = nullptr;
194 
195  return group;
196  }
197 
199  {
200  rs2_error* e = nullptr;
201  rs2_set_depth_table(_dev.get(), &group, &e);
203  }
204 
206  {
207  rs2_error* e = nullptr;
209  rs2_get_depth_table(_dev.get(), &group, mode, &e);
211 
212  return group;
213  }
214 
216  {
217  rs2_error* e = nullptr;
218  rs2_set_ae_control(_dev.get(), &group, &e);
220  }
221 
223  {
224  rs2_error* e = nullptr;
225  STAEControl group{};
226  rs2_get_ae_control(_dev.get(), &group, mode, &e);
228 
229  return group;
230  }
231 
233  {
234  rs2_error* e = nullptr;
235  rs2_set_census(_dev.get(), &group, &e);
237  }
238 
240  {
241  rs2_error* e = nullptr;
243  rs2_get_census(_dev.get(), &group, mode, &e);
245 
246  return group;
247  }
248 
250  {
251  rs2_error* e = nullptr;
252  rs2_set_amp_factor(_dev.get(), &group, &e);
254  }
255 
257  {
258  rs2_error* e = nullptr;
259  STAFactor group{};
260  rs2_get_amp_factor(_dev.get(), &group, mode, &e);
262 
263  return group;
264  }
265  };
266 }
267 
268 inline std::ostream & operator << (std::ostream & o, rs2_rs400_visual_preset preset) { return o << rs2_rs400_visual_preset_to_string(preset); }
269 
271 {
272  return (a.plusIncrement == b.plusIncrement &&
275  a.scoreThreshA == b.scoreThreshA &&
276  a.scoreThreshB == b.scoreThreshB &&
282 }
283 
284 inline bool operator==(const STRsm& a, const STRsm& b)
285 {
286  return (a.rsmBypass == b.rsmBypass &&
287  a.diffThresh == b.diffThresh &&
289  a.removeThresh == b.removeThresh);
290 }
291 
293 {
294  return (a.minWest == b.minWest &&
295  a.minEast == b.minEast &&
296  a.minWEsum == b.minWEsum &&
297  a.minNorth == b.minNorth &&
298  a.minSouth == b.minSouth &&
299  a.minNSsum == b.minNSsum &&
300  a.uShrink == b.uShrink &&
301  a.vShrink == b.vShrink);
302 }
303 
304 inline bool operator==(const STColorControl& a, const STColorControl& b)
305 {
306  return (a.disableSADColor == b.disableSADColor &&
311 }
312 
314 {
315  return (a.rauDiffThresholdRed == b.rauDiffThresholdRed &&
318 }
319 
321 {
322  return (a.diffThresholdRed == b.diffThresholdRed &&
325 }
326 
328 {
329  return (a.sloK1Penalty == b.sloK1Penalty &&
330  a.sloK2Penalty == b.sloK2Penalty &&
335 }
336 
337 inline bool operator==(const STHdad& a, const STHdad& b)
338 {
339  return (a.lambdaCensus == b.lambdaCensus &&
340  a.lambdaAD == b.lambdaAD &&
341  a.ignoreSAD == b.ignoreSAD);
342 }
343 
344 inline bool operator==(const STColorCorrection& a, const STColorCorrection& b)
345 {
346  return (a.colorCorrection1 == b.colorCorrection1 &&
358 }
359 
360 inline bool operator==(const STAEControl& a, const STAEControl& b)
361 {
363 }
364 
366 {
367  return (a.depthUnits == b.depthUnits &&
368  a.depthClampMin == b.depthClampMin &&
369  a.depthClampMax == b.depthClampMax &&
370  a.disparityMode == b.disparityMode &&
372 }
373 
374 inline bool operator==(const STCensusRadius& a, const STCensusRadius& b)
375 {
376  return (a.uDiameter == b.uDiameter &&
377  a.vDiameter == b.vDiameter);
378 }
379 
380 inline bool operator==(const STAFactor& a, const STAFactor& b)
381 {
382  return (fabs(a.amplitude - b.amplitude) < std::numeric_limits<float>::epsilon());
383 }
384 
385 
386 #endif // R4XX_ADVANCED_MODE_HPP
void set_color_control(const STColorControl &group)
void set_slo_color_thresholds_control(const STSloColorThresholdsControl &group)
void rs2_set_depth_table(rs2_device *dev, const STDepthTableControl *group, rs2_error **error)
void rs2_set_hdad(rs2_device *dev, const STHdad *group, rs2_error **error)
GLboolean GLboolean GLboolean b
void rs2_toggle_advanced_mode(rs2_device *dev, int enable, rs2_error **error)
void rs2_get_depth_control(rs2_device *dev, STDepthControlGroup *group, int mode, rs2_error **error)
void rs2_set_depth_control(rs2_device *dev, const STDepthControlGroup *group, rs2_error **error)
void rs2_set_rau_support_vector_control(rs2_device *dev, const STRauSupportVectorControl *group, rs2_error **error)
void set_slo_penalty_control(const STSloPenaltyControl &group)
void rs2_get_rau_support_vector_control(rs2_device *dev, STRauSupportVectorControl *group, int mode, rs2_error **error)
STAEControl get_ae_control(int mode=0) const
void set_ae_control(const STAEControl &group)
void set_census(const STCensusRadius &group)
STColorControl get_color_control(int mode=0) const
Definition: cah-model.h:10
d
Definition: rmse.py:171
void rs2_is_enabled(rs2_device *dev, int *enabled, rs2_error **error)
e
Definition: rmse.py:177
void rs2_get_rau_thresholds_control(rs2_device *dev, STRauColorThresholdsControl *group, int mode, rs2_error **error)
void rs2_set_color_control(rs2_device *dev, const STColorControl *group, rs2_error **error)
GLboolean GLboolean GLboolean GLboolean a
void set_depth_control(const STDepthControlGroup &group)
advanced_mode(rs2::device d)
void rs2_set_ae_control(rs2_device *dev, const STAEControl *group, rs2_error **error)
void rs2_get_hdad(rs2_device *dev, STHdad *group, int mode, rs2_error **error)
void rs2_set_slo_color_thresholds_control(rs2_device *dev, const STSloColorThresholdsControl *group, rs2_error **error)
void rs2_get_amp_factor(rs2_device *dev, STAFactor *group, int mode, rs2_error **error)
void rs2_get_color_control(rs2_device *dev, STColorControl *group, int mode, rs2_error **error)
GLenum mode
void set_depth_table(const STDepthTableControl &group)
STDepthControlGroup get_depth_control(int mode=0) const
void rs2_set_amp_factor(rs2_device *dev, const STAFactor *group, rs2_error **error)
STCensusRadius get_census(int mode=0) const
void rs2_get_census(rs2_device *dev, STCensusRadius *group, int mode, rs2_error **error)
void set_rau_thresholds_control(const STRauColorThresholdsControl &group)
int rs2_is_device_extendable_to(const rs2_device *device, rs2_extension extension, rs2_error **error)
Definition: rs.cpp:1425
GLboolean GLuint group
Definition: glext.h:5688
uint32_t removeThresh
std::shared_ptr< rs2_device > _dev
Definition: rs_device.hpp:146
void rs2_get_depth_table(rs2_device *dev, STDepthTableControl *group, int mode, rs2_error **error)
GLenum GLenum GLsizei const GLuint GLboolean enabled
void toggle_advanced_mode(bool enable)
STHdad get_hdad(int mode=0) const
static void handle(rs2_error *e)
Definition: rs_types.hpp:144
void rs2_get_ae_control(rs2_device *dev, STAEControl *group, int mode, rs2_error **error)
bool operator==(const STDepthControlGroup &a, const STDepthControlGroup &b)
void set_hdad(const STHdad &group)
STAFactor get_amp_factor(int mode=0) const
STSloColorThresholdsControl get_slo_color_thresholds_control(int mode=0) const
STColorCorrection get_color_correction(int mode=0) const
void rs2_set_rsm(rs2_device *dev, const STRsm *group, rs2_error **error)
STRauColorThresholdsControl get_rau_thresholds_control(int mode=0) const
GLboolean enable
Definition: glext.h:5688
void set_rau_support_vector_control(const STRauSupportVectorControl &group)
void rs2_set_census(rs2_device *dev, const STCensusRadius *group, rs2_error **error)
rs2_rs400_visual_preset
For RS400 devices: provides optimized settings (presets) for specific types of usage.
Definition: rs_option.h:137
void set_color_correction(const STColorCorrection &group)
void rs2_set_color_correction(rs2_device *dev, const STColorCorrection *group, rs2_error **error)
void rs2_get_slo_penalty_control(rs2_device *dev, STSloPenaltyControl *group, int mode, rs2_error **error)
void rs2_get_slo_color_thresholds_control(rs2_device *dev, STSloColorThresholdsControl *group, int mode, rs2_error **error)
void rs2_get_rsm(rs2_device *dev, STRsm *group, int mode, rs2_error **error)
std::ostream & operator<<(std::ostream &o, rs2_rs400_visual_preset preset)
void set_rsm(const STRsm &group)
uint32_t rsmBypass
const char * rs2_rs400_visual_preset_to_string(rs2_rs400_visual_preset preset)
void rs2_set_rau_thresholds_control(rs2_device *dev, const STRauColorThresholdsControl *group, rs2_error **error)
STSloPenaltyControl get_slo_penalty_control(int mode=0) const
void set_amp_factor(const STAFactor &group)
STDepthTableControl get_depth_table(int mode=0) const
void rs2_set_slo_penalty_control(rs2_device *dev, const STSloPenaltyControl *group, rs2_error **error)
void rs2_get_color_correction(rs2_device *dev, STColorCorrection *group, int mode, rs2_error **error)
STRsm get_rsm(int mode=0) const
STRauSupportVectorControl get_rau_support_vector_control(int mode=0) const


librealsense2
Author(s): Sergey Dorodnicov , Doron Hirshberg , Mark Horn , Reagan Lopez , Itay Carpis
autogenerated on Mon May 3 2021 02:47:40