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