NVIDIA DeepStream SDK API Reference

6.4 Release
idatatype.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2021-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3  * SPDX-License-Identifier: LicenseRef-NvidiaProprietary
4  *
5  * NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
6  * property and proprietary rights in and to this material, related
7  * documentation and any modifications thereto. Any use, reproduction,
8  * disclosure or distribution of this material and related documentation
9  * without an express license agreement from NVIDIA CORPORATION or
10  * its affiliates is strictly prohibited.
11  */
12 
13 #ifndef _DS3D_COMMON_IDATATYPE__H
14 #define _DS3D_COMMON_IDATATYPE__H
15 
16 #include <ds3d/common/common.h>
17 #include <ds3d/common/typeid.h>
18 
19 typedef struct _GstBuffer GstBuffer;
20 typedef struct NvBufSurface NvBufSurface;
22 
23 namespace ds3d {
24 
25 template <typename T>
26 union __xyzw {
27  T data[4];
28  struct {
29  T x, y, z, w;
30  };
31 };
32 
33 template <typename T>
34 union __xyz {
35  T data[3];
36  struct {
37  T x, y, z;
38  };
39 };
40 
41 template <typename T>
42 union __xy {
43  T data[2];
44  struct {
45  T x, y;
46  };
47 };
48 
49 template <typename T>
50 union __x {
51  T data[1];
52  struct {
53  T x;
54  };
55 };
56 
57 template <typename T>
58 using vec4 = __xyzw<T>;
59 template <typename T>
60 using vec3 = __xyz<T>;
61 template <typename T>
62 using vec2 = __xy<T>;
63 template <typename T>
64 using vec1 = __x<T>;
65 
70 
75 
76 // keep same order with InferDataType
77 enum class DataType : int {
78  kFp32 = 0, // 0
79  kFp16 = 1, // 1
80  kInt8 = 2, // 2
81  kInt32 = 3, // 3
82  kInt16 = 7,
83  kUint8,
84  kUint16,
85  kUint32,
86  kDouble,
87  kInt64,
88 };
89 
90 enum class FrameType : int {
91  kUnknown = 0,
92  kDepth = 1,
93  kColorRGBA = 2,
94  kColorRGB = 3,
95  kPointXYZ = 32,
96  kPointCoordUV = 33,
97  kLidarXYZI = 34,
98  kCustom = 255,
99 };
100 
101 enum class MemType : int {
102  kNone = 0,
103  kGpuCuda = 1,
104  kCpu = 2,
105  kCpuPinned = 3,
106 };
107 
108 struct TimeStamp { // unit in nanosecond
109  uint64_t t0 = 0;
110  uint64_t t1 = 0;
111  uint64_t t2 = 0;
113 };
114 
115 constexpr const size_t kMaxShapeDims = 8;
116 
117 struct Shape {
118  uint32_t numDims = 0;
119  int32_t d[kMaxShapeDims] = {0};
121 };
122 
123 struct DepthScale {
124  double scaleUnit = 0.0f;
125  void* reserved[3] = {nullptr};
127 };
128 
130  uint32_t width = 0;
131  uint32_t height = 0;
132  float centerX = 0; // coordinate axis in horizontal
133  float centerY = 0; // coordinate axis position in vertical
134  float fx = 0; // focal lenth in x
135  float fy = 0; // focal lenth in y
137 };
138 
140  vec3f rotation[3]; // column-major order
143 };
144 
146  vec4f matrix[4]; // column-major order
148 };
149 
150 
151 //Video Bridge 2d input
153  uint8_t desc[128] = {0};
154  GstBuffer* buffer = nullptr;
158 };
159 
160 } // namespace ds3d
161 
162 #endif // _DS3D_COMMON_IDATATYPE__H
DS3D_TYPEID_INTRINSIC_PARM
#define DS3D_TYPEID_INTRINSIC_PARM
Definition: typeid.h:35
ds3d::VideoBridge2dInput::batchMeta
NvDsBatchMeta * batchMeta
Definition: idatatype.h:156
ds3d::FrameType::kPointCoordUV
@ kPointCoordUV
ds3d::Shape::d
int32_t d[kMaxShapeDims]
Definition: idatatype.h:119
REGISTER_TYPE_ID
#define REGISTER_TYPE_ID(uint64Id)
Definition: defines.h:131
ds3d::DataType::kUint32
@ kUint32
ds3d::IntrinsicsParam::centerX
float centerX
Definition: idatatype.h:132
ds3d::__xy::y
T y
Definition: idatatype.h:45
ds3d::MemType::kCpu
@ kCpu
ds3d::ExtrinsicsParam::translation
vec3f translation
Definition: idatatype.h:141
ds3d::__xyz
Definition: idatatype.h:34
ds3d::DataType::kFp32
@ kFp32
ds3d::__xyzw::data
T data[4]
Definition: idatatype.h:27
ds3d::__x::data
T data[1]
Definition: idatatype.h:51
DS3D_TYPEID_SHAPE
#define DS3D_TYPEID_SHAPE
Definition: typeid.h:33
ds3d::DataType
DataType
Definition: idatatype.h:77
ds3d::VideoBridge2dInput
Definition: idatatype.h:152
NvBufSurface
Holds information about batched buffers.
Definition: nvbufsurface.h:503
ds3d::__x::x
T x
Definition: idatatype.h:53
ds3d::VideoBridge2dInput::buffer
GstBuffer * buffer
Definition: idatatype.h:154
ds3d::IntrinsicsParam
Definition: idatatype.h:129
ds3d::__xyz::z
T z
Definition: idatatype.h:37
ds3d::DataType::kInt32
@ kInt32
DS3D_TYPEID_EXTRINSIC_PARM
#define DS3D_TYPEID_EXTRINSIC_PARM
Definition: typeid.h:36
ds3d::FrameType::kUnknown
@ kUnknown
ds3d::__xyzw::x
T x
Definition: idatatype.h:29
ds3d::TimeStamp
Definition: idatatype.h:108
ds3d::TimeStamp::t2
uint64_t t2
Definition: idatatype.h:111
ds3d::FrameType::kCustom
@ kCustom
ds3d::FrameType::kLidarXYZI
@ kLidarXYZI
ds3d::DepthScale::scaleUnit
double scaleUnit
Definition: idatatype.h:124
ds3d::IntrinsicsParam::height
uint32_t height
Definition: idatatype.h:131
ds3d::ExtrinsicsParam::rotation
vec3f rotation[3]
Definition: idatatype.h:140
ds3d::FrameType::kPointXYZ
@ kPointXYZ
ds3d::__xyz::data
T data[3]
Definition: idatatype.h:35
ds3d::__xy::data
T data[2]
Definition: idatatype.h:43
DS3D_TYPEID_VIDEOBRIDGE2D_PARM
#define DS3D_TYPEID_VIDEOBRIDGE2D_PARM
Definition: typeid.h:37
ds3d::IntrinsicsParam::width
uint32_t width
Definition: idatatype.h:130
ds3d::VideoBridge2dInput::surfaceBatchBuffer
NvBufSurface * surfaceBatchBuffer
Definition: idatatype.h:155
ds3d::TimeStamp::t1
uint64_t t1
Definition: idatatype.h:110
ds3d::TimeStamp::t0
uint64_t t0
Definition: idatatype.h:109
ds3d::IntrinsicsParam::fy
float fy
Definition: idatatype.h:135
ds3d::Shape::numDims
uint32_t numDims
Definition: idatatype.h:118
DS3D_TYPEID_DEPTH_SCALE
#define DS3D_TYPEID_DEPTH_SCALE
Definition: typeid.h:34
typeid.h
_NvDsBatchMeta
Holds information about a formed batch containing frames from different sources.
Definition: nvdsmeta.h:240
ds3d::__xyz::y
T y
Definition: idatatype.h:37
DS3D_TYPEID_TRANSFORM_MATRIX
#define DS3D_TYPEID_TRANSFORM_MATRIX
Definition: typeid.h:38
ds3d::VideoBridge2dInput::desc
uint8_t desc[128]
Definition: idatatype.h:153
ds3d::TransformMatrix
Definition: idatatype.h:145
ds3d::MemType::kGpuCuda
@ kGpuCuda
ds3d::FrameType::kColorRGBA
@ kColorRGBA
ds3d::DataType::kInt64
@ kInt64
ds3d::FrameType::kColorRGB
@ kColorRGB
ds3d::DataType::kUint16
@ kUint16
ds3d::IntrinsicsParam::centerY
float centerY
Definition: idatatype.h:133
ds3d::__xy
Definition: idatatype.h:42
common.h
ds3d::DataType::kDouble
@ kDouble
ds3d::DataType::kUint8
@ kUint8
ds3d::DataType::kFp16
@ kFp16
ds3d::__xyzw::y
T y
Definition: idatatype.h:29
ds3d::DepthScale::reserved
void * reserved[3]
Definition: idatatype.h:125
ds3d::__xyz::x
T x
Definition: idatatype.h:37
ds3d::DepthScale
Definition: idatatype.h:123
ds3d::FrameType::kDepth
@ kDepth
ds3d::ExtrinsicsParam
Definition: idatatype.h:139
GstBuffer
struct _GstBuffer GstBuffer
Definition: idatatype.h:19
ds3d::__xyzw
Definition: idatatype.h:26
ds3d::TransformMatrix::matrix
vec4f matrix[4]
Definition: idatatype.h:146
ds3d::__xyzw::z
T z
Definition: idatatype.h:29
ds3d::FrameType
FrameType
Definition: idatatype.h:90
ds3d::DataType::kInt16
@ kInt16
ds3d::Shape
Definition: idatatype.h:117
ds3d::__x
Definition: idatatype.h:50
ds3d::__xyzw::w
T w
Definition: idatatype.h:29
ds3d
Definition: lidar_3d_datatype.h:33
ds3d::IntrinsicsParam::fx
float fx
Definition: idatatype.h:134
ds3d::__xy::x
T x
Definition: idatatype.h:45
ds3d::MemType::kCpuPinned
@ kCpuPinned
ds3d::MemType
MemType
Definition: idatatype.h:101
ds3d::DataType::kInt8
@ kInt8
ds3d::kMaxShapeDims
constexpr const size_t kMaxShapeDims
Definition: idatatype.h:115
DS3D_TYPEID_TIMESTAMP
#define DS3D_TYPEID_TIMESTAMP
Definition: typeid.h:32
ds3d::MemType::kNone
@ kNone