Time-of-Flight Library(ToF) 3.13.2
 
csf_reader.h
1#ifndef _CHRONOPTICS_TOF_CSF_READER_H_
2#define _CHRONOPTICS_TOF_CSF_READER_H_
3
4#include <chronoptics/tof/data.h>
5#include <chronoptics/tof/stream.h>
6#include <chronoptics/tof/calibration.h>
7#include <chronoptics/tof/camera_config.h>
8
9#ifdef __cplusplus
10extern "C" {
11#endif
12
13/** DEPRECATED, use CSFCamera. This class reads csf files
14 */
15typedef struct tof_csf_reader* tof_csf_reader_t;
16
17/** Destruct tof_csf_reader */
18TOF_EXPORT void tof_csf_reader_delete(tof_csf_reader_t ptr);
19
20/** Open a csf file for reading
21 * @param ptr Pointer to class
22 * @param file_location File location of the csf file
23 * @param error Pointer to error
24 * @return New object
25 */
26TOF_EXPORT tof_csf_reader_t tof_csf_reader_new(const char* file_location, tof_error_t *error);
27
28/** Read the next data frame from disk
29 * @param ptr Pointer to class
30 * @param error Pointer to error
31 * @return A data frame
32 */
33TOF_EXPORT tof_data_t tof_csf_reader_read_frame(tof_csf_reader_t ptr, tof_error_t *error);
34
35/** Read the next data frame from disk into the supplied pointer
36 * @param ptr Pointer to class
37 * @param pointer The pointer to the data to write into
38 * @param capacity The amount of data the pointer can hold
39 * @param callback Callback that will be called when pointer is no longer in use
40 * @param callback_user_data User data that will be passed back when the function pointer is called
41 * @param error Pointer to error
42 * @return A data frame
43 */
44TOF_EXPORT tof_data_t tof_csf_reader_read_frame_into_pointer(tof_csf_reader_t ptr, uint8_t* pointer, size_t capacity, tof_user_pointer_destructed_t callback, void* callback_user_data, tof_error_t *error);
45
46/** Get the total number of frames in the csf file
47 * @param ptr Pointer to class
48 * @param error Pointer to error
49 * @return Total number of frames in the csf file
50 */
51TOF_EXPORT size_t tof_csf_reader_number_of_frames(const tof_csf_reader_t ptr, tof_error_t *error);
52
53/** Returns an empty Data class containing the header information for the
54 * specified frame
55 * @param ptr Pointer to class
56 * @param index Which frame to get the header from
57 * @param error Pointer to error
58 * @return Empty Data instance containing header information
59 */
60TOF_EXPORT tof_data_t tof_csf_reader_get_header(const tof_csf_reader_t ptr, size_t index, tof_error_t *error);
61
62/** Get the stream information of the next frame
63 * @param ptr Pointer to class
64 * @param error Pointer to error
65 * @return Information on the next frame
66 */
67TOF_EXPORT tof_stream_t tof_csf_reader_next_stream(const tof_csf_reader_t ptr, tof_error_t *error);
68
69/** Get the size of the next frame
70 * @param ptr Pointer to class
71 * @param error Pointer to error
72 * @return Size of the next frame
73 */
74TOF_EXPORT size_t tof_csf_reader_next_frame_size(const tof_csf_reader_t ptr, tof_error_t *error);
75
76/** Get the current frame position
77 * @param ptr Pointer to class
78 * @param error Pointer to error
79 * @return Frame index
80 */
81TOF_EXPORT size_t tof_csf_reader_frame_index(const tof_csf_reader_t ptr, tof_error_t *error);
82
83/** Go to specified frame
84 * @param ptr Pointer to class
85 * @param index The index of the frame to jump to
86 * @param error Pointer to error
87 */
88TOF_EXPORT void tof_csf_reader_go_to_frame(tof_csf_reader_t ptr, size_t index, tof_error_t *error);
89
90/** Get the streams that are in the csf file
91 * @param ptr Pointer to class
92 * @param streams Streams in the csf file
93 * @param capacity The amount of data the above pointer can hold
94 * @param error Pointer to error
95 * @return Number of pointers filled or complete array size
96 */
97TOF_EXPORT size_t tof_csf_reader_streams(const tof_csf_reader_t ptr, tof_stream_t* streams, size_t capacity, tof_error_t *error);
98
99/** Get the number of frames contained in the file of the given stream
100 * @param ptr Pointer to class
101 * @param stream The stream
102 * @param error Pointer to error
103 * @return Number of frames for given stream
104 */
105TOF_EXPORT size_t tof_csf_reader_stream_count(const tof_csf_reader_t ptr, tof_stream_t stream, tof_error_t *error);
106
107/** Go to the specified stream, the next read frame call will start from here
108 * @param ptr Pointer to class
109 * @param stream The stream
110 * @param index The frame index
111 * @param error Pointer to error
112 */
113TOF_EXPORT void tof_csf_reader_go_to_stream(tof_csf_reader_t ptr, tof_stream_t stream, size_t index, tof_error_t *error);
114
115/** Get calibration from the csf file
116 * @param ptr Pointer to class
117 * @param error Pointer to error
118 * @return Calibration
119 */
120TOF_EXPORT tof_calibration_t tof_csf_reader_get_calibration(const tof_csf_reader_t ptr, tof_error_t *error);
121
122/** Get camera config from the csf file
123 * @param ptr Pointer to class
124 * @param error Pointer to error
125 * @return Camera config
126 */
127TOF_EXPORT tof_camera_config_t tof_csf_reader_get_camera_config(const tof_csf_reader_t ptr, tof_error_t *error);
128
129#ifdef __cplusplus
130}
131#endif
132
133#endif