Time-of-Flight Library(ToF) 4.0.1
 
data.h
1#ifndef _CHRONOPTICS_TOF_DATA_H_
2#define _CHRONOPTICS_TOF_DATA_H_
3
4#include <chronoptics/tof/stream.h>
5
6#ifdef __cplusplus
7extern "C" {
8#endif
9
10/** The different matrix types
11 */
12enum tof_mat_type {
13 TOF_MAT_TYPE_UINT8 = 0, /** A single unsigned byte */
14 TOF_MAT_TYPE_INT8 = 1, /** A single signed byte */
15 TOF_MAT_TYPE_UINT16 = 2, /** Two unsigned bytes */
16 TOF_MAT_TYPE_INT16 = 3, /** Two signed bytes */
17 TOF_MAT_TYPE_INT32 = 4, /** Four signed bytes */
18 TOF_MAT_TYPE_FLOAT = 5, /** Four bytes floating point value */
19 TOF_MAT_TYPE_DOUBLE = 6, /** Eight bytes floating point value */
20 TOF_MAT_TYPE_FLOAT_4 = 29, /** Four bytes floating point value with four channels */
21 TOF_MAT_TYPE_FLOAT_8 = 61, /** Four bytes floating point value with eight channels */
22};
23
24/** Function signature of callback that's called after a tof_data object is
25 * destructed containing a user pointer
26 * @param pointer The pointer to the data to write into
27 * @param capacity The amount of data the pointer can hold
28 * @param user_data The passed back user data
29 */
30typedef void (*tof_user_pointer_destructed_t)(uint8_t* pointer, size_t capacity, void* user_data);
31
32/** This is the class that contains depth or image data
33 */
34typedef struct tof_data* tof_data_t;
35
36typedef struct tof_data const* tof_data_ct;
37
38/** Destruct tof_data */
39TOF_EXPORT void tof_data_delete(tof_data_t ptr);
40
41/** Get pointer to data
42 * @param ptr Pointer to class
43 * @param error Pointer to error
44 * @return
45 */
46TOF_EXPORT void* tof_data_data(tof_data_t ptr, tof_error_t *error);
47
48/** Get size of the data
49 * @param ptr Pointer to class
50 * @param error Pointer to error
51 * @return The size
52 */
53TOF_EXPORT size_t tof_data_size(tof_data_ct ptr, tof_error_t *error);
54
55/** Get user data that will get saved to csf file
56 * @param ptr Pointer to class
57 * @param error Pointer to error
58 * @return Set user data
59 */
60TOF_EXPORT uint64_t tof_data_get_user_data(tof_data_ct ptr, tof_error_t *error);
61
62/** Set user data that will get saved to csf file
63 * @param ptr Pointer to class
64 * @param user_data Set user data
65 * @param error Pointer to error
66 */
67TOF_EXPORT void tof_data_set_user_data(tof_data_t ptr, uint64_t user_data, tof_error_t *error);
68
69/** Get the matrix type
70 * @param ptr Pointer to class
71 * @param error Pointer to error
72 * @return The matrix type
73 */
74TOF_EXPORT enum tof_mat_type tof_data_mat_type(tof_data_ct ptr, tof_error_t *error);
75
76/** Get the number of rows
77 * @param ptr Pointer to class
78 * @param error Pointer to error
79 * @return Number of rows
80 */
81TOF_EXPORT int32_t tof_data_rows(tof_data_ct ptr, tof_error_t *error);
82
83/** Get the number of columns
84 * @param ptr Pointer to class
85 * @param error Pointer to error
86 * @return Number of columns
87 */
88TOF_EXPORT int32_t tof_data_cols(tof_data_ct ptr, tof_error_t *error);
89
90/** The frame counter
91 * @param ptr Pointer to class
92 * @param error Pointer to error
93 * @return Frame count
94 */
95TOF_EXPORT uint16_t tof_data_frame_count(tof_data_ct ptr, tof_error_t *error);
96
97/** Get the frame type
98 * @param ptr Pointer to class
99 * @param error Pointer to error
100 * @return The frame type
101 */
102TOF_EXPORT enum tof_frame_type tof_data_frame_type(tof_data_ct ptr, tof_error_t *error);
103
104/** Get the frame id
105 * @param ptr Pointer to class
106 * @param error Pointer to error
107 * @return The frame id
108 */
109TOF_EXPORT uint32_t tof_data_frame_id(tof_data_ct ptr, tof_error_t *error);
110
111/** Get the modulation frequency of the frame
112 * @param ptr Pointer to class
113 * @param error Pointer to error
114 * @return The modulation frequency
115 */
116TOF_EXPORT float tof_data_modulation_frequency(tof_data_ct ptr, tof_error_t *error);
117
118/** Get the integration time of the frame
119 * @param ptr Pointer to class
120 * @param error Pointer to error
121 * @return The integration time
122 */
123TOF_EXPORT uint32_t tof_data_integration_time(tof_data_ct ptr, tof_error_t *error);
124
125/** Get a bit array of the processing performed on the frame
126 * @param ptr Pointer to class
127 * @param error Pointer to error
128 * @return A bit array
129 */
130TOF_EXPORT uint32_t tof_data_process(tof_data_ct ptr, tof_error_t *error);
131
132/** Get the scale used for integer frames, to get the original value divide by
133 * scale
134 * @param ptr Pointer to class
135 * @param error Pointer to error
136 * @return The scale
137 */
138TOF_EXPORT float tof_data_scale(tof_data_ct ptr, tof_error_t *error);
139
140/** Get the addition used for integer frames, to get the original value
141 * substract the addition
142 * @param ptr Pointer to class
143 * @param error Pointer to error
144 * @return The addition
145 */
146TOF_EXPORT float tof_data_addition(tof_data_ct ptr, tof_error_t *error);
147
148/** Get the temperature of various parts of the camera
149 * @param ptr Pointer to class
150 * @param temperatures Temperatures
151 * @param capacity The amount of data the above pointer can hold
152 * @param error Pointer to error
153 * @return Number of pointers filled or complete array size
154 */
155TOF_EXPORT size_t tof_data_temperatures(tof_data_ct ptr, float* temperatures, size_t capacity, tof_error_t *error);
156
157/** Get the synchronization count
158 * @param ptr Pointer to class
159 * @param error Pointer to error
160 * @return Sync count
161 */
162TOF_EXPORT uint8_t tof_data_sync_count(tof_data_ct ptr, tof_error_t *error);
163
164/** Check whether the data uses a pointer supplied by the user
165 * @param ptr Pointer to class
166 * @param error Pointer to error
167 * @return Data allocated by user
168 */
169TOF_EXPORT bool tof_data_user_allocated(tof_data_ct ptr, tof_error_t *error);
170
171/** The user data that was given in the add_user_pointer function
172 * @param ptr Pointer to class
173 * @param error Pointer to error
174 * @return User pointer
175 */
176TOF_EXPORT void* tof_data_user_pointer(tof_data_ct ptr, tof_error_t *error);
177
178/** The acceleration measured by the imu
179 * @param ptr Pointer to class
180 * @param error Pointer to error
181 * @return[3] Acceleration, x y z
182 */
183TOF_EXPORT const int16_t* tof_data_acceleration(tof_data_ct ptr, tof_error_t *error);
184
185/** The angular velocity measured by the imu
186 * @param ptr Pointer to class
187 * @param error Pointer to error
188 * @return[3] Angular velocity, x y z
189 */
190TOF_EXPORT const int16_t* tof_data_angular_velocity(tof_data_ct ptr, tof_error_t *error);
191
192/** Unix time stamp since epoch
193 * @param ptr Pointer to class
194 * @param error Pointer to error
195 * @return Time stamp
196 */
197TOF_EXPORT uint64_t tof_data_time_stamp(tof_data_t ptr, tof_error_t *error);
198
199#ifdef __cplusplus
200}
201#endif
202
203#endif