Time-of-Flight-SDK
frame_definitions.h
1 /*
2  * BSD 3-Clause License
3  *
4  * Copyright (c) 2019, Analog Devices, Inc.
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions are met:
9  *
10  * 1. Redistributions of source code must retain the above copyright notice, this
11  * list of conditions and the following disclaimer.
12  *
13  * 2. Redistributions in binary form must reproduce the above copyright notice,
14  * this list of conditions and the following disclaimer in the documentation
15  * and/or other materials provided with the distribution.
16  *
17  * 3. Neither the name of the copyright holder nor the names of its
18  * contributors may be used to endorse or promote products derived from
19  * this software without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
25  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
27  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
28  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
32 #ifndef FRAME_DEFINITIONS_H
33 #define FRAME_DEFINITIONS_H
34 
35 #include <iostream>
36 #include <string>
37 #include <vector>
38 
42 namespace aditof {
43 
53  std::string type;
54 
58  unsigned int width;
59 
63  unsigned int height;
64 
71  unsigned int subelementSize;
72 
78  unsigned int subelementsPerElement;
79 
86  unsigned int bytesCount;
87 };
88 
93 struct FrameDetails {
98  std::string type;
99 
104  std::vector<FrameDataDetails> dataDetails;
105 
109  std::string cameraMode;
110 
114  unsigned int width;
115 
119  unsigned int height;
120 
124  uint8_t totalCaptures;
125 
130 };
131 
136 struct Point3I {
137  int16_t a;
138  int16_t b;
139  int16_t c;
140 };
141 
142 #pragma pack(push, 1)
143 
147 struct Metadata {
148 
152  uint16_t width;
153 
157  uint16_t height;
158 
171 
175  uint8_t bitsInDepth;
176 
180  uint8_t bitsInAb;
181 
186 
192 
196  uint8_t frequencyIndex;
197 
207 
211  uint32_t frameNumber;
212 
216  uint8_t imagerMode;
217 
222  uint8_t numberOfPhases;
223 
229 
233  uint8_t xyzEnabled;
234 
240 
246 
251 
256 };
257 #pragma pack(pop)
258 
262 inline std::ostream &operator<<(std::ostream &o, const struct Metadata &meta) {
263  o << "\tWidth: " << meta.width << "\tHeight: " << meta.height
264  << "\tOutputConfiguration: "
265  << static_cast<unsigned int>(meta.outputConfiguration)
266  << "\tBitsInDepth: " << static_cast<unsigned int>(meta.bitsInDepth)
267  << "\tBitsInAb: " << static_cast<unsigned int>(meta.bitsInAb)
268  << "\tBitsInConfidenc: "
269  << static_cast<unsigned int>(meta.bitsInConfidence)
270  << "\tInvalidPhaseValue: " << meta.invalidPhaseValue
271  << "\tFrequencyIndex: " << static_cast<unsigned int>(meta.frequencyIndex)
272  << "\tFrameNumber: " << meta.frameNumber
273  << "\tImagerMode: " << static_cast<unsigned int>(meta.imagerMode)
274  << "\tNumberOfPhases: " << static_cast<unsigned int>(meta.numberOfPhases)
275  << "\tNumberOfFrequencies: "
276  << static_cast<unsigned int>(meta.numberOfFrequencies)
277  << "\tXYZEnabled: " << static_cast<unsigned int>(meta.xyzEnabled)
278  << "\tElapsedTimeFractionalValue: " << meta.elapsedTimeFractionalValue
279  << "\tElapsedTimeSecondsValue: " << meta.elapsedTimeSecondsValue
280  << "\tSensorTemperature: " << meta.sensorTemperature
281  << "\tLaserTemperature: " << meta.laserTemperature << "\n";
282  return o;
283 }
284 
285 } // namespace aditof
286 
287 #endif // FRAME_DEFINITIONS_H
int16_t c
Z Information.
uint32_t frameNumber
Frame number.
Namespace aditof.
Definition: frame.h:44
Holds the xyz values of a frame.
int32_t sensorTemperature
Sensor temperature in degrees Celsius.
unsigned int width
The width of the frame.
std::string cameraMode
The mode the camera was set when the frame was captured.
int16_t b
Y Information.
std::ostream & operator<<(std::ostream &o, const struct Metadata &meta)
prints human readable metadata structure
std::string type
The type of the frame. Can be one of the types provided by the camera.
uint8_t numberOfPhases
number of phases: Number of phases in the input raw capture fed to the ADSD3500
Contains all of the metadata components.
uint8_t imagerMode
Imager mode.
uint16_t invalidPhaseValue
invalidPhaseValue: In partial depth case, the host must know the invalid phase value used by the ADSD...
unsigned int height
The height of the frame data.
int32_t laserTemperature
Laser temperature in degrees Celsius.
uint8_t bitsInAb
Number of bits in AB.
int16_t a
X Information.
uint8_t bitsInConfidence
Number of bits in confidence.
uint16_t height
Height of frame.
uint32_t elapsedTimeFractionalValue
elapsedTimeFractionalValue: 32-bit fractional value out of total elapsed time.
Describes the properties of a data that embedded within the frame.
uint8_t outputConfiguration
ADSD3500 Output Configuration: 0 Full Depth Frame 1 Phase Frame (Partial Depth) 2 AB Frame 3 Confiden...
uint8_t totalCaptures
totalCaptures or subframes in a frame
unsigned int height
The height of the frame.
std::string type
The type of data that can be found in a frame. For example it could be depth data or IR data,...
uint32_t elapsedTimeSecondsValue
elapsedTimeSecondsValue: 32-bit seconds value out of total elapsed time.
bool passiveIRCaptured
is a passive IR frame appended
unsigned int bytesCount
The total number of bytes that the data has. This can be useful when copying data to another location...
unsigned int subelementsPerElement
The number of sub-elements that an element has. An element is the smallest part of the image (a....
uint8_t abFrequencyIndex
abFrequencyIndex: AB Frequency Index: 0 AB of frequency 0 1 AB of frequency 1 2 AB of frequency 2 3 A...
uint8_t bitsInDepth
Number of bits in depth.
std::vector< FrameDataDetails > dataDetails
A frame can have multiple types of data. For example it could hold data about depth and/or data about...
unsigned int width
The width of the frame data.
uint8_t numberOfFrequencies
number of frequencies: Number of frequencies in the input raw capture fed to the ADSD3500.
Describes the properties of a frame.
uint8_t xyzEnabled
True if xyz is being generated for the current frame. (set by sdk)
uint16_t width
Width of frame.
unsigned int subelementSize
The size in bytes of a sub-element. A sub-element is a sub-component of an element....
uint8_t frequencyIndex
frequencyIndex: Stores index of the frequency for which the phase frame is outputted.