VPI - Vision Programming Interface

0.4.4 Release

Types.h
Go to the documentation of this file.
1 /*
2  * Copyright 2019 NVIDIA Corporation. All rights reserved.
3  *
4  * NOTICE TO LICENSEE:
5  *
6  * This source code and/or documentation ("Licensed Deliverables") are
7  * subject to NVIDIA intellectual property rights under U.S. and
8  * international Copyright laws.
9  *
10  * These Licensed Deliverables contained herein is PROPRIETARY and
11  * CONFIDENTIAL to NVIDIA and is being provided under the terms and
12  * conditions of a form of NVIDIA software license agreement by and
13  * between NVIDIA and Licensee ("License Agreement") or electronically
14  * accepted by Licensee. Notwithstanding any terms or conditions to
15  * the contrary in the License Agreement, reproduction or disclosure
16  * of the Licensed Deliverables to any third party without the express
17  * written consent of NVIDIA is prohibited.
18  *
19  * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
20  * LICENSE AGREEMENT, NVIDIA MAKES NO REPRESENTATION ABOUT THE
21  * SUITABILITY OF THESE LICENSED DELIVERABLES FOR ANY PURPOSE. IT IS
22  * PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND.
23  * NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THESE LICENSED
24  * DELIVERABLES, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY,
25  * NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
26  * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
27  * LICENSE AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY
28  * SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY
29  * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
30  * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
31  * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
32  * OF THESE LICENSED DELIVERABLES.
33  *
34  * U.S. Government End Users. These Licensed Deliverables are a
35  * "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT
36  * 1995), consisting of "commercial computer software" and "commercial
37  * computer software documentation" as such terms are used in 48
38  * C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government
39  * only as a commercial end item. Consistent with 48 C.F.R.12.212 and
40  * 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), all
41  * U.S. Government End Users acquire the Licensed Deliverables with
42  * only those rights set forth herein.
43  *
44  * Any use of the Licensed Deliverables in individual and commercial
45  * software must include, in the user documentation and internal
46  * comments to the code, the above Disclaimer and U.S. Government End
47  * Users Notice.
48  */
49 
56 #ifndef NV_VPI_TYPES_H
57 #define NV_VPI_TYPES_H
58 
59 #include "ImageFormat.h"
60 #include "PixelFormat.h"
61 #include "Status.h"
62 
63 #include <stdint.h>
64 
65 #ifdef __cplusplus
66 extern "C" {
67 #endif
68 
88 typedef enum
89 {
90  VPI_BACKEND_CPU = (1u << 0),
91  VPI_BACKEND_CUDA = (1u << 1),
92  VPI_BACKEND_PVA = (1u << 2),
93  VPI_BACKEND_VIC = (1u << 3),
94  VPI_BACKEND_INVALID = 0xFFFFFFFF
96 
97 #define VPI_BACKEND_ALL (VPI_BACKEND_CPU | VPI_BACKEND_CUDA | VPI_BACKEND_PVA | VPI_BACKEND_VIC)
99 #define VPI_FLAG_ALL ((1ULL << 32) - 1)
100 
107 typedef void (*VPIParallelTask)(int taskId, int threadId, void *vpiData);
108 
131 typedef void (*VPIParallelForCallback)(VPIParallelTask task, int taskCount, void *vpiData, void *userData);
132 
138 typedef struct
139 {
147 
154 
158  void *userData;
160 
166 typedef void *VPINativeThreadHandle;
167 
172 typedef struct VPIArrayImpl *VPIArray;
173 
178 typedef struct VPIContextImpl *VPIContext;
179 
184 typedef struct VPIEventImpl *VPIEvent;
185 
190 typedef struct VPIStreamImpl *VPIStream;
191 
196 typedef struct VPIImageImpl *VPIImage;
197 
202 typedef struct VPIPyramidImpl *VPIPyramid;
203 
208 typedef struct VPIPayloadImpl *VPIPayload;
209 
216 typedef enum
217 {
221 
225 typedef enum
226 {
236 } VPIArrayType;
237 
242 typedef enum
243 {
250 
265 
278 
283 
299 
317 
323 
328 typedef enum
329 {
332 
337 
345 
353 typedef struct
354 {
355  float x,
356  y;
357 } VPIKeypoint;
358 
383 typedef struct
384 {
385  float mat3[3][3];
387 
403 typedef struct
404 {
406  float width,
409 
414 typedef struct
415 {
418 
424  uint8_t trackingStatus;
425 
431  uint8_t templateStatus;
432 
435  uint8_t reserved1, reserved2;
438 
443 typedef enum
444 {
448 
459 
463 
478 typedef float VPICameraIntrinsic[2][3];
479 
491 typedef float VPICameraExtrinsic[3][4];
492 
512 typedef float VPIPerspectiveTransform[3][3];
513 
514 #ifdef __cplusplus
515 }
516 #endif
517 
518 #endif // NV_VPI_TYPES_H
VPIParallelForConfig
Stores the ParallelFor configuration.
Definition: Types.h:139
VPIContext
struct VPIContextImpl * VPIContext
A handle to a context.
Definition: Types.h:178
VPIParallelForConfig::userData
void * userData
A user defined opaque pointer passed to callback function unaltered.
Definition: Types.h:158
VPIConversionPolicy
VPIConversionPolicy
Policy used when converting between image types.
Definition: Types.h:329
VPIBackend
VPIBackend
VPI Backend types.
Definition: Types.h:89
VPIKLTTrackedBoundingBox
Stores a bounding box that is being tracked by KLT Tracker.
Definition: Types.h:415
VPI_LOCK_READ_WRITE
@ VPI_LOCK_READ_WRITE
Lock memory for reading and writing.
Definition: Types.h:461
VPI_ARRAY_TYPE_U8
@ VPI_ARRAY_TYPE_U8
unsigned 8-bit.
Definition: Types.h:229
VPIKLTTrackedBoundingBox::reserved2
uint8_t reserved2
Reserved for future use.
Definition: Types.h:435
VPIKeypoint::x
float x
Keypoint's x coordinate.
Definition: Types.h:355
VPI_INTERP_CATMULL_ROM_PRECISE
@ VPI_INTERP_CATMULL_ROM_PRECISE
Catmull-Rom cubic interpolation.
Definition: Types.h:298
VPI_LOCK_READ
@ VPI_LOCK_READ
Lock memory only for reading.
Definition: Types.h:447
VPI_ARRAY_TYPE_S16
@ VPI_ARRAY_TYPE_S16
signed 16-bit.
Definition: Types.h:230
VPIBoundaryCond
VPIBoundaryCond
Image boundary condition specify how pixel values outside of the image domain should be constructed.
Definition: Types.h:217
VPI_LOCK_WRITE
@ VPI_LOCK_WRITE
Lock memory only for writing.
Definition: Types.h:458
VPI_BACKEND_CUDA
@ VPI_BACKEND_CUDA
CUDA backend.
Definition: Types.h:91
VPIParallelForConfig::maxThreads
int maxThreads
The maximum number of threads used by the parallel_for implementation code.
Definition: Types.h:146
VPIStream
struct VPIStreamImpl * VPIStream
A handle to a stream.
Definition: Types.h:190
VPIParallelForCallback
void(* VPIParallelForCallback)(VPIParallelTask task, int taskCount, void *vpiData, void *userData)
Parallel for callback function pointer type.
Definition: Types.h:131
VPIKLTTrackedBoundingBox::bbox
VPIBoundingBox bbox
Bounding box being tracked.
Definition: Types.h:417
VPI_ARRAY_TYPE_HOMOGRAPHY_TRANSFORM_2D
@ VPI_ARRAY_TYPE_HOMOGRAPHY_TRANSFORM_2D
VPIHomographyTransform2D element.
Definition: Types.h:234
VPI_INTERP_LINEAR
@ VPI_INTERP_LINEAR
Alias to fast linear interpolation.
Definition: Types.h:282
VPIKLTTrackedBoundingBox::trackingStatus
uint8_t trackingStatus
Tracking status of this bounding box.
Definition: Types.h:424
VPIPerspectiveTransform
float VPIPerspectiveTransform[3][3]
Represents a 2D perspective transform.
Definition: Types.h:512
VPI_INTERP_LINEAR_FAST
@ VPI_INTERP_LINEAR_FAST
Fast linear interpolation.
Definition: Types.h:277
VPI_ARRAY_TYPE_INVALID
@ VPI_ARRAY_TYPE_INVALID
Signal type conversion errors.
Definition: Types.h:227
VPICameraExtrinsic
float VPICameraExtrinsic[3][4]
Camera extrinsic matrix.
Definition: Types.h:491
VPIParallelTask
void(* VPIParallelTask)(int taskId, int threadId, void *vpiData)
Parallel task function pointer type.
Definition: Types.h:107
VPI_ARRAY_TYPE_KEYPOINT
@ VPI_ARRAY_TYPE_KEYPOINT
VPIKeypoint element.
Definition: Types.h:233
VPIArrayType
VPIArrayType
Array element formats.
Definition: Types.h:226
VPI_INTERP_CATMULL_ROM
@ VPI_INTERP_CATMULL_ROM
Alias to fast Catmull-Rom cubic interpolator.
Definition: Types.h:321
VPI_INTERP_CATMULL_ROM_FAST
@ VPI_INTERP_CATMULL_ROM_FAST
Fast Catmull-Rom cubic interpolation.
Definition: Types.h:316
VPIEvent
struct VPIEventImpl * VPIEvent
A handle to an event.
Definition: Types.h:184
VPI_ARRAY_TYPE_KLT_TRACKED_BOUNDING_BOX
@ VPI_ARRAY_TYPE_KLT_TRACKED_BOUNDING_BOX
VPIKLTTrackedBoundingBox element.
Definition: Types.h:235
VPIBoundingBox
Stores a generic 2D bounding box.
Definition: Types.h:404
VPIImage
struct VPIImageImpl * VPIImage
A handle to an image.
Definition: Types.h:196
VPI_INTERP_LINEAR_PRECISE
@ VPI_INTERP_LINEAR_PRECISE
Precise linear interpolation.
Definition: Types.h:264
VPIBoundingBox::width
float width
Bounding box width.
Definition: Types.h:406
VPIInterpolationType
VPIInterpolationType
Interpolation types supported by several algorithms.
Definition: Types.h:243
VPI_BACKEND_VIC
@ VPI_BACKEND_VIC
VIC backend.
Definition: Types.h:93
VPI_BOUNDARY_COND_ZERO
@ VPI_BOUNDARY_COND_ZERO
All pixels outside the image are considered to be zero.
Definition: Types.h:218
VPIPayload
struct VPIPayloadImpl * VPIPayload
A handle to an algorithm payload.
Definition: Types.h:208
VPIHomographyTransform2D
Stores a generic 2D homography transform.
Definition: Types.h:384
VPI_CONVERSION_INVALID
@ VPI_CONVERSION_INVALID
Invalid conversion.
Definition: Types.h:331
VPI_ARRAY_TYPE_S8
@ VPI_ARRAY_TYPE_S8
signed 8-bit.
Definition: Types.h:228
VPI_BOUNDARY_COND_CLAMP
@ VPI_BOUNDARY_COND_CLAMP
Border pixels are repeated indefinitely.
Definition: Types.h:219
Status.h
Declaration of VPI status codes handling functions.
VPI_ARRAY_TYPE_U16
@ VPI_ARRAY_TYPE_U16
unsigned 16-bit.
Definition: Types.h:231
VPI_BACKEND_CPU
@ VPI_BACKEND_CPU
CPU backend.
Definition: Types.h:90
VPI_CONVERSION_CAST
@ VPI_CONVERSION_CAST
Casts input to the output type.
Definition: Types.h:336
VPILockMode
VPILockMode
Defines the lock modes used by memory lock functions.
Definition: Types.h:444
VPIArray
struct VPIArrayImpl * VPIArray
A handle to an array.
Definition: Types.h:172
VPI_INTERP_NEAREST
@ VPI_INTERP_NEAREST
Nearest neighbor interpolation.
Definition: Types.h:249
VPIBoundingBox::xform
VPIHomographyTransform2D xform
Defines the bounding box top left corner and its homography.
Definition: Types.h:405
VPIBoundingBox::height
float height
Bounding box height.
Definition: Types.h:407
VPINativeThreadHandle
void * VPINativeThreadHandle
A handle to OS-specific thread handle.
Definition: Types.h:166
PixelFormat.h
Defines types and functions to handle pixel formats.
VPI_ARRAY_TYPE_U32
@ VPI_ARRAY_TYPE_U32
unsigned 32-bit.
Definition: Types.h:232
VPI_BACKEND_PVA
@ VPI_BACKEND_PVA
PVA backend.
Definition: Types.h:92
VPI_BACKEND_INVALID
@ VPI_BACKEND_INVALID
Invalid backend.
Definition: Types.h:94
VPI_CONVERSION_CLAMP
@ VPI_CONVERSION_CLAMP
Clamps input to output's type range.
Definition: Types.h:343
VPIPyramid
struct VPIPyramidImpl * VPIPyramid
A handle to an image pyramid.
Definition: Types.h:202
VPIKLTTrackedBoundingBox::templateStatus
uint8_t templateStatus
Status of the template related to this bounding box.
Definition: Types.h:431
ImageFormat.h
Defines types and functions to handle image formats.
VPICameraIntrinsic
float VPICameraIntrinsic[2][3]
Camera intrinsic matrix.
Definition: Types.h:478
VPIKeypoint
Stores a keypoint coordinate.
Definition: Types.h:354
VPIKeypoint::y
float y
Keypoint's y coordinate.
Definition: Types.h:356
VPIParallelForConfig::callback
VPIParallelForCallback callback
A pointer to the parallel_for implementation.
Definition: Types.h:153