Time-of-Flight Library(ToF) 3.3.0
camera_config.hpp
1#ifndef _CHRONOPTICS_TOF_CAMERA_CONFIG_HPP_
2#define _CHRONOPTICS_TOF_CAMERA_CONFIG_HPP_
3
4#include <chronoptics/tof/camera_config.h>
5
6#include <chronoptics/tof/processing_config.hpp>
7
8namespace chronoptics {
9namespace tof {
10
11/** ToF cameras made by Chronoptics
12 */
13enum class CameraType {
14 OPT8241 = 1, /** Original Moa and first generation Kea camera with opt sensor */
15 OPT8241_EXT = 4, /** First generation Kea camera with opt sensor and external modulation */
16 MLX75027 = 6, /** Newer generation Kea cameras with mlx sensor */
17};
18
19/** Operating mode of the cameras' sensor
20 */
21enum class SensorMode {
22 NORMAL = 0, /** Normal mode ToF sensor mod (A - B) */
23 COMMON = 1, /** Common mode (A + B) */
24 EXTERNAL_DEMOD = 4, /** Use external demodulation */
25 EXTERNAL_SIGNAL = 5, /** Use the light source as an input */
26 TAP_A = 8, /** Only tap a is read out */
27 TAP_B = 9, /** Only tap b is read out */
28 TAP_AB = 10, /** Both A and B tap are read out, this means double the data transmission */
29};
30
31/** Region of interest
32*/
33class Roi : public detail::Base<tof_roi, tof_roi_delete> {
34 public:
35 /** Construct from pointer */
36 Roi(tof_roi_t ptr = nullptr) {
37 this->ptr_ = ptr;
38 }
39
40 /** Get the number of rows in the image sensor
41 * @return Number of rows
42 */
43 int32_t sensor_rows() const {
44 return tof_roi_sensor_rows(this->ptr_, TOF_ERROR_HANDLER{});
45 }
46
47 /** Get the number of columns in the image sensor
48 * @return Number of columsn
49 */
50 int32_t sensor_cols() const {
51 return tof_roi_sensor_cols(this->ptr_, TOF_ERROR_HANDLER{});
52 }
53
54 /** Get the row offset in pixels
55 * @return Row offset
56 */
57 int32_t get_row_offset() const {
58 return tof_roi_get_row_offset(this->ptr_, TOF_ERROR_HANDLER{});
59 }
60
61 /** Set the row offset in pixels
62 * @param row_offset Row offset
63 */
64 void set_row_offset(int32_t row_offset) {
65 return tof_roi_set_row_offset(this->ptr_, row_offset, TOF_ERROR_HANDLER{});
66 }
67
68 /** Get the column offset in pixels
69 * @return Column offset
70 */
71 int32_t get_col_offset() const {
72 return tof_roi_get_col_offset(this->ptr_, TOF_ERROR_HANDLER{});
73 }
74
75 /** Set the column offset in pixels
76 * @param col_offset Column offset
77 */
78 void set_col_offset(int32_t col_offset) {
79 return tof_roi_set_col_offset(this->ptr_, col_offset, TOF_ERROR_HANDLER{});
80 }
81
82 /** Get the number of rows in the output image
83 * @return Image rows
84 */
85 int32_t get_img_rows() const {
86 return tof_roi_get_img_rows(this->ptr_, TOF_ERROR_HANDLER{});
87 }
88
89 /** Set the number of rows in the output image
90 * @param img_rows Image rows
91 */
92 void set_img_rows(int32_t img_rows) {
93 return tof_roi_set_img_rows(this->ptr_, img_rows, TOF_ERROR_HANDLER{});
94 }
95
96 /** Get the number of columns in the output image
97 * @return Image columns
98 */
99 int32_t get_img_cols() const {
100 return tof_roi_get_img_cols(this->ptr_, TOF_ERROR_HANDLER{});
101 }
102
103 /** Set the number of columns in the output image
104 * @param img_cols Image columns
105 */
106 void set_img_cols(int32_t img_cols) {
107 return tof_roi_set_img_cols(this->ptr_, img_cols, TOF_ERROR_HANDLER{});
108 }
109
110};
111
112/** This class allows you to view/edit the camera settings
113*/
114class CameraConfig : public detail::Base<tof_camera_config, tof_camera_config_delete> {
115 public:
116 /** Construct from pointer */
117 CameraConfig(tof_camera_config_t ptr = nullptr) {
118 this->ptr_ = ptr;
119 }
120
121 /** Read camera config from disk
122 * @param file_location Location of camera config on disk
123 */
124 CameraConfig(StringView file_location) {
125 this->ptr_ = tof_camera_config_new_from_disk(file_location, TOF_ERROR_HANDLER{});
126 }
127
128 /** Write camera config to disk
129 * @param file_location Location to save camera config to
130 */
131 void write(StringView file_location) const {
132 return tof_camera_config_write(this->ptr_, file_location, TOF_ERROR_HANDLER{});
133 }
134
135 /** Get the camera type
136 * @return Camera type
137 */
138 CameraType get_type() const {
139 return static_cast<CameraType>(tof_camera_config_get_type(this->ptr_, TOF_ERROR_HANDLER{}));
140 }
141
142 /** Reset camera config to default
143 */
144 void reset() {
145 return tof_camera_config_reset(this->ptr_, TOF_ERROR_HANDLER{});
146 }
147
148 /** Get the amount of frames in the config. Having multiple frames allows you
149 * to configure different modulation frequencies or integration times per
150 * frame.
151 * @return Frame size
152 */
153 size_t frame_size() const {
154 return tof_camera_config_frame_size(this->ptr_, TOF_ERROR_HANDLER{});
155 }
156
157 /** Add a default frame to the camera config
158 */
159 void add_frame() {
160 return tof_camera_config_add_frame(this->ptr_, TOF_ERROR_HANDLER{});
161 }
162
163 /** Generate default processing config from camera configuration
164 * @return The default processing config
165 */
167 ProcessingConfig new_processing_config(static_cast<tof_processing_config_t>(nullptr));
168 auto ptr = reinterpret_cast<tof_processing_config_t*>(&new_processing_config);
169 *ptr = tof_camera_config_default_processing(this->ptr_, TOF_ERROR_HANDLER{});
170 return new_processing_config;
171 }
172
173 /** Erase specified frame
174 * @param frame Frame number
175 */
176 void erase_frame(size_t frame) {
177 return tof_camera_config_erase_frame(this->ptr_, frame, TOF_ERROR_HANDLER{});
178 }
179
180 /** Get the phase shifts. Value ranges from 0.0 to 1.0 which translates to 0-2
181 * pi
182 * @param frame Frame number
183 * @return Phase shifts
184 */
185 std::vector<float> get_phase_shifts(size_t frame) const {
186 size_t size = tof_camera_config_get_phase_shifts(this->ptr_, frame, nullptr, 0, TOF_ERROR_HANDLER{});
187 std::vector<float> vec(size);
188 size = tof_camera_config_get_phase_shifts(this->ptr_, frame, vec.data(), vec.size(), TOF_ERROR_HANDLER{});
189 return vec;
190 }
191
192 /** Set the phase shifts. Value ranges from 0.0 to 1.0 which translates to 0-2
193 * pi
194 * @param frame Frame number
195 * @param phase_shifts Phase shifts
196 */
197 void set_phase_shifts(size_t frame, const std::vector<float> &phase_shifts) {
198 return tof_camera_config_set_phase_shifts(this->ptr_, frame, phase_shifts.data(), phase_shifts.size(), TOF_ERROR_HANDLER{});
199 }
200
201 /** Get the integration time
202 * @param frame Frame number
203 * @return Integration time in micro seconds
204 */
205 std::vector<uint32_t> get_integration_time(size_t frame) const {
206 size_t size = tof_camera_config_get_integration_time(this->ptr_, frame, nullptr, 0, TOF_ERROR_HANDLER{});
207 std::vector<uint32_t> vec(size);
208 size = tof_camera_config_get_integration_time(this->ptr_, frame, vec.data(), vec.size(), TOF_ERROR_HANDLER{});
209 return vec;
210 }
211
212 /** Set the integration time
213 * @param frame Frame number
214 * @param integration_time Integration time in micro seconds
215 */
216 void set_integration_time(size_t frame, const std::vector<uint32_t> &integration_time) {
217 return tof_camera_config_set_integration_time(this->ptr_, frame, integration_time.data(), integration_time.size(), TOF_ERROR_HANDLER{});
218 }
219
220 /** Get the mode to set the camera's depth sensor to
221 * @param frame Frame number
222 * @return Sensor mode
223 */
224 SensorMode get_sensor_mode(size_t frame) const {
225 return static_cast<SensorMode>(tof_camera_config_get_sensor_mode(this->ptr_, frame, TOF_ERROR_HANDLER{}));
226 }
227
228 /** Set the mode to set the camera's depth sensor to
229 * @param frame Frame number
230 * @param sensor_mode Sensor mode
231 */
232 void set_sensor_mode(size_t frame, SensorMode sensor_mode) {
233 return tof_camera_config_set_sensor_mode(this->ptr_, frame, static_cast<tof_sensor_mode>(sensor_mode), TOF_ERROR_HANDLER{});
234 }
235
236 /** Get the modulation frequency
237 * @param frame Frame number
238 * @return Modulation frequency in MHz
239 */
240 float get_modulation_frequency(size_t frame) const {
241 return tof_camera_config_get_modulation_frequency(this->ptr_, frame, TOF_ERROR_HANDLER{});
242 }
243
244 /** Set the modulation frequency
245 * @param frame Frame number
246 * @param modulation_frequency Modulation frequency in MHz
247 */
248 void set_modulation_frequency(size_t frame, float modulation_frequency) {
249 return tof_camera_config_set_modulation_frequency(this->ptr_, frame, modulation_frequency, TOF_ERROR_HANDLER{});
250 }
251
252 /** Get the duty cycle
253 * @param frame Frame number
254 * @return Duty cycle 0.0 to 1.0
255 */
256 float get_duty_cycle(size_t frame) const {
257 return tof_camera_config_get_duty_cycle(this->ptr_, frame, TOF_ERROR_HANDLER{});
258 }
259
260 /** Set the duty cycle
261 * @param frame Frame number
262 * @param duty_cycle Duty cycle 0.0 to 1.0
263 */
264 void set_duty_cycle(size_t frame, float duty_cycle) {
265 return tof_camera_config_set_duty_cycle(this->ptr_, frame, duty_cycle, TOF_ERROR_HANDLER{});
266 }
267
268 /** Get the region of interest
269 * @param frame Frame number
270 * @return Region of interest
271 */
272 Roi get_roi(size_t frame) const {
273 Roi new_roi(static_cast<tof_roi_t>(nullptr));
274 auto ptr = reinterpret_cast<tof_roi_t*>(&new_roi);
275 *ptr = tof_camera_config_get_roi(this->ptr_, frame, TOF_ERROR_HANDLER{});
276 return new_roi;
277 }
278
279 /** Set the region of interest
280 * @param frame Frame number
281 * @param roi Region of interest
282 */
283 void set_roi(size_t frame, Roi &roi) {
284 return tof_camera_config_set_roi(this->ptr_, frame, *reinterpret_cast<tof_roi_t*>(&roi), TOF_ERROR_HANDLER{});
285 }
286
287 /** Get the amount of binning
288 * @param frame Frame number
289 * @return Amount of binning 0=none, 1=x2, 2=x4, 3=x8
290 */
291 uint8_t get_binning(size_t frame) const {
292 return tof_camera_config_get_binning(this->ptr_, frame, TOF_ERROR_HANDLER{});
293 }
294
295 /** Set the amount of binning
296 * @param frame Frame number
297 * @param binning Amount of binning 0=none, 1=x2, 2=x4, 3=x8
298 */
299 void set_binning(size_t frame, uint8_t binning) {
300 return tof_camera_config_set_binning(this->ptr_, frame, binning, TOF_ERROR_HANDLER{});
301 }
302
303 /** Get is the image flipped
304 * @param frame Frame number
305 * @return Image is flipped
306 */
307 bool get_flip(size_t frame) const {
308 return tof_camera_config_get_flip(this->ptr_, frame, TOF_ERROR_HANDLER{});
309 }
310
311 /** Set is the image flipped
312 * @param frame Frame number
313 * @param flip Image is flipped
314 */
315 void set_flip(size_t frame, bool flip) {
316 return tof_camera_config_set_flip(this->ptr_, frame, flip, TOF_ERROR_HANDLER{});
317 }
318
319 /** Get is the image mirrored
320 * @param frame Frame number
321 * @return Image is mirrored
322 */
323 bool get_mirror(size_t frame) const {
324 return tof_camera_config_get_mirror(this->ptr_, frame, TOF_ERROR_HANDLER{});
325 }
326
327 /** Set is the image mirrored
328 * @param frame Frame number
329 * @param mirror Image is mirrored
330 */
331 void set_mirror(size_t frame, bool mirror) {
332 return tof_camera_config_set_mirror(this->ptr_, frame, mirror, TOF_ERROR_HANDLER{});
333 }
334
335 /** Get the image sensor gain
336 * @return Image sensor gain
337 */
338 float get_gain() const {
339 return tof_camera_config_get_gain(this->ptr_, TOF_ERROR_HANDLER{});
340 }
341
342 /** Set the image sensor gain
343 * @param gain Image sensor gain
344 */
345 void set_gain(float gain) {
346 return tof_camera_config_set_gain(this->ptr_, gain, TOF_ERROR_HANDLER{});
347 }
348
349 /** Get the kind of camera synchronization
350 * @return The kind of sync mode. 0 waits for the vsync pulse before starting
351 * the next frame. 1 optional vsync 2 is no frame syncing
352 */
353 int32_t get_sync_mode() const {
354 return tof_camera_config_get_sync_mode(this->ptr_, TOF_ERROR_HANDLER{});
355 }
356
357 /** Set the kind of camera synchronization
358 * @param sync_mode The kind of sync mode. 0 waits for the vsync pulse before
359 * starting the next frame. 1 optional vsync 2 is no frame syncing
360 */
361 void set_sync_mode(int32_t sync_mode) {
362 return tof_camera_config_set_sync_mode(this->ptr_, sync_mode, TOF_ERROR_HANDLER{});
363 }
364
365 /** Get the maximum integration time possible
366 * @param frame Frame number
367 * @return Maximum integration time in micro seconds
368 */
369 std::vector<uint32_t> maximum_integration_time(size_t frame) {
370 size_t size = tof_camera_config_maximum_integration_time(this->ptr_, frame, nullptr, 0, TOF_ERROR_HANDLER{});
371 std::vector<uint32_t> vec(size);
372 size = tof_camera_config_maximum_integration_time(this->ptr_, frame, vec.data(), vec.size(), TOF_ERROR_HANDLER{});
373 return vec;
374 }
375
376 /** Get the DAC gain
377 * @return The DAC gain
378 */
379 std::vector<uint16_t> get_dac() const {
380 size_t size = tof_camera_config_get_dac(this->ptr_, nullptr, 0, TOF_ERROR_HANDLER{});
381 std::vector<uint16_t> vec(size);
382 size = tof_camera_config_get_dac(this->ptr_, vec.data(), vec.size(), TOF_ERROR_HANDLER{});
383 return vec;
384 }
385
386 /** Set the DAC gain
387 * @param dac The DAC gain
388 */
389 void set_dac(const std::vector<uint16_t> &dac) {
390 return tof_camera_config_set_dac(this->ptr_, dac.data(), dac.size(), TOF_ERROR_HANDLER{});
391 }
392
393 /** Get the mipi speed for the MLX75027
394 * @return The mipi speed. Can only be the values 300, 600, 704, 800 and 960
395 */
396 int32_t get_mlx_mipi_speed() const {
397 return tof_camera_config_get_mlx_mipi_speed(this->ptr_, TOF_ERROR_HANDLER{});
398 }
399
400 /** Set the mipi speed for the MLX75027
401 * @param mipi_speed The mipi speed. Can only be the values 300, 600, 704, 800
402 * and 960
403 */
404 void set_mlx_mipi_speed(int32_t mipi_speed) {
405 return tof_camera_config_set_mlx_mipi_speed(this->ptr_, mipi_speed, TOF_ERROR_HANDLER{});
406 }
407
408 /** Get the preheat time
409 * @param frame Frame number
410 * @return The preheat time
411 */
412 uint32_t get_mlx_preheat(size_t frame) const {
413 return tof_camera_config_get_mlx_preheat(this->ptr_, frame, TOF_ERROR_HANDLER{});
414 }
415
416 /** Set the preheat time
417 * @param frame Frame number
418 * @param preheat The preheat time
419 */
420 void set_mlx_preheat(size_t frame, uint32_t preheat) {
421 return tof_camera_config_set_mlx_preheat(this->ptr_, frame, preheat, TOF_ERROR_HANDLER{});
422 }
423
424 /** Get enable preheat
425 * @param frame Frame number
426 * @return Enable preheating
427 */
428 bool get_mlx_preheat_enable(size_t frame) const {
429 return tof_camera_config_get_mlx_preheat_enable(this->ptr_, frame, TOF_ERROR_HANDLER{});
430 }
431
432 /** Set enable preheat
433 * @param frame Frame number
434 * @param enable Enable preheating
435 */
436 void set_mlx_preheat_enable(size_t frame, bool enable) {
437 return tof_camera_config_set_mlx_preheat_enable(this->ptr_, frame, enable, TOF_ERROR_HANDLER{});
438 }
439
440 /** Set the Nios hex for the keaB cameras
441 * @param file_location File location of the nios hex file
442 */
443 void set_opt_kea_nios_hex(StringView file_location) {
444 return tof_camera_config_set_opt_kea_nios_hex(this->ptr_, file_location, TOF_ERROR_HANDLER{});
445 }
446
447 /** Get the opt8241 number of sub and quad frames
448 * @return Number of subs and quads respectively
449 */
450 std::array<int32_t, 2> get_opt_kea_sub_quad() const {
451 std::array<int32_t, 2> array;
452 auto data = tof_camera_config_get_opt_kea_sub_quad(this->ptr_, TOF_ERROR_HANDLER{});
453 std::copy(data, data + array.size(), array.data());
454 return array;
455 }
456
457 /** Set the opt8241 number of sub and quad frames
458 * @param subs_quads Number of subs and quads respectively
459 */
460 void set_opt_kea_sub_quad(const std::array<int32_t, 2> &subs_quads) {
461 return tof_camera_config_set_opt_kea_sub_quad(this->ptr_, subs_quads.data(), TOF_ERROR_HANDLER{});
462 }
463
464 /** Get the processing configuration for when the depth is calculated on
465 * camera
466 * @return The pipeline processing to be done on camera
467 */
469 ProcessingConfig new_processing_config(static_cast<tof_processing_config_t>(nullptr));
470 auto ptr = reinterpret_cast<tof_processing_config_t*>(&new_processing_config);
471 *ptr = tof_camera_config_get_processing(this->ptr_, TOF_ERROR_HANDLER{});
472 return new_processing_config;
473 }
474
475 /** Set the processing configuration for when the depth is calculated on
476 * camera
477 * @param processing The pipeline processing to be done on camera
478 */
480 return tof_camera_config_set_processing(this->ptr_, *reinterpret_cast<tof_processing_config_t*>(&processing), TOF_ERROR_HANDLER{});
481 }
482
483 /** Get the time this depth frame will take. This is useful when you want a
484 * steady but lower framerate.
485 * @param frame Frame number
486 * @return Frame time in micro seconds
487 */
488 uint32_t get_frame_time(size_t frame) const {
489 return tof_camera_config_get_frame_time(this->ptr_, frame, TOF_ERROR_HANDLER{});
490 }
491
492 /** Set the time this depth frame will take. This is useful when you want a
493 * steady but lower framerate.
494 * @param frame Frame number
495 * @param frame_time Frame time in micro seconds
496 */
497 void set_frame_time(size_t frame, uint32_t frame_time) {
498 return tof_camera_config_set_frame_time(this->ptr_, frame, frame_time, TOF_ERROR_HANDLER{});
499 }
500
501 /** Get phase offset for illumination and sensor. The phase offsets are two
502 * floating point values corresponding to the phase delay for the illumination
503 * and sensor respectively. The values should be between 0.0 and 1.0 where 0.0
504 * is no phase offset and 1.0 is 360 degree phase offset
505 * @param frame Frame number
506 * @return Image is mirrored
507 */
508 std::array<float, 2> get_global_phase_offset(size_t frame) const {
509 std::array<float, 2> array;
510 auto data = tof_camera_config_get_global_phase_offset(this->ptr_, frame, TOF_ERROR_HANDLER{});
511 std::copy(data, data + array.size(), array.data());
512 return array;
513 }
514
515 /** Set phase offset for illumination and sensor. The phase offsets are two
516 * floating point values corresponding to the phase delay for the illumination
517 * and sensor respectively. The values should be between 0.0 and 1.0 where 0.0
518 * is no phase offset and 1.0 is 360 degree phase offset
519 * @param frame Frame number
520 * @param phase_offset Image is mirrored
521 */
522 void set_global_phase_offset(size_t frame, const std::array<float, 2> &phase_offset) {
523 return tof_camera_config_set_global_phase_offset(this->ptr_, frame, phase_offset.data(), TOF_ERROR_HANDLER{});
524 }
525
526 /** Get the illumination mode
527 * @param frame Frame number
528 * @return Illumination mode. 0 is actively modulating, 2 is active low
529 * (illumination disabled) and 3 is active high
530 */
531 uint8_t get_illumination_mode(size_t frame) const {
532 return tof_camera_config_get_illumination_mode(this->ptr_, frame, TOF_ERROR_HANDLER{});
533 }
534
535 /** Set the illumination mode
536 * @param frame Frame number
537 * @param illumination_mode Illumination mode. 0 is actively modulating, 2 is
538 * active low (illumination disabled) and 3 is active high
539 */
540 void set_illumination_mode(size_t frame, uint8_t illumination_mode) {
541 return tof_camera_config_set_illumination_mode(this->ptr_, frame, illumination_mode, TOF_ERROR_HANDLER{});
542 }
543
544 /** Get the image offsets. This configuration is only for sensors with column
545 * phase offsets.
546 * @param frame Frame number
547 * @return The image offset per column in 0.0 to 1.0
548 */
549 std::vector<float> get_image_offsets(size_t frame) const {
550 size_t size = tof_camera_config_get_image_offsets(this->ptr_, frame, nullptr, 0, TOF_ERROR_HANDLER{});
551 std::vector<float> vec(size);
552 size = tof_camera_config_get_image_offsets(this->ptr_, frame, vec.data(), vec.size(), TOF_ERROR_HANDLER{});
553 return vec;
554 }
555
556 /** Set the image offsets. This configuration is only for sensors with column
557 * phase offsets.
558 * @param frame Frame number
559 * @param image_offsets The image offset per column in 0.0 to 1.0
560 */
561 void set_image_offsets(size_t frame, const std::vector<float> &image_offsets) {
562 return tof_camera_config_set_image_offsets(this->ptr_, frame, image_offsets.data(), image_offsets.size(), TOF_ERROR_HANDLER{});
563 }
564
565 /** Get the width of the rgb sensor
566 * @return Width in pixels
567 */
568 size_t get_rgb_width() {
569 return tof_camera_config_get_rgb_width(this->ptr_, TOF_ERROR_HANDLER{});
570 }
571
572 /** Get the height of the rgb sensor
573 * @return Height in pixels
574 */
575 size_t get_rgb_height() {
576 return tof_camera_config_get_rgb_height(this->ptr_, TOF_ERROR_HANDLER{});
577 }
578
579};
580
581} // tof
582} // chronoptics
583
584#endif
This class allows you to view/edit the camera settings.
void set_gain(float gain)
Set the image sensor gain.
void set_integration_time(size_t frame, const std::vector< uint32_t > &integration_time)
Set the integration time.
std::vector< float > get_phase_shifts(size_t frame) const
Get the phase shifts.
uint8_t get_illumination_mode(size_t frame) const
Get the illumination mode.
float get_duty_cycle(size_t frame) const
Get the duty cycle.
void set_modulation_frequency(size_t frame, float modulation_frequency)
Set the modulation frequency.
SensorMode get_sensor_mode(size_t frame) const
Get the mode to set the camera's depth sensor to.
size_t get_rgb_height()
Get the height of the rgb sensor.
size_t frame_size() const
Get the amount of frames in the config.
void set_global_phase_offset(size_t frame, const std::array< float, 2 > &phase_offset)
Set phase offset for illumination and sensor.
uint32_t get_mlx_preheat(size_t frame) const
Get the preheat time.
void set_image_offsets(size_t frame, const std::vector< float > &image_offsets)
Set the image offsets.
ProcessingConfig default_processing() const
Generate default processing config from camera configuration.
void erase_frame(size_t frame)
Erase specified frame.
bool get_mirror(size_t frame) const
Get is the image mirrored.
void set_mlx_mipi_speed(int32_t mipi_speed)
Set the mipi speed for the MLX75027.
void set_phase_shifts(size_t frame, const std::vector< float > &phase_shifts)
Set the phase shifts.
std::array< int32_t, 2 > get_opt_kea_sub_quad() const
Get the opt8241 number of sub and quad frames.
int32_t get_sync_mode() const
Get the kind of camera synchronization.
void set_sync_mode(int32_t sync_mode)
Set the kind of camera synchronization.
void set_mlx_preheat_enable(size_t frame, bool enable)
Set enable preheat.
void add_frame()
Add a default frame to the camera config.
std::vector< uint32_t > maximum_integration_time(size_t frame)
Get the maximum integration time possible.
void set_flip(size_t frame, bool flip)
Set is the image flipped.
uint8_t get_binning(size_t frame) const
Get the amount of binning.
std::array< float, 2 > get_global_phase_offset(size_t frame) const
Get phase offset for illumination and sensor.
std::vector< uint32_t > get_integration_time(size_t frame) const
Get the integration time.
void set_mlx_preheat(size_t frame, uint32_t preheat)
Set the preheat time.
uint32_t get_frame_time(size_t frame) const
Get the time this depth frame will take.
bool get_flip(size_t frame) const
Get is the image flipped.
void set_dac(const std::vector< uint16_t > &dac)
Set the DAC gain.
std::vector< uint16_t > get_dac() const
Get the DAC gain.
CameraConfig(tof_camera_config_t ptr=nullptr)
Construct from pointer.
Roi get_roi(size_t frame) const
Get the region of interest.
std::vector< float > get_image_offsets(size_t frame) const
Get the image offsets.
ProcessingConfig get_processing() const
Get the processing configuration for when the depth is calculated on camera.
int32_t get_mlx_mipi_speed() const
Get the mipi speed for the MLX75027.
float get_modulation_frequency(size_t frame) const
Get the modulation frequency.
CameraConfig(StringView file_location)
Read camera config from disk.
bool get_mlx_preheat_enable(size_t frame) const
Get enable preheat.
void reset()
Reset camera config to default.
size_t get_rgb_width()
Get the width of the rgb sensor.
void set_illumination_mode(size_t frame, uint8_t illumination_mode)
Set the illumination mode.
void set_roi(size_t frame, Roi &roi)
Set the region of interest.
void set_mirror(size_t frame, bool mirror)
Set is the image mirrored.
void set_duty_cycle(size_t frame, float duty_cycle)
Set the duty cycle.
void set_binning(size_t frame, uint8_t binning)
Set the amount of binning.
void write(StringView file_location) const
Write camera config to disk.
void set_frame_time(size_t frame, uint32_t frame_time)
Set the time this depth frame will take.
void set_processing(ProcessingConfig &processing)
Set the processing configuration for when the depth is calculated on camera.
void set_opt_kea_sub_quad(const std::array< int32_t, 2 > &subs_quads)
Set the opt8241 number of sub and quad frames.
void set_opt_kea_nios_hex(StringView file_location)
Set the Nios hex for the keaB cameras.
float get_gain() const
Get the image sensor gain.
void set_sensor_mode(size_t frame, SensorMode sensor_mode)
Set the mode to set the camera's depth sensor to.
CameraType get_type() const
Get the camera type.
Processing that can be done.
Region of interest.
int32_t get_img_rows() const
Get the number of rows in the output image.
int32_t get_img_cols() const
Get the number of columns in the output image.
int32_t sensor_cols() const
Get the number of columns in the image sensor.
void set_img_rows(int32_t img_rows)
Set the number of rows in the output image.
int32_t get_row_offset() const
Get the row offset in pixels.
void set_img_cols(int32_t img_cols)
Set the number of columns in the output image.
void set_col_offset(int32_t col_offset)
Set the column offset in pixels.
void set_row_offset(int32_t row_offset)
Set the row offset in pixels.
int32_t sensor_rows() const
Get the number of rows in the image sensor.
int32_t get_col_offset() const
Get the column offset in pixels.
Roi(tof_roi_t ptr=nullptr)
Construct from pointer.