Time-of-Flight Library(ToF) 4.1.0
 
stream.h
1#ifndef _CHRONOPTICS_TOF_STREAM_H_
2#define _CHRONOPTICS_TOF_STREAM_H_
3
4#include <chronoptics/tof/error.h>
5
6#ifdef __cplusplus
7extern "C" {
8#endif
9
10/** The different frame types that are supported
11 */
12enum tof_frame_type {
13 TOF_FRAME_TYPE_RAW_COMMON = 0, /** The 16bits coming off the OPT8241 image sensor */
14 TOF_FRAME_TYPE_COMMON = 1, /** Common (A + B) image, 4 or 12 bits depending on the sensor */
15 TOF_FRAME_TYPE_RAW = 2, /** Raw (A - B) image 12 bits signed data */
16 TOF_FRAME_TYPE_REAL = 3, /** The real image */
17 TOF_FRAME_TYPE_IMAGINARY = 4, /** The imaginary image */
18 TOF_FRAME_TYPE_PHASE = 5, /** The phase image */
19 TOF_FRAME_TYPE_AMPLITUDE = 6, /** The amplitude image */
20 TOF_FRAME_TYPE_RADIAL = 7, /** The radial distance image */
21 TOF_FRAME_TYPE_INTENSITY = 8, /** The intensity image */
22 TOF_FRAME_TYPE_X = 9, /** The x image of the point cloud */
23 TOF_FRAME_TYPE_Y = 10, /** The y image of the point cloud */
24 TOF_FRAME_TYPE_Z = 11, /** The z image of the point cloud */
25 TOF_FRAME_TYPE_XYZ = 12, /** A complete pointcloud image: float x, float y, float z, float padding */
26 TOF_FRAME_TYPE_XYZ_AMP = 13, /** A complete pointcloud image with amplitude: float x, float y, float z, float amplitude */
27 TOF_FRAME_TYPE_XYZ_BGR = 14, /** A complete pointcloud image with bgr: float x, float y, float z, uint8 b, uint8 g, uint8 r, uint8 padding */
28 TOF_FRAME_TYPE_XYZ_BGR_I = 15, /** A complete pointcloud image with bgr and intensity: float x, float y, float z, uint8 b, uint8 g, uint8 r, uint8 intensity */
29 TOF_FRAME_TYPE_BGR = 18, /** A color image, encode bgr */
30 TOF_FRAME_TYPE_YUV = 19, /** A color image encoded in YUV422 */
31 TOF_FRAME_TYPE_RAW_AB = 20, /** A raw image containing both the A and B tap */
32 TOF_FRAME_TYPE_MJPEG = 21, /** a color image encoded in mjpeg */
33 TOF_FRAME_TYPE_BGR_PROJECTED = 22, /** A color image projected to the XYZ locations of the depth sensor */
34 TOF_FRAME_TYPE_COMPRESSED_DOT = 23, /** The averaged value for each dot. In the XYZAmp format. */
35 TOF_FRAME_TYPE_REFLECTIVITY = 25, /** The reflectivity of an object in the IR domain. This is comparable to a black and white image. Do note that due to the angle of incidence and multi path the reflectivity can still change over distance When selecting both intensity and reflectivity as outputs, radial and intensity are streamed from the camera and the reflectivity will be slightly quantized. */
36};
37
38/** This class describes the different data streams coming from the camera
39 */
40typedef struct tof_stream* tof_stream_t;
41
42typedef struct tof_stream const* tof_stream_ct;
43
44/** Destruct tof_stream */
45TOF_EXPORT void tof_stream_delete(tof_stream_t ptr);
46
47/** Get the frame type
48 * @param ptr Pointer to class
49 * @param error Pointer to error
50 * @return The frame type
51 */
52TOF_EXPORT enum tof_frame_type tof_stream_frame_type(tof_stream_ct ptr, tof_error_t *error);
53
54/** Get the frame id
55 * @param ptr Pointer to class
56 * @param error Pointer to error
57 * @return The frame id
58 */
59TOF_EXPORT uint32_t tof_stream_frame_id(tof_stream_ct ptr, tof_error_t *error);
60
61/** Get the modulation frequency of the frame
62 * @param ptr Pointer to class
63 * @param error Pointer to error
64 * @return The modulation frequency
65 */
66TOF_EXPORT float tof_stream_modulation_frequency(tof_stream_ct ptr, tof_error_t *error);
67
68/** Get the integration time of the frame
69 * @param ptr Pointer to class
70 * @param error Pointer to error
71 * @return The integration time
72 */
73TOF_EXPORT uint32_t tof_stream_integration_time(tof_stream_ct ptr, tof_error_t *error);
74
75/** Get a bit array of the processing performed on the frame
76 * @param ptr Pointer to class
77 * @param error Pointer to error
78 * @return A bit array
79 */
80TOF_EXPORT uint32_t tof_stream_process(tof_stream_ct ptr, tof_error_t *error);
81
82/** Get the string representation of the frame type
83 * @param frame_type Frame type
84 * @param error Pointer to error
85 * @return String representation of frame type
86 */
87TOF_EXPORT const char* tof_frame_type_to_string(enum tof_frame_type frame_type, tof_error_t *error);
88
89#ifdef __cplusplus
90}
91#endif
92
93#endif