Time-of-Flight Library(ToF)  3.2.2
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
9 extern "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  */
15 typedef struct tof_csf_camera* tof_csf_camera_t;
16 
17 /** Destruct tof_csf_camera */
18 TOF_EXPORT void tof_csf_camera_delete(tof_csf_camera_t ptr);
19 
20 /** Construct a csf camera from a csf file
21  * @param ptr Pointer to class
22  * @param processing_config A processing config
23  * @param file_location File location of the csf file
24  * @param error Pointer to error
25  * @return New object
26  */
27 TOF_EXPORT tof_csf_camera_t tof_csf_camera_new(const tof_processing_config_t processing_config, const char* file_location, tof_error_t *error);
28 
29 /** Get frames at the specified position
30  * @param ptr Pointer to class
31  * @param frame_nr Which set of frames to process
32  * @param frames Data frames
33  * @param capacity The amount of data the above pointer can hold
34  * @param error Pointer to error
35  * @return Number of pointers filled or complete array size
36  */
37 TOF_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);
38 
39 /** Get the location (count) of the current frame
40  * @param ptr Pointer to class
41  * @param error Pointer to error
42  * @return The currenc frame location
43  */
44 TOF_EXPORT size_t tof_csf_camera_get_current_frame(const tof_csf_camera_t ptr, tof_error_t *error);
45 
46 /** Get the amount of frame lists this csf file can open/generate
47  * @param ptr Pointer to class
48  * @param error Pointer to error
49  * @return The number of frames in the csf file
50  */
51 TOF_EXPORT size_t tof_csf_camera_get_frame_number(const tof_csf_camera_t ptr, tof_error_t *error);
52 
53 /** Get the FPS If the FPS is greater than 0 the time between subsequent
54  * function calls to get_frames or get_frames_at will be limited to the FPS This
55  * is done by sleeping on the next call to get_frames() if the time between
56  * calls is smaller than the time duration dictated by the fps.
57 
58  * @param ptr Pointer to class
59  * @param error Pointer to error
60  * @return The frames per second
61  */
62 TOF_EXPORT size_t tof_csf_camera_get_fps(const tof_csf_camera_t ptr, tof_error_t *error);
63 
64 /** Set 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 fps The frames per second
71  * @param error Pointer to error
72  */
73 TOF_EXPORT void tof_csf_camera_set_fps(tof_csf_camera_t ptr, size_t fps, tof_error_t *error);
74 
75 #ifdef __cplusplus
76 }
77 #endif
78 
79 #endif