Astra SDK  v2.1.3
DeviceController.hpp
1 // This file is part of the Orbbec Astra SDK [https://orbbec3d.com]
2 // Copyright (c) 2015-2017 Orbbec 3D
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 // Be excellent to each other.
17 #ifndef ASTRA_DEVICECONTROLLER_HPP
18 #define ASTRA_DEVICECONTROLLER_HPP
19 
20 #include <string>
21 #include <astra_core/astra_core.hpp>
22 #include "astra/capi/astra_device_control.h"
23 #include <stdexcept>
24 
25 
26 namespace astra {
35  {
36  public:
37  DeviceController(StreamSet& set): set_(set){}
38 
39  void set_ir_gain_value(int32_t value)
40  {
41  astra_set_ir_gain_value(set_.get_handle(), value);
42  }
43 
44  int32_t get_ir_gain_value()
45  {
46  int32_t value;
47  astra_get_ir_gain_value(set_.get_handle(), &value);
48  return value;
49  }
50 
51  void set_ir_exposure_value(int32_t value)
52  {
53  astra_set_ir_exposure_value(set_.get_handle(), value);
54  }
55 
56  int32_t get_ir_exposure_value()
57  {
58  int32_t value;
59  astra_get_ir_exposure_value(set_.get_handle(), &value);
60  return value;
61  }
62 
63  void enable_ldp(bool enable)
64  {
65  astra_ldp_enable(set_.get_handle(), enable);
66  }
67 
68  void enable_laser(bool enable)
69  {
70  astra_laser_enable(set_.get_handle(), enable);
71  }
72 
73  void enable_fan(bool enable)
74  {
75  astra_fan_enable(set_.get_handle(), enable);
76  }
77 
78  bool fan_status()
79  {
80  int32_t value;
81  astra_fan_status(set_.get_handle(), &value);
82  return value;
83  }
84 
85  void enable_fan_flash(bool enable)
86  {
87  astra_fan_flash_enable(set_.get_handle(), enable);
88  }
89 
90  bool fan_flash_status()
91  {
92  int32_t value;
93  astra_fan_flash_status(set_.get_handle(), &value);
94  return value;
95  }
96 
101  void enable_distortion(int status)
102  {
103  astra_distortion_enable(set_.get_handle(), status);
104  }
105 
106  void get_orbbec_camera_params(orbbec_camera_params& params)
107  {
108  astra_get_orbbec_camera_params(set_.get_handle(), &params);
109  }
110 
111  private:
112  StreamSet set_;
113  };
114 }
115 #endif //ASTRA_DEVICECONTROLLER_HPP
Device Controller Class
Definition: DeviceController.hpp:35
void enable_distortion(int status)
Definition: DeviceController.hpp:101
Stream Set Class
Definition: StreamSet.hpp:36
ASTRA_API_EX astra_status_t astra_distortion_enable(astra_streamsetconnection_t connect, int32_t status)
Definition: astra_device_control.h:35