Time-of-Flight Library(ToF) 4.0.1
 
csf_camera.h
1#ifndef _CHRONOPTICS_TOF_CSF_CAMERA_H_
2#define _CHRONOPTICS_TOF_CSF_CAMERA_H_
3
4#include <chronoptics/tof/camera.h>
5#include <chronoptics/tof/processing_config.h>
6#include <chronoptics/tof/data.h>
7
8#ifdef __cplusplus
9extern "C" {
10#endif
11
12/** The csf camera class contains all the logic to generate a stream of depth
13 * data from a csf file
14 */
15typedef struct tof_csf_camera* tof_csf_camera_t;
16
17typedef struct tof_csf_camera const* tof_csf_camera_ct;
18
19/** Destruct tof_csf_camera */
20TOF_EXPORT void tof_csf_camera_delete(tof_csf_camera_t ptr);
21
22/** Construct a csf camera from a csf file
23 * @param ptr Pointer to class
24 * @param file_location File location of the csf file
25 * @param processing_config A processing config
26 * @param error Pointer to error
27 * @return New object
28 */
29TOF_EXPORT tof_csf_camera_t tof_csf_camera_new(const char* file_location, tof_processing_config_ct processing_config, tof_error_t *error);
30
31/** Construct a csf camera from a csf file with a processing config generated by
32 * default_processing from the camera config
33 * @param ptr Pointer to class
34 * @param file_location File location of the csf file
35 * @param error Pointer to error
36 * @return New object
37 */
38TOF_EXPORT tof_csf_camera_t tof_csf_camera_new_simple(const char* file_location, tof_error_t *error);
39
40/** Get frames at the specified position
41 * @param ptr Pointer to class
42 * @param frame_nr Which set of frames to process
43 * @param frames Data frames
44 * @param capacity The amount of data the above pointer can hold
45 * @param error Pointer to error
46 * @return Number of pointers filled or complete array size
47 */
48TOF_EXPORT size_t tof_csf_camera_get_frames_at(tof_csf_camera_t ptr, size_t frame_nr, tof_data_t* frames, size_t capacity, tof_error_t *error);
49
50/** Get the location (count) of the current frame
51 * @param ptr Pointer to class
52 * @param error Pointer to error
53 * @return The currenc frame location
54 */
55TOF_EXPORT size_t tof_csf_camera_get_current_frame(tof_csf_camera_ct ptr, tof_error_t *error);
56
57/** Get the amount of frame lists this csf file can open/generate
58 * @param ptr Pointer to class
59 * @param error Pointer to error
60 * @return The number of frames in the csf file
61 */
62TOF_EXPORT size_t tof_csf_camera_get_frame_number(tof_csf_camera_ct ptr, tof_error_t *error);
63
64/** Get the FPS If the FPS is greater than 0 the time between subsequent
65 * function calls to get_frames or get_frames_at will be limited to the FPS This
66 * is done by sleeping on the next call to get_frames() if the time between
67 * calls is smaller than the time duration dictated by the fps.
68
69 * @param ptr Pointer to class
70 * @param error Pointer to error
71 * @return The frames per second
72 */
73TOF_EXPORT size_t tof_csf_camera_get_fps(tof_csf_camera_ct ptr, tof_error_t *error);
74
75/** Set the FPS If the FPS is greater than 0 the time between subsequent
76 * function calls to get_frames or get_frames_at will be limited to the FPS This
77 * is done by sleeping on the next call to get_frames() if the time between
78 * calls is smaller than the time duration dictated by the fps.
79
80 * @param ptr Pointer to class
81 * @param fps The frames per second
82 * @param error Pointer to error
83 */
84TOF_EXPORT void tof_csf_camera_set_fps(tof_csf_camera_t ptr, size_t fps, tof_error_t *error);
85
86/** the processing config of the camera
87 * @param ptr Pointer to class
88 * @param config The processing config
89 * @param error Pointer to error
90 */
91TOF_EXPORT void tof_csf_camera_set_process_config(tof_csf_camera_t ptr, tof_processing_config_ct config, tof_error_t *error);
92
93#ifdef __cplusplus
94}
95#endif
96
97#endif