Time-of-Flight Library(ToF)  3.2.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 
7 #ifdef __cplusplus
8 extern "C" {
9 #endif
10 
11 /** The integration time as fixed presets
12  */
13 enum tof_integration_time {
14  TOF_INTEGRATION_TIME_SHORT = 0, /** 250 us */
15  TOF_INTEGRATION_TIME_MEDIUM = 1, /** 500 us */
16  TOF_INTEGRATION_TIME_LONG = 2, /** 1000us */
17 };
18 
19 /** The different imaging environments
20  */
21 enum tof_imaging_environment {
22  TOF_IMAGING_ENVIRONMENT_INSIDE = 0, /** Inside buildings */
23  TOF_IMAGING_ENVIRONMENT_SUNLIGHT = 1, /** When bright sunlight is present */
24 };
25 
26 /** The optimization of the camera configuration
27  */
28 enum tof_strategy {
29  TOF_STRATEGY_BALANCED = 0, /** The balanced configuration */
30  TOF_STRATEGY_SPEED = 1, /** Optimize for moving objects */
31  TOF_STRATEGY_ACCURACY = 2, /** Optimize for high accuracy */
32 };
33 
34 /** Simple interface for camera configuration generation
35  */
36 typedef struct tof_user_config* tof_user_config_t;
37 
38 /** Destruct tof_user_config */
39 TOF_EXPORT void tof_user_config_delete(tof_user_config_t ptr);
40 
41 /** Create default user config
42  * @param ptr Pointer to class
43  * @param error Pointer to error
44  * @return New object
45  */
46 TOF_EXPORT tof_user_config_t tof_user_config_new_default(tof_error_t *error);
47 
48 /** Convert to a camera configuration
49  * @param ptr Pointer to class
50  * @param camera The camera
51  * @param error Pointer to error
52  * @return The camera configuration
53  */
54 TOF_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);
55 
56 /** Get the camera operating environment
57  * @param ptr Pointer to class
58  * @param error Pointer to error
59  * @return Imaging environment
60  */
61 TOF_EXPORT enum tof_imaging_environment tof_user_config_get_environment(const tof_user_config_t ptr, tof_error_t *error);
62 
63 /** Set the camera operating environment
64  * @param ptr Pointer to class
65  * @param imaging_environment Imaging environment
66  * @param error Pointer to error
67  */
68 TOF_EXPORT void tof_user_config_set_environment(tof_user_config_t ptr, enum tof_imaging_environment imaging_environment, tof_error_t *error);
69 
70 /** Get the maximum distance photons reflect from
71  * @param ptr Pointer to class
72  * @param error Pointer to error
73  * @return Maximum distance
74  */
75 TOF_EXPORT float tof_user_config_get_max_distance(const tof_user_config_t ptr, tof_error_t *error);
76 
77 /** Set the maximum distance photons reflect from
78  * @param ptr Pointer to class
79  * @param max_distance Maximum distance
80  * @param error Pointer to error
81  */
82 TOF_EXPORT void tof_user_config_set_max_distance(tof_user_config_t ptr, float max_distance, tof_error_t *error);
83 
84 /** Get the depth frame rate
85  * @param ptr Pointer to class
86  * @param error Pointer to error
87  * @return The depth fps
88  */
89 TOF_EXPORT float tof_user_config_get_fps(const tof_user_config_t ptr, tof_error_t *error);
90 
91 /** Set the depth frame rate
92  * @param ptr Pointer to class
93  * @param fps The depth fps
94  * @param error Pointer to error
95  */
96 TOF_EXPORT void tof_user_config_set_fps(tof_user_config_t ptr, float fps, tof_error_t *error);
97 
98 /** Get if lens flare is expected in the scene
99  * @param ptr Pointer to class
100  * @param error Pointer to error
101  * @return if lens flare is present
102  */
103 TOF_EXPORT bool tof_user_config_get_lens_flare(const tof_user_config_t ptr, tof_error_t *error);
104 
105 /** Set if lens flare is expected in the scene
106  * @param ptr Pointer to class
107  * @param lens_flare if lens flare is present
108  * @param error Pointer to error
109  */
110 TOF_EXPORT void tof_user_config_set_lens_flare(tof_user_config_t ptr, bool lens_flare, tof_error_t *error);
111 
112 /** Get if there are translucent objects in the scene
113  * @param ptr Pointer to class
114  * @param error Pointer to error
115  * @return If translucent objects
116  */
117 TOF_EXPORT bool tof_user_config_get_translucent(const tof_user_config_t ptr, tof_error_t *error);
118 
119 /** Set if there are translucent objects in the scene
120  * @param ptr Pointer to class
121  * @param translucent If translucent objects
122  * @param error Pointer to error
123  */
124 TOF_EXPORT void tof_user_config_set_translucent(tof_user_config_t ptr, bool translucent, tof_error_t *error);
125 
126 /** Get high dynamic range enabled. Enable this when pixel saturation occurs.
127  * This will only happen for retroreflectors or reflective objects close (<20cm)
128  * to the camera
129  * @param ptr Pointer to class
130  * @param error Pointer to error
131  * @return Enable high dynamic range
132  */
133 TOF_EXPORT bool tof_user_config_get_hdr(const tof_user_config_t ptr, tof_error_t *error);
134 
135 /** Set high dynamic range enabled. Enable this when pixel saturation occurs.
136  * This will only happen for retroreflectors or reflective objects close (<20cm)
137  * to the camera
138  * @param ptr Pointer to class
139  * @param hdr Enable high dynamic range
140  * @param error Pointer to error
141  */
142 TOF_EXPORT void tof_user_config_set_hdr(tof_user_config_t ptr, bool hdr, tof_error_t *error);
143 
144 /** Get the integration time
145  * @param ptr Pointer to class
146  * @param error Pointer to error
147  * @return The integration time
148  */
149 TOF_EXPORT enum tof_integration_time tof_user_config_get_integration_time(const tof_user_config_t ptr, tof_error_t *error);
150 
151 /** Set the integration time
152  * @param ptr Pointer to class
153  * @param int_time The integration time
154  * @param error Pointer to error
155  */
156 TOF_EXPORT void tof_user_config_set_integration_time(tof_user_config_t ptr, enum tof_integration_time int_time, tof_error_t *error);
157 
158 /** Get what the configuration is being optimized for
159  * @param ptr Pointer to class
160  * @param error Pointer to error
161  * @return The user configuration strategy
162  */
163 TOF_EXPORT enum tof_strategy tof_user_config_get_strategy(const tof_user_config_t ptr, tof_error_t *error);
164 
165 /** Set what the configuration is being optimized for
166  * @param ptr Pointer to class
167  * @param strategy The user configuration strategy
168  * @param error Pointer to error
169  */
170 TOF_EXPORT void tof_user_config_set_strategy(tof_user_config_t ptr, enum tof_strategy strategy, tof_error_t *error);
171 
172 /** Get The camera channel, increment to support multi-camera usage
173  * @param ptr Pointer to class
174  * @param error Pointer to error
175  * @return The channel number, set to 0, otherwise increment with number of
176  * cameras.
177  */
178 TOF_EXPORT int32_t tof_user_config_get_channel(const tof_user_config_t ptr, tof_error_t *error);
179 
180 /** Set The camera channel, increment to support multi-camera usage
181  * @param ptr Pointer to class
182  * @param channel The channel number, set to 0, otherwise increment with number
183  * of cameras.
184  * @param error Pointer to error
185  */
186 TOF_EXPORT void tof_user_config_set_channel(tof_user_config_t ptr, int32_t channel, tof_error_t *error);
187 
188 #ifdef __cplusplus
189 }
190 #endif
191 
192 #endif