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