VPI - Vision Programming Interface

0.3.7 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 <stdint.h>
60 
61 #ifdef __cplusplus
62 extern "C" {
63 #endif
64 
78 #define VPI_BACKEND_DISABLE_PVA (0x01)
79 #define VPI_BACKEND_DISABLE_CPU (0x02)
80 #define VPI_BACKEND_DISABLE_CUDA (0x04)
82 #define VPI_BACKEND_ONLY_PVA \
83  (VPI_BACKEND_DISABLE_CUDA | VPI_BACKEND_DISABLE_CPU)
84 #define VPI_BACKEND_ONLY_CPU \
85  (VPI_BACKEND_DISABLE_PVA | VPI_BACKEND_DISABLE_CUDA)
86 #define VPI_BACKEND_ONLY_CUDA \
87  (VPI_BACKEND_DISABLE_PVA | VPI_BACKEND_DISABLE_CPU)
94 typedef void (*VPIParallelTask)(int taskId, int threadId, void *vpiData);
95 
118 typedef void (*VPIParallelForCallback)(VPIParallelTask task, int taskCount, void *vpiData, void *userData);
119 
125 typedef struct
126 {
134 
141 
145  void *userData;
147 
153 typedef void *VPINativeThreadHandle;
154 
159 typedef struct VPIArrayImpl *VPIArray;
160 
165 typedef struct VPIContextImpl *VPIContext;
166 
171 typedef struct VPIEventImpl *VPIEvent;
172 
177 typedef struct VPIStreamImpl *VPIStream;
178 
183 typedef struct VPIImageImpl *VPIImage;
184 
189 typedef struct VPIPyramidImpl *VPIPyramid;
190 
195 typedef struct VPIPayloadImpl *VPIPayload;
196 
205 typedef enum
206 {
229 
235 typedef enum
236 {
261 
268 typedef enum
269 {
273 
277 typedef enum
278 {
288 } VPIArrayType;
289 
294 typedef enum
295 {
302 
317 
330 
335 
351 
369 
375 
380 typedef enum
381 {
384 
389 
397 
405 typedef struct
406 {
407  float x,
408  y;
409 } VPIKeypoint;
410 
435 typedef struct
436 {
437  float mat3[3][3];
439 
455 typedef struct
456 {
458  float width,
461 
466 typedef struct
467 {
470 
476  uint8_t trackingStatus;
477 
483  uint8_t templateStatus;
484 
487  uint8_t reserved1, reserved2;
490 
495 typedef enum
496 {
500 
511 
515 
522 typedef enum
523 {
539 
546 typedef VPIStatus (*VPIUserFunction)(void *);
547 
553 typedef enum
554 {
560 
574 typedef float VPICameraIntrinsic[2][3];
575 
587 typedef float VPICameraExtrinsic[3][4];
588 
608 typedef float VPIPerspectiveTransform[3][3];
609 
610 #ifdef __cplusplus
611 }
612 #endif
613 
614 #endif // NV_VPI_TYPES_H
VPIKLTTrackedBoundingBox
Stores a bounding box that is being tracked by KLT Tracker.
Definition: Types.h:467
VPIParallelForConfig
Stores the ParallelFor configuration.
Definition: Types.h:126
VPIContext
struct VPIContextImpl * VPIContext
A handle to a context.
Definition: Types.h:165
VPI_ERROR_INVALID_ARGUMENT
@ VPI_ERROR_INVALID_ARGUMENT
Invalid argument, either wrong range or value not accepted.
Definition: Types.h:526
VPIParallelForConfig::userData
void * userData
A user defined opaque pointer passed to callback function unaltered.
Definition: Types.h:145
VPI_IMAGE_TYPE_S8
@ VPI_IMAGE_TYPE_S8
signed 8-bit grayscale.
Definition: Types.h:209
VPI_IMAGE_TYPE_NV12
@ VPI_IMAGE_TYPE_NV12
8-bit NV12.
Definition: Types.h:212
VPI_IMAGE_TYPE_2F32
@ VPI_IMAGE_TYPE_2F32
2 interleaved channels of 32-bit floats.
Definition: Types.h:216
VPI_IMAGE_TYPE_BGR8
@ VPI_IMAGE_TYPE_BGR8
8-bit BGR, B having the lowest address.
Definition: Types.h:217
VPI_IMAGE_TYPE_RGB8
@ VPI_IMAGE_TYPE_RGB8
8-bit RGB, R having the lowest address.
Definition: Types.h:213
VPIImageType
VPIImageType
Image formats.
Definition: Types.h:206
VPI_CONVERSION_CAST
@ VPI_CONVERSION_CAST
Casts input to the output type.
Definition: Types.h:388
VPI_LOCK_READ_WRITE
@ VPI_LOCK_READ_WRITE
Lock memory for reading and writing.
Definition: Types.h:513
VPI_PIXEL_TYPE_4U8
@ VPI_PIXEL_TYPE_4U8
4 interleaved channels of unsigned 8-bit values.
Definition: Types.h:245
VPI_IMAGE_TYPE_1C_F32
@ VPI_IMAGE_TYPE_1C_F32
Definition: Types.h:225
VPI_ERROR_NOT_IMPLEMENTED
@ VPI_ERROR_NOT_IMPLEMENTED
Operation isn't implemented.
Definition: Types.h:525
VPI_PIXEL_TYPE_1C_S8
@ VPI_PIXEL_TYPE_1C_S8
Definition: Types.h:251
VPI_ARRAY_TYPE_U8
@ VPI_ARRAY_TYPE_U8
unsigned 8-bit.
Definition: Types.h:281
VPI_DEVICE_TYPE_CPU
@ VPI_DEVICE_TYPE_CPU
CPU backend.
Definition: Types.h:556
VPI_IMAGE_TYPE_2C_F32
@ VPI_IMAGE_TYPE_2C_F32
Definition: Types.h:226
VPIKeypoint::x
float x
Keypoint's x coordinate.
Definition: Types.h:407
VPI_ERROR_INVALID_CONTEXT
@ VPI_ERROR_INVALID_CONTEXT
Context is invalid or is already destroyed.
Definition: Types.h:532
VPI_ERROR_DEVICE
@ VPI_ERROR_DEVICE
Device backend error.
Definition: Types.h:533
VPI_INTERP_CATMULL_ROM_PRECISE
@ VPI_INTERP_CATMULL_ROM_PRECISE
Catmull-Rom cubic interpolation.
Definition: Types.h:350
VPI_PIXEL_TYPE_INVALID
@ VPI_PIXEL_TYPE_INVALID
Signal type conversion errors.
Definition: Types.h:238
VPI_LOCK_READ
@ VPI_LOCK_READ
Lock memory only for reading.
Definition: Types.h:499
VPI_IMAGE_TYPE_U16
@ VPI_IMAGE_TYPE_U16
unsigned 16-bit grayscale.
Definition: Types.h:210
VPIConversionPolicy
VPIConversionPolicy
Policy used when converting between image types.
Definition: Types.h:381
VPI_ARRAY_TYPE_S16
@ VPI_ARRAY_TYPE_S16
signed 16-bit.
Definition: Types.h:282
VPIBoundaryCond
VPIBoundaryCond
Image boundary condition specify how pixel values outside of the image domain should be constructed.
Definition: Types.h:269
VPI_LOCK_WRITE
@ VPI_LOCK_WRITE
Lock memory only for writing.
Definition: Types.h:510
VPI_IMAGE_TYPE_RGBA8
@ VPI_IMAGE_TYPE_RGBA8
8-bit RGBA, R having the lowest address.
Definition: Types.h:214
VPIUserFunction
VPIStatus(* VPIUserFunction)(void *)
Pointer to user function.
Definition: Types.h:546
VPI_PIXEL_TYPE_2C_F32
@ VPI_PIXEL_TYPE_2C_F32
Definition: Types.h:258
VPI_IMAGE_TYPE_Y8I
@ VPI_IMAGE_TYPE_Y8I
Definition: Types.h:222
VPI_PIXEL_TYPE_3C_U8
@ VPI_PIXEL_TYPE_3C_U8
Definition: Types.h:255
VPIKLTTrackedBoundingBox::reserved2
uint8_t reserved2
Reserved for future use.
Definition: Types.h:487
VPI_ERROR_INVALID_ARRAY_TYPE
@ VPI_ERROR_INVALID_ARRAY_TYPE
Array type not accepted.
Definition: Types.h:528
VPI_ERROR_OUT_OF_MEMORY
@ VPI_ERROR_OUT_OF_MEMORY
Not enough free memory to allocate object.
Definition: Types.h:536
VPI_ERROR_BUFFER_LOCKED
@ VPI_ERROR_BUFFER_LOCKED
Invalid operation on a locked buffer.
Definition: Types.h:535
VPI_ERROR_INVALID_PAYLOAD_TYPE
@ VPI_ERROR_INVALID_PAYLOAD_TYPE
Payload not created for this algorithm.
Definition: Types.h:530
VPIParallelForConfig::maxThreads
int maxThreads
The maximum number of threads used by the parallel_for implementation code.
Definition: Types.h:133
VPIStream
struct VPIStreamImpl * VPIStream
A handle to a stream.
Definition: Types.h:177
VPIParallelForCallback
void(* VPIParallelForCallback)(VPIParallelTask task, int taskCount, void *vpiData, void *userData)
Parallel for callback function pointer type.
Definition: Types.h:118
VPIKLTTrackedBoundingBox::templateStatus
uint8_t templateStatus
Status of the template related to this bounding box.
Definition: Types.h:483
VPI_ARRAY_TYPE_HOMOGRAPHY_TRANSFORM_2D
@ VPI_ARRAY_TYPE_HOMOGRAPHY_TRANSFORM_2D
VPIHomographyTransform2D element.
Definition: Types.h:286
VPI_INTERP_LINEAR
@ VPI_INTERP_LINEAR
Alias to fast linear interpolation.
Definition: Types.h:334
VPI_PIXEL_TYPE_2U8
@ VPI_PIXEL_TYPE_2U8
2 interleaved channels of unsigned 8-bit values.
Definition: Types.h:243
VPI_DEVICE_TYPE_PVA
@ VPI_DEVICE_TYPE_PVA
PVA backend.
Definition: Types.h:558
VPI_IMAGE_TYPE_Y16I
@ VPI_IMAGE_TYPE_Y16I
Definition: Types.h:224
VPI_INTERP_LINEAR_FAST
@ VPI_INTERP_LINEAR_FAST
Fast linear interpolation.
Definition: Types.h:329
VPI_ERROR_NOT_READY
@ VPI_ERROR_NOT_READY
Operation not completed yet, try again later.
Definition: Types.h:534
VPI_ARRAY_TYPE_INVALID
@ VPI_ARRAY_TYPE_INVALID
Signal type conversion errors.
Definition: Types.h:279
VPI_SUCCESS
@ VPI_SUCCESS
Operation completed successfully.
Definition: Types.h:524
VPICameraExtrinsic
float VPICameraExtrinsic[3][4]
Camera extrinsic matrix.
Definition: Types.h:587
VPIParallelTask
void(* VPIParallelTask)(int taskId, int threadId, void *vpiData)
Parallel task function pointer type.
Definition: Types.h:94
VPI_DEVICE_TYPE_CUDA
@ VPI_DEVICE_TYPE_CUDA
CUDA backend.
Definition: Types.h:557
VPI_PIXEL_TYPE_1C_U16
@ VPI_PIXEL_TYPE_1C_U16
Definition: Types.h:252
VPI_ARRAY_TYPE_KEYPOINT
@ VPI_ARRAY_TYPE_KEYPOINT
VPIKeypoint element.
Definition: Types.h:285
VPI_PIXEL_TYPE_S8
@ VPI_PIXEL_TYPE_S8
1 channel of signed 8-bit values.
Definition: Types.h:240
VPIArrayType
VPIArrayType
Array element formats.
Definition: Types.h:278
VPIKLTTrackedBoundingBox::trackingStatus
uint8_t trackingStatus
Tracking status of this bounding box.
Definition: Types.h:476
VPI_INTERP_CATMULL_ROM
@ VPI_INTERP_CATMULL_ROM
Alias to fast Catmull-Rom cubic interpolator.
Definition: Types.h:373
VPI_IMAGE_TYPE_INVALID
@ VPI_IMAGE_TYPE_INVALID
Signal type conversion errors.
Definition: Types.h:207
VPI_PIXEL_TYPE_2C_U8
@ VPI_PIXEL_TYPE_2C_U8
Definition: Types.h:254
VPI_INTERP_CATMULL_ROM_FAST
@ VPI_INTERP_CATMULL_ROM_FAST
Fast Catmull-Rom cubic interpolation.
Definition: Types.h:368
VPIEvent
struct VPIEventImpl * VPIEvent
A handle to an event.
Definition: Types.h:171
VPI_ARRAY_TYPE_KLT_TRACKED_BOUNDING_BOX
@ VPI_ARRAY_TYPE_KLT_TRACKED_BOUNDING_BOX
VPIKLTTrackedBoundingBox element.
Definition: Types.h:287
VPIBoundingBox
Stores a generic 2D bounding box.
Definition: Types.h:456
VPI_ERROR_INVALID_PYRAMID_TYPE
@ VPI_ERROR_INVALID_PYRAMID_TYPE
Pyramid type not accepted.
Definition: Types.h:529
VPIImage
struct VPIImageImpl * VPIImage
A handle to an image.
Definition: Types.h:183
VPI_CONVERSION_CLAMP
@ VPI_CONVERSION_CLAMP
Clamps input to output's type range.
Definition: Types.h:395
VPI_INTERP_LINEAR_PRECISE
@ VPI_INTERP_LINEAR_PRECISE
Precise linear interpolation.
Definition: Types.h:316
VPIBoundingBox::width
float width
Bounding box width.
Definition: Types.h:458
VPI_PIXEL_TYPE_U16
@ VPI_PIXEL_TYPE_U16
1 channel of unsigned 16-bit values.
Definition: Types.h:241
VPIInterpolationType
VPIInterpolationType
Interpolation types supported by several algorithms.
Definition: Types.h:295
VPI_BOUNDARY_COND_ZERO
@ VPI_BOUNDARY_COND_ZERO
All pixels outside the image are considered to be zero.
Definition: Types.h:270
VPIPayload
struct VPIPayloadImpl * VPIPayload
A handle to an algorithm payload.
Definition: Types.h:195
VPI_PIXEL_TYPE_2F32
@ VPI_PIXEL_TYPE_2F32
2 interleaved channels of 32-bit float values.
Definition: Types.h:247
VPI_IMAGE_TYPE_Y8
@ VPI_IMAGE_TYPE_Y8
Definition: Types.h:221
VPI_PIXEL_TYPE_1C_S16
@ VPI_PIXEL_TYPE_1C_S16
Definition: Types.h:253
VPI_ERROR_INVALID_OPERATION
@ VPI_ERROR_INVALID_OPERATION
Operation isn't valid in this context.
Definition: Types.h:531
VPIKLTTrackedBoundingBox::bbox
VPIBoundingBox bbox
Bounding box being tracked.
Definition: Types.h:469
VPIHomographyTransform2D
Stores a generic 2D homography transform.
Definition: Types.h:436
VPI_PIXEL_TYPE_U8
@ VPI_PIXEL_TYPE_U8
1 channel of unsigned 8-bit values.
Definition: Types.h:239
VPI_ARRAY_TYPE_S8
@ VPI_ARRAY_TYPE_S8
signed 8-bit.
Definition: Types.h:280
VPI_BOUNDARY_COND_CLAMP
@ VPI_BOUNDARY_COND_CLAMP
Border pixels are repeated indefinitely.
Definition: Types.h:271
VPI_ERROR_INTERNAL
@ VPI_ERROR_INTERNAL
Internal, non specific error.
Definition: Types.h:537
VPI_ARRAY_TYPE_U16
@ VPI_ARRAY_TYPE_U16
unsigned 16-bit.
Definition: Types.h:283
VPI_IMAGE_TYPE_U8
@ VPI_IMAGE_TYPE_U8
unsigned 8-bit grayscale.
Definition: Types.h:208
VPI_IMAGE_TYPE_BGRA8
@ VPI_IMAGE_TYPE_BGRA8
8-bit BGRA, B having the lowest address.
Definition: Types.h:218
VPI_PIXEL_TYPE_S16
@ VPI_PIXEL_TYPE_S16
1 channel of signed 16-bit values.
Definition: Types.h:242
VPI_IMAGE_TYPE_S16
@ VPI_IMAGE_TYPE_S16
signed 16-bit grayscale.
Definition: Types.h:211
VPILockMode
VPILockMode
Defines the lock modes used by memory lock functions.
Definition: Types.h:496
VPI_IMAGE_TYPE_Y16
@ VPI_IMAGE_TYPE_Y16
Definition: Types.h:223
VPIArray
struct VPIArrayImpl * VPIArray
A handle to an array.
Definition: Types.h:159
VPI_PIXEL_TYPE_1C_F32
@ VPI_PIXEL_TYPE_1C_F32
Definition: Types.h:257
VPI_IMAGE_TYPE_F32
@ VPI_IMAGE_TYPE_F32
1 channel of 32-bit float.
Definition: Types.h:215
VPI_INTERP_NEAREST
@ VPI_INTERP_NEAREST
Nearest neighbor interpolation.
Definition: Types.h:301
VPIStatus
VPIStatus
Status codes.
Definition: Types.h:523
VPIBoundingBox::xform
VPIHomographyTransform2D xform
Defines the bounding box top left corner and its homography.
Definition: Types.h:457
VPIBoundingBox::height
float height
Bounding box height.
Definition: Types.h:459
VPI_PIXEL_TYPE_3U8
@ VPI_PIXEL_TYPE_3U8
3 interleaved channels of unsigned 8-bit values.
Definition: Types.h:244
VPI_PIXEL_TYPE_DEFAULT
@ VPI_PIXEL_TYPE_DEFAULT
Used to signal that the pixel type must be inferred from image type.
Definition: Types.h:237
VPINativeThreadHandle
void * VPINativeThreadHandle
A handle to OS-specific thread handle.
Definition: Types.h:153
VPIDeviceType
VPIDeviceType
Device types.
Definition: Types.h:554
VPI_PIXEL_TYPE_1C_U8
@ VPI_PIXEL_TYPE_1C_U8
Definition: Types.h:250
VPIPerspectiveTransform
float VPIPerspectiveTransform[3][3]
Represents a 2D perspective transform.
Definition: Types.h:608
VPI_ERROR_INVALID_IMAGE_TYPE
@ VPI_ERROR_INVALID_IMAGE_TYPE
Image type not accepted.
Definition: Types.h:527
VPI_ARRAY_TYPE_U32
@ VPI_ARRAY_TYPE_U32
unsigned 32-bit.
Definition: Types.h:284
VPI_DEVICE_TYPE_INVALID
@ VPI_DEVICE_TYPE_INVALID
Invalid backend.
Definition: Types.h:555
VPIPyramid
struct VPIPyramidImpl * VPIPyramid
A handle to an image pyramid.
Definition: Types.h:189
VPIPixelType
VPIPixelType
Pixel formats.
Definition: Types.h:236
VPI_PIXEL_TYPE_4C_U8
@ VPI_PIXEL_TYPE_4C_U8
Definition: Types.h:256
VPICameraIntrinsic
float VPICameraIntrinsic[2][3]
Camera intrinsic matrix.
Definition: Types.h:574
VPIKeypoint
Stores a keypoint coordinate.
Definition: Types.h:406
VPI_CONVERSION_INVALID
@ VPI_CONVERSION_INVALID
Invalid conversion.
Definition: Types.h:383
VPI_PIXEL_TYPE_F32
@ VPI_PIXEL_TYPE_F32
1 channel of 32-bit float values.
Definition: Types.h:246
VPIKeypoint::y
float y
Keypoint's y coordinate.
Definition: Types.h:408
VPIParallelForConfig::callback
VPIParallelForCallback callback
A pointer to the parallel_for implementation.
Definition: Types.h:140