VPI - Vision Programming Interface

2.0 Release

Types.h
Go to the documentation of this file.
1 /*
2  * Copyright 2019-2021 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 "Interpolation.h"
61 #include "PixelType.h"
62 #include "Status.h"
63 #include "Version.h"
64 
65 #include <stdint.h>
66 
67 #ifdef __cplusplus
68 extern "C" {
69 #endif
70 
90 typedef enum
91 {
92  VPI_BACKEND_CPU = (1ULL << 0),
93  VPI_BACKEND_CUDA = (1ULL << 1),
94  VPI_BACKEND_PVA = (1ULL << 2),
95  VPI_BACKEND_VIC = (1ULL << 3),
96  VPI_BACKEND_NVENC = (1ULL << 4),
97  VPI_BACKEND_OFA = (1ULL << 5),
98  VPI_BACKEND_INVALID = (1ULL << 15)
100 
102 #define VPI_BACKEND_TEGRA (VPI_BACKEND_VIC | VPI_BACKEND_NVENC | VPI_BACKEND_OFA)
103 
104 #define VPI_BACKEND_MASK ((VPI_BACKEND_INVALID << 1) - 1)
105 
107 #define VPI_BACKEND_ALL \
108  (VPI_BACKEND_CPU | VPI_BACKEND_CUDA | VPI_BACKEND_PVA | VPI_BACKEND_VIC | VPI_BACKEND_NVENC | VPI_BACKEND_OFA)
109 
136 #define VPI_EXCLUSIVE_STREAM_ACCESS (1ULL << 16)
137 
146 #define VPI_RESTRICT_MEM_USAGE (1ULL << 17)
147 
159 #define VPI_REQUIRE_BACKENDS (1ULL << 18)
160 
167 typedef void (*VPIParallelTask)(int taskId, int threadId, void *vpiData);
168 
191 typedef void (*VPIParallelForCallback)(VPIParallelTask task, int taskCount, void *vpiData, void *userData);
192 
198 typedef struct
199 {
207 
214 
218  void *userData;
220 
226 typedef void *VPINativeThreadHandle;
227 
232 typedef struct VPIArrayImpl *VPIArray;
233 
238 typedef struct VPIContextImpl *VPIContext;
239 
244 typedef struct VPIEventImpl *VPIEvent;
245 
250 typedef struct VPIStreamImpl *VPIStream;
251 
256 typedef struct VPIImageImpl *VPIImage;
257 
262 typedef struct VPIPyramidImpl *VPIPyramid;
263 
268 typedef struct VPIPayloadImpl *VPIPayload;
269 
276 typedef enum
277 {
285 
290 typedef enum
291 {
298 
303 
307 
315 typedef struct
316 {
317  float x,
318  y;
319 } VPIKeypoint;
320 
345 typedef struct
346 {
347  float mat3[3][3];
349 
365 typedef struct
366 {
368  float width,
371 
376 typedef struct
377 {
380 
387 
394 
397  uint8_t reserved1, reserved2;
400 
405 typedef struct VPIRectangleIRec
406 {
407  int32_t x, y; /*< Rectangle origin position (x, y). */
408  int32_t width, height; /*< Rectangle size dimensions (width, height). */
409 } VPIRectangleI;
410 
415 typedef enum
416 {
419 
422 
426 
431 typedef enum
432 {
436 
447 
451 
456 #define VPI_TERMINATION_CRITERIA_ITERATIONS (1u << 0)
457 #define VPI_TERMINATION_CRITERIA_EPSILON (1u << 1)
473 typedef float VPICameraIntrinsic[2][3];
474 
486 typedef float VPICameraExtrinsic[3][4];
487 
507 typedef float VPIPerspectiveTransform[3][3];
508 
513 typedef enum
514 {
517 
520 
522 
526 typedef enum
527 {
529  VPI_FLIP_HORIZ = 1U << 0,
530 
532  VPI_FLIP_VERT = 1U << 1,
533 
538 
540 
541 #ifdef __cplusplus
542 }
543 #endif
544 
545 #endif /* NV_VPI_TYPES_H */
Defines types and functions to handle image formats.
Defines all interpolation types used in VPI.
Defines types and functions to handle pixel types.
Declaration of VPI status codes handling functions.
VPIFlipMode
Defines image flip directions.
Definition: Types.h:527
@ VPI_FLIP_HORIZ
Flip horizontally.
Definition: Types.h:529
@ VPI_FLIP_VERT
Flip vertically.
Definition: Types.h:532
@ VPI_FLIP_BOTH
Flip horizontally and vertically.
Definition: Types.h:537
Functions and structures for handling VPI library version.
struct VPIArrayImpl * VPIArray
A handle to an array.
Definition: Types.h:232
int maxThreads
The maximum number of threads used by the parallel_for implementation code.
Definition: Types.h:206
void * userData
A user defined opaque pointer passed to callback function unaltered.
Definition: Types.h:218
VPIParallelForCallback callback
A pointer to the parallel_for implementation.
Definition: Types.h:213
void(* VPIParallelTask)(int taskId, int threadId, void *vpiData)
Parallel task function pointer type.
Definition: Types.h:167
void * VPINativeThreadHandle
A handle to OS-specific thread handle.
Definition: Types.h:226
struct VPIContextImpl * VPIContext
A handle to a context.
Definition: Types.h:238
void(* VPIParallelForCallback)(VPIParallelTask task, int taskCount, void *vpiData, void *userData)
Parallel for callback function pointer type.
Definition: Types.h:191
Stores the ParallelFor configuration.
Definition: Types.h:199
VPIConversionPolicy
Policy used when converting between image types.
Definition: Types.h:291
@ VPI_CONVERSION_CLAMP
Clamps input to output's type range.
Definition: Types.h:297
@ VPI_CONVERSION_INVALID
Invalid conversion.
Definition: Types.h:305
@ VPI_CONVERSION_CAST
Casts input to the output type.
Definition: Types.h:302
struct VPIEventImpl * VPIEvent
A handle to an event.
Definition: Types.h:244
struct VPIImageImpl * VPIImage
A handle to an image.
Definition: Types.h:256
int8_t templateStatus
Status of the template related to this bounding box.
Definition: Types.h:393
int8_t trackingStatus
Tracking status of this bounding box.
Definition: Types.h:386
VPIBoundingBox bbox
Bounding box being tracked.
Definition: Types.h:379
uint8_t reserved1
Reserved for future use.
Definition: Types.h:397
Stores a bounding box that is being tracked by KLT Tracker.
Definition: Types.h:377
float VPICameraExtrinsic[3][4]
Camera extrinsic matrix.
Definition: Types.h:486
float VPICameraIntrinsic[2][3]
Camera intrinsic matrix.
Definition: Types.h:473
struct VPIPayloadImpl * VPIPayload
A handle to an algorithm payload.
Definition: Types.h:268
float VPIPerspectiveTransform[3][3]
Represents a 2D perspective transform.
Definition: Types.h:507
struct VPIPyramidImpl * VPIPyramid
A handle to an image pyramid.
Definition: Types.h:262
struct VPIStreamImpl * VPIStream
A handle to a stream.
Definition: Types.h:250
VPIBackend
VPI Backend types.
Definition: Types.h:91
@ VPI_BACKEND_CUDA
CUDA backend.
Definition: Types.h:93
@ VPI_BACKEND_PVA
PVA backend.
Definition: Types.h:94
@ VPI_BACKEND_NVENC
NVENC backend.
Definition: Types.h:96
@ VPI_BACKEND_OFA
OFA backend.
Definition: Types.h:97
@ VPI_BACKEND_VIC
VIC backend.
Definition: Types.h:95
@ VPI_BACKEND_INVALID
Invalid backend.
Definition: Types.h:98
@ VPI_BACKEND_CPU
CPU backend.
Definition: Types.h:92
float width
Bounding box width.
Definition: Types.h:368
float y
Keypoint's y coordinate.
Definition: Types.h:318
float height
Bounding box height.
Definition: Types.h:369
VPIHomographyTransform2D xform
Defines the bounding box top left corner and its homography.
Definition: Types.h:367
float x
Keypoint's x coordinate.
Definition: Types.h:317
VPIBorderExtension
Image border extension specify how pixel values outside of the image domain should be constructed.
Definition: Types.h:277
VPIEventState
Defines the states of the event.
Definition: Types.h:514
VPIOpticalFlowQuality
Defines the quality of the optical flow algorithm.
Definition: Types.h:416
VPILockMode
Defines the lock modes used by memory lock functions.
Definition: Types.h:432
@ VPI_BORDER_INVALID
Invalid border.
Definition: Types.h:283
@ VPI_BORDER_ZERO
All pixels outside the image are considered to be zero.
Definition: Types.h:278
@ VPI_BORDER_LIMITED
Consider image as limited to not access outside pixels.
Definition: Types.h:282
@ VPI_BORDER_CLAMP
Border pixels are repeated indefinitely.
Definition: Types.h:279
@ VPI_BORDER_MIRROR
dedcb|abcde|dcbab
Definition: Types.h:281
@ VPI_BORDER_REFLECT
edcba|abcde|edcba
Definition: Types.h:280
@ VPI_EVENT_STATE_NOT_SIGNALED
Event is not signaled yet.
Definition: Types.h:516
@ VPI_EVENT_STATE_SIGNALED
Event has been signaled.
Definition: Types.h:519
@ VPI_OPTICAL_FLOW_QUALITY_LOW
Fast but low quality optical flow implementation.
Definition: Types.h:418
@ VPI_OPTICAL_FLOW_QUALITY_HIGH
Slow but high quality optical flow implementation.
Definition: Types.h:424
@ VPI_OPTICAL_FLOW_QUALITY_MEDIUM
Speed and quality in between of VPI_OPTICAL_FLOW_QUALITY_LOW and VPI_OPTICAL_FLOW_QUALITY_HIGH.
Definition: Types.h:421
@ VPI_LOCK_WRITE
Lock memory only for writing.
Definition: Types.h:446
@ VPI_LOCK_READ_WRITE
Lock memory for reading and writing.
Definition: Types.h:449
@ VPI_LOCK_READ
Lock memory only for reading.
Definition: Types.h:435
Stores a generic 2D bounding box.
Definition: Types.h:366
Stores a generic 2D homography transform.
Definition: Types.h:346
Stores a keypoint coordinate.
Definition: Types.h:316
Stores the geometric information of a rectangle.
Definition: Types.h:406