Time-of-Flight Library(ToF) 4.1.3
 
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_RAW_AB_SUPER = 24, /** The raw information coming out of the vd55h1 sensor. This is not very useful by itself, but when stored in a CSF file, it reproduces the actual pipeline correctly. This also allows to retrieve data from camera without any processing. */
36 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. */
37};
38
39/** This class describes the different data streams coming from the camera
40 */
41typedef struct tof_stream* tof_stream_t;
42
43typedef struct tof_stream const* tof_stream_ct;
44
45/** Destruct tof_stream */
46TOF_EXPORT void tof_stream_delete(tof_stream_t ptr);
47
48/** Get the frame type
49 * @param ptr Pointer to class
50 * @param error Pointer to error
51 * @return The frame type
52 */
53TOF_EXPORT enum tof_frame_type tof_stream_frame_type(tof_stream_ct ptr, tof_error_t *error);
54
55/** Get the frame id
56 * @param ptr Pointer to class
57 * @param error Pointer to error
58 * @return The frame id
59 */
60TOF_EXPORT uint32_t tof_stream_frame_id(tof_stream_ct ptr, tof_error_t *error);
61
62/** Get the modulation frequency of the frame
63 * @param ptr Pointer to class
64 * @param error Pointer to error
65 * @return The modulation frequency
66 */
67TOF_EXPORT float tof_stream_modulation_frequency(tof_stream_ct ptr, tof_error_t *error);
68
69/** Get the integration time of the frame
70 * @param ptr Pointer to class
71 * @param error Pointer to error
72 * @return The integration time
73 */
74TOF_EXPORT uint32_t tof_stream_integration_time(tof_stream_ct ptr, tof_error_t *error);
75
76/** Get a bit array of the processing performed on the frame
77 * @param ptr Pointer to class
78 * @param error Pointer to error
79 * @return A bit array
80 */
81TOF_EXPORT uint32_t tof_stream_process(tof_stream_ct ptr, tof_error_t *error);
82
83/** Get the string representation of the frame type
84 * @param frame_type Frame type
85 * @param error Pointer to error
86 * @return String representation of frame type
87 */
88TOF_EXPORT const char* tof_frame_type_to_string(enum tof_frame_type frame_type, tof_error_t *error);
89
90#ifdef __cplusplus
91}
92#endif
93
94#endif