Intel® RealSense™ Cross Platform API
Intel Realsense Cross-platform API
ds5-options.h
Go to the documentation of this file.
1 // License: Apache 2.0. See LICENSE file in root directory.
2 // Copyright(c) 2015 Intel Corporation. All Rights Reserved.
3 
4 #pragma once
5 
6 #include "ds5-private.h"
7 
8 #include "algo.h"
9 #include "error-handling.h"
10 
11 namespace librealsense
12 {
13  class emitter_option : public uvc_xu_option<uint8_t>
14  {
15  public:
16  const char* get_value_description(float val) const override;
17  explicit emitter_option(uvc_sensor& ep);
18  };
19 
21  {
22  public:
23  float query() const override;
24 
25  option_range get_range() const override;
26 
27  bool is_enabled() const override;
28 
29  const char* get_description() const override;
30 
32 
33  private:
34  uvc_sensor& _ep;
35  rs2_option _option;
36  };
37 
39  {
40  public:
41  float query() const override;
42 
43  option_range get_range() const override;
44 
45  bool is_enabled() const override;
46 
47  const char* get_description() const override;
48 
50 
51  private:
52  const std::string custom_sensor_name = "custom";
53  const std::string report_name = "data-field-custom-value_2";
54  hid_sensor& _ep;
55  };
56 
58  {
59  public:
60  void set(float value) override;
61 
62  float query() const override;
63 
64  bool is_enabled() const override { return true; }
65 
66  const char* get_description() const override
67  {
68  return "Enable/Disable Automatic Motion Data Correction";
69  }
70 
72  const ds::imu_intrinsics& accel,
73  const ds::imu_intrinsics& gyro,
74  const option_range& opt_range);
75 
76  private:
77  std::atomic<bool> _is_enabled;
78  ds::imu_intrinsics _accel;
79  ds::imu_intrinsics _gyro;
80  };
81 
83  {
84  public:
85  void set(float value) override;
86 
87  float query() const override;
88 
89  bool is_enabled() const override { return true; }
90 
91  const char* get_description() const override
92  {
93  return "Enable/disable auto-exposure";
94  }
95 
97  std::shared_ptr<auto_exposure_mechanism> auto_exposure,
98  std::shared_ptr<auto_exposure_state> auto_exposure_state,
99  const option_range& opt_range);
100 
101  private:
102  std::shared_ptr<auto_exposure_state> _auto_exposure_state;
103  std::atomic<bool> _to_add_frames;
104  std::shared_ptr<auto_exposure_mechanism> _auto_exposure;
105  };
106 
108  {
109  public:
110  auto_exposure_mode_option(std::shared_ptr<auto_exposure_mechanism> auto_exposure,
111  std::shared_ptr<auto_exposure_state> auto_exposure_state,
112  const option_range& opt_range,
113  const std::map<float, std::string>& description_per_value);
114 
115  void set(float value) override;
116 
117  float query() const override;
118 
119  bool is_enabled() const override { return true; }
120 
121  const char* get_description() const override
122  {
123  return "Auto-Exposure Mode";
124  }
125 
126  const char* get_value_description(float val) const override;
127 
128  private:
129  const std::map<float, std::string> _description_per_value;
130  std::shared_ptr<auto_exposure_state> _auto_exposure_state;
131  std::shared_ptr<auto_exposure_mechanism> _auto_exposure;
132  };
133 
135  {
136  public:
137  auto_exposure_step_option(std::shared_ptr<auto_exposure_mechanism> auto_exposure,
138  std::shared_ptr<auto_exposure_state> auto_exposure_state,
139  const option_range& opt_range);
140 
141  void set(float value) override;
142 
143  float query() const override;
144 
145  bool is_enabled() const override { return true; }
146 
147  const char* get_description() const override
148  {
149  return "Auto-Exposure converge step";
150  }
151 
152  private:
153  std::shared_ptr<auto_exposure_state> _auto_exposure_state;
154  std::shared_ptr<auto_exposure_mechanism> _auto_exposure;
155  };
156 
158  {
159  public:
160  auto_exposure_antiflicker_rate_option(std::shared_ptr<auto_exposure_mechanism> auto_exposure,
161  std::shared_ptr<auto_exposure_state> auto_exposure_state,
162  const option_range& opt_range,
163  const std::map<float, std::string>& description_per_value);
164 
165  void set(float value) override;
166 
167  float query() const override;
168 
169  bool is_enabled() const override { return true; }
170 
171  const char* get_description() const override
172  {
173  return "Auto-Exposure anti-flicker";
174  }
175 
176  const char* get_value_description(float val) const override;
177 
178  private:
179  const std::map<float, std::string> _description_per_value;
180  std::shared_ptr<auto_exposure_state> _auto_exposure_state;
181  std::shared_ptr<auto_exposure_mechanism> _auto_exposure;
182  };
183 
184  class depth_scale_option : public option
185  {
186  public:
188  virtual ~depth_scale_option() = default;
189  virtual void set(float value) override;
190  virtual float query() const override;
191  virtual option_range get_range() const override;
192  virtual bool is_enabled() const override { return true; }
193 
194  const char* get_description() const override
195  {
196  return "Number of meters represented by a single depth unit";
197  }
198  void enable_recording(std::function<void(const option &)> record_action)
199  {
200  _record_action = record_action;
201  }
202  private:
203  ds::depth_table_control get_depth_table(ds::advanced_query_mode mode) const;
204  std::function<void(const option &)> _record_action = [](const option&) {};
205  lazy<option_range> _range;
206  hw_monitor& _hwm;
207  };
208 }
Definition: backend.h:378
Definition: hw-monitor.h:98
rs2_option
Defines general configuration controls. These can generally be mapped to camera UVC controls...
Definition: rs_option.h:22
option_range get_range() const override
Definition: option.h:219
Definition: options.h:20
Definition: types.h:269
const char * get_value_description(float val) const override
Definition: option.h:19
advanced_query_mode
Definition: ds5-private.h:105
const char * get_description() const override
Definition: ds5-options.h:121
bool is_enabled() const override
Definition: ds5-options.h:64
float query() const override
Definition: option.h:206
const char * get_description() const override
Definition: ds5-options.h:66
const char * get_description() const override
Definition: ds5-options.h:194
Definition: ds5-options.h:184
bool is_enabled() const override
Definition: ds5-options.h:89
Definition: algo.h:16
Definition: ds5-private.h:199
bool is_enabled() const override
Definition: ds5-options.h:145
void enable_recording(std::function< void(const option &)> record_action)
Definition: ds5-options.h:198
Definition: option.h:64
uvc_sensor & _ep
Definition: option.h:254
virtual bool is_enabled() const override
Definition: ds5-options.h:192
const char * get_description() const override
Definition: ds5-options.h:91
Definition: ds5-options.h:57
const char * get_description() const override
Definition: ds5-options.h:171
Definition: options.h:12
Definition: option.h:191
Definition: ds5-options.h:134
emitter_option(uvc_sensor &ep)
bool is_enabled() const override
Definition: ds5-options.h:119
const char * get_description() const override
Definition: option.h:245
bool is_enabled() const override
Definition: ds5-options.h:169
bool is_enabled() const override
Definition: option.h:239
Definition: sensor.h:122
Definition: ds5-options.h:13
Definition: sensor.h:31
Definition: ds5-options.h:82
constexpr uint32_t auto_exposure
Definition: ros_file_format.h:624
const char * get_description() const override
Definition: ds5-options.h:147
Definition: sensor.h:174
Definition: ds5-private.h:282
Definition: ds5-options.h:107