Time-of-Flight Library(ToF) 3.13.2
 
user_config.h
1#ifndef _CHRONOPTICS_TOF_USER_CONFIG_H_
2#define _CHRONOPTICS_TOF_USER_CONFIG_H_
3
4#include <chronoptics/tof/camera_config.h>
5#include <chronoptics/tof/camera.h>
6#include <chronoptics/tof/processing_config.h>
7
8#ifdef __cplusplus
9extern "C" {
10#endif
11
12/** The integration time as fixed presets
13 */
14enum tof_integration_time {
15 TOF_INTEGRATION_TIME_SHORT = 0, /** 250 us */
16 TOF_INTEGRATION_TIME_MEDIUM = 1, /** 500 us */
17 TOF_INTEGRATION_TIME_LONG = 2, /** 1000us */
18};
19
20/** The different imaging environments
21 */
22enum tof_imaging_environment {
23 TOF_IMAGING_ENVIRONMENT_INSIDE = 0, /** Inside buildings */
24 TOF_IMAGING_ENVIRONMENT_SUNLIGHT = 1, /** When bright sunlight is present */
25};
26
27/** The optimization of the camera configuration
28 */
29enum tof_strategy {
30 TOF_STRATEGY_BALANCED = 0, /** The balanced configuration */
31 TOF_STRATEGY_SPEED = 1, /** Optimize for moving objects */
32 TOF_STRATEGY_ACCURACY = 2, /** Optimize for high accuracy */
33};
34
35/** Optimized configurations for different use cases
36 */
37enum tof_config_mode {
38 TOF_CONFIG_MODE_LONG_RANGE_DYNAMIC_SCENE = 1, /** Suitable for most applications */
39 TOF_CONFIG_MODE_MEDIUM_RANGE_DYNAMIC_SCENE = 2, /** For fast moving applications */
40 TOF_CONFIG_MODE_MEDIUM_RANGE_BALANCED = 3, /** Balanced between range, speed and accuracy */
41 TOF_CONFIG_MODE_SHORT_RANGE_HIGH_SPEED = 4, /** Maximum speed mode for short range and fast moving applications */
42 TOF_CONFIG_MODE_LONG_RANGE_HIGH_RESOLUTION = 5, /** Full resolution long range */
43 TOF_CONFIG_MODE_MEDIUM_RANGE_STATIC_SCENE = 6, /** Full resolution for slow changing scene */
44 TOF_CONFIG_MODE_FAR_OUT_STATIC_SCENE = 7, /** Full resolution for slow changing scene */
45};
46
47/** DEPRECATED, use config_mode. Simple interface for camera configuration
48 * generation
49 */
50typedef struct tof_user_config* tof_user_config_t;
51
52/** Destruct tof_user_config */
53TOF_EXPORT void tof_user_config_delete(tof_user_config_t ptr);
54
55/** Create default user config
56 * @param ptr Pointer to class
57 * @param error Pointer to error
58 * @return New object
59 */
60TOF_EXPORT tof_user_config_t tof_user_config_new_default(tof_error_t *error);
61
62/** Convert to a camera configuration
63 * @param ptr Pointer to class
64 * @param camera The camera
65 * @param error Pointer to error
66 * @return The camera configuration
67 */
68TOF_EXPORT tof_camera_config_t tof_user_config_to_camera_config(const tof_user_config_t ptr, tof_camera_t camera, tof_error_t *error);
69
70/** Get the camera operating environment
71 * @param ptr Pointer to class
72 * @param error Pointer to error
73 * @return Imaging environment
74 */
75TOF_EXPORT enum tof_imaging_environment tof_user_config_get_environment(const tof_user_config_t ptr, tof_error_t *error);
76
77/** Set the camera operating environment
78 * @param ptr Pointer to class
79 * @param imaging_environment Imaging environment
80 * @param error Pointer to error
81 */
82TOF_EXPORT void tof_user_config_set_environment(tof_user_config_t ptr, enum tof_imaging_environment imaging_environment, tof_error_t *error);
83
84/** Get the maximum distance photons reflect from
85 * @param ptr Pointer to class
86 * @param error Pointer to error
87 * @return Maximum distance in meters
88 */
89TOF_EXPORT float tof_user_config_get_max_distance(const tof_user_config_t ptr, tof_error_t *error);
90
91/** Set the maximum distance photons reflect from
92 * @param ptr Pointer to class
93 * @param max_distance Maximum distance in meters
94 * @param error Pointer to error
95 */
96TOF_EXPORT void tof_user_config_set_max_distance(tof_user_config_t ptr, float max_distance, tof_error_t *error);
97
98/** Get the depth frame rate
99 * @param ptr Pointer to class
100 * @param error Pointer to error
101 * @return The depth fps
102 */
103TOF_EXPORT float tof_user_config_get_fps(const tof_user_config_t ptr, tof_error_t *error);
104
105/** Set the depth frame rate
106 * @param ptr Pointer to class
107 * @param fps The depth fps
108 * @param error Pointer to error
109 */
110TOF_EXPORT void tof_user_config_set_fps(tof_user_config_t ptr, float fps, tof_error_t *error);
111
112/** Get if lens flare is expected in the scene
113 * @param ptr Pointer to class
114 * @param error Pointer to error
115 * @return if lens flare is present
116 */
117TOF_EXPORT bool tof_user_config_get_lens_flare(const tof_user_config_t ptr, tof_error_t *error);
118
119/** Set if lens flare is expected in the scene
120 * @param ptr Pointer to class
121 * @param lens_flare if lens flare is present
122 * @param error Pointer to error
123 */
124TOF_EXPORT void tof_user_config_set_lens_flare(tof_user_config_t ptr, bool lens_flare, tof_error_t *error);
125
126/** Get if there are translucent objects in the scene
127 * @param ptr Pointer to class
128 * @param error Pointer to error
129 * @return If translucent objects
130 */
131TOF_EXPORT bool tof_user_config_get_translucent(const tof_user_config_t ptr, tof_error_t *error);
132
133/** Set if there are translucent objects in the scene
134 * @param ptr Pointer to class
135 * @param translucent If translucent objects
136 * @param error Pointer to error
137 */
138TOF_EXPORT void tof_user_config_set_translucent(tof_user_config_t ptr, bool translucent, tof_error_t *error);
139
140/** Get high dynamic range enabled. Enable this when pixel saturation occurs.
141 * This will only happen for retroreflectors or reflective objects close (<20cm)
142 * to the camera
143 * @param ptr Pointer to class
144 * @param error Pointer to error
145 * @return Enable high dynamic range
146 */
147TOF_EXPORT bool tof_user_config_get_hdr(const tof_user_config_t ptr, tof_error_t *error);
148
149/** Set high dynamic range enabled. Enable this when pixel saturation occurs.
150 * This will only happen for retroreflectors or reflective objects close (<20cm)
151 * to the camera
152 * @param ptr Pointer to class
153 * @param hdr Enable high dynamic range
154 * @param error Pointer to error
155 */
156TOF_EXPORT void tof_user_config_set_hdr(tof_user_config_t ptr, bool hdr, tof_error_t *error);
157
158/** Get the integration time
159 * @param ptr Pointer to class
160 * @param error Pointer to error
161 * @return The integration time
162 */
163TOF_EXPORT enum tof_integration_time tof_user_config_get_integration_time(const tof_user_config_t ptr, tof_error_t *error);
164
165/** Set the integration time
166 * @param ptr Pointer to class
167 * @param int_time The integration time
168 * @param error Pointer to error
169 */
170TOF_EXPORT void tof_user_config_set_integration_time(tof_user_config_t ptr, enum tof_integration_time int_time, tof_error_t *error);
171
172/** Get what the configuration is being optimized for
173 * @param ptr Pointer to class
174 * @param error Pointer to error
175 * @return The user configuration strategy
176 */
177TOF_EXPORT enum tof_strategy tof_user_config_get_strategy(const tof_user_config_t ptr, tof_error_t *error);
178
179/** Set what the configuration is being optimized for
180 * @param ptr Pointer to class
181 * @param strategy The user configuration strategy
182 * @param error Pointer to error
183 */
184TOF_EXPORT void tof_user_config_set_strategy(tof_user_config_t ptr, enum tof_strategy strategy, tof_error_t *error);
185
186/** Get The camera channel, increment to support multi-camera usage
187 * @param ptr Pointer to class
188 * @param error Pointer to error
189 * @return The channel number, set to 0, otherwise increment with number of
190 * cameras.
191 */
192TOF_EXPORT int32_t tof_user_config_get_channel(const tof_user_config_t ptr, tof_error_t *error);
193
194/** Set The camera channel, increment to support multi-camera usage
195 * @param ptr Pointer to class
196 * @param channel The channel number, set to 0, otherwise increment with number
197 * of cameras.
198 * @param error Pointer to error
199 */
200TOF_EXPORT void tof_user_config_set_channel(tof_user_config_t ptr, int32_t channel, tof_error_t *error);
201
202/** Get the camera config associated with the config mode
203 * @param camera Camera
204 * @param config_mode Config mode
205 * @param error Pointer to error
206 * @return Camera Config
207 */
208TOF_EXPORT tof_camera_config_t tof_config_mode_camera_config(tof_camera_t camera, enum tof_config_mode config_mode, tof_error_t *error);
209
210/** Get the processing config associated with the config mode
211 * @param camera Camera
212 * @param config_mode Config mode
213 * @param error Pointer to error
214 * @return Processing Config
215 */
216TOF_EXPORT tof_processing_config_t tof_config_mode_processing_config(tof_camera_t camera, enum tof_config_mode config_mode, tof_error_t *error);
217
218/** Check whether hdr is possible with current camera config
219 * @param config The camera config to check
220 * @param error Pointer to error
221 * @return Whether hdr is possible
222 */
223TOF_EXPORT bool tof_hdr_possible(tof_camera_config_t config, tof_error_t *error);
224
225/** Check whether phase unwrap is possible with current camera config
226 * @param config The camera config to check
227 * @param error Pointer to error
228 * @return Whether phase unwrap is possible
229 */
230TOF_EXPORT bool tof_phase_unwrap_possible(tof_camera_config_t config, tof_error_t *error);
231
232/** Generate processing config based on camera configuration and calibration.
233 * @param camera A camera
234 * @param error Pointer to error
235 */
236TOF_EXPORT void tof_apply_default_processing_config(tof_camera_t camera, tof_error_t *error);
237
238#ifdef __cplusplus
239}
240#endif
241
242#endif