VPI - Vision Programming Interface

0.2.0 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 
70 #define VPI_BACKEND_DISABLE_PVA (0x01)
71 #define VPI_BACKEND_DISABLE_CPU (0x02)
72 #define VPI_BACKEND_DISABLE_CUDA (0x04)
74 #define VPI_BACKEND_ONLY_PVA \
75  (VPI_BACKEND_DISABLE_CUDA | VPI_BACKEND_DISABLE_CPU)
76 #define VPI_BACKEND_ONLY_CPU \
77  (VPI_BACKEND_DISABLE_PVA | VPI_BACKEND_DISABLE_CUDA)
78 #define VPI_BACKEND_ONLY_CUDA \
79  (VPI_BACKEND_DISABLE_PVA | VPI_BACKEND_DISABLE_CPU)
86 typedef void (*VPIParallelTask)(int taskId, int threadId, void *vpiData);
87 
109 typedef void (*VPIParallelForCallback)(VPIParallelTask task, int taskCount, void *vpiData, void *userData);
110 
113 typedef struct
114 {
122 
129 
133  void *userData;
135 
140 typedef void *VPINativeThreadHandle;
141 
146 typedef struct VPIArrayImpl *VPIArray;
147 
152 typedef struct VPIContextImpl *VPIContext;
153 
158 typedef struct VPIEventImpl *VPIEvent;
159 
164 typedef struct VPIStreamImpl *VPIStream;
165 
170 typedef struct VPIImageImpl *VPIImage;
171 
176 typedef struct VPIPyramidImpl *VPIPyramid;
177 
181 typedef struct VPIPayloadImpl *VPIPayload;
182 
189 typedef enum
190 {
213 
218 typedef enum
219 {
244 
249 typedef enum
250 {
254 
256 typedef enum
257 {
267 } VPIArrayType;
268 
272 typedef enum
273 {
280 
295 
308 
313 
329 
347 
353 
357 typedef enum
358 {
361 
366 
374 
378 typedef struct
379 {
380  float x,
381  y;
382 } VPIKeypoint;
383 
406 typedef struct
407 {
408  float mat3[3][3];
410 
424 typedef struct
425 {
427  float width,
430 
434 typedef struct
435 {
438 
444  uint8_t trackingStatus;
445 
451  uint8_t templateStatus;
452 
455  uint8_t reserved1, reserved2;
458 
462 typedef enum
463 {
467 
478 
482 
487 typedef enum
488 {
504 
509 typedef VPIStatus (*VPIUserFunction)(void *);
510 
512 typedef enum
513 {
519 
520 #ifdef __cplusplus
521 }
522 #endif
523 
524 #endif // NV_VPI_TYPES_H
VPI_PIXEL_TYPE_DEFAULT
@ VPI_PIXEL_TYPE_DEFAULT
Used to signal that the pixel type must be inferred from image type.
Definition: Types.h:220
VPI_ERROR_INVALID_CONTEXT
@ VPI_ERROR_INVALID_CONTEXT
Context is invalid or is already destroyed.
Definition: Types.h:497
VPIParallelForConfig
Definition: Types.h:114
VPIContext
struct VPIContextImpl * VPIContext
Definition: Types.h:152
VPIParallelForConfig::userData
void * userData
A user defined opaque pointer passed to callback function unaltered.
Definition: Types.h:133
VPIKeypoint::x
float x
Keypoint's x coordinate.
Definition: Types.h:380
VPIDeviceType
VPIDeviceType
Device types.
Definition: Types.h:513
VPI_PIXEL_TYPE_U16
@ VPI_PIXEL_TYPE_U16
1 channel of unsigned 16-bit values.
Definition: Types.h:224
VPI_CONVERSION_CAST
@ VPI_CONVERSION_CAST
Casts input to the output type.
Definition: Types.h:365
VPI_PIXEL_TYPE_3C_U8
@ VPI_PIXEL_TYPE_3C_U8
Definition: Types.h:238
VPIImageType
VPIImageType
Image formats.
Definition: Types.h:190
VPI_IMAGE_TYPE_Y16I
@ VPI_IMAGE_TYPE_Y16I
Definition: Types.h:208
VPIKLTTrackedBoundingBox
Stores a bounding box that is being tracked by KLT Tracker.
Definition: Types.h:435
VPI_PIXEL_TYPE_S8
@ VPI_PIXEL_TYPE_S8
1 channel of signed 8-bit values.
Definition: Types.h:223
VPIKLTTrackedBoundingBox::bbox
VPIBoundingBox bbox
Bounding box being tracked.
Definition: Types.h:437
VPI_ARRAY_TYPE_U8
@ VPI_ARRAY_TYPE_U8
unsigned 8-bit.
Definition: Types.h:260
VPI_INTERP_LINEAR_PRECISE
@ VPI_INTERP_LINEAR_PRECISE
Precise linear interpolation.
Definition: Types.h:294
VPI_PIXEL_TYPE_1C_U8
@ VPI_PIXEL_TYPE_1C_U8
Definition: Types.h:233
VPIKeypoint
Stores a keypoint coordinate.
Definition: Types.h:379
VPIKeypoint::y
float y
Keypoint's y coordinate.
Definition: Types.h:381
VPIKLTTrackedBoundingBox::trackingStatus
uint8_t trackingStatus
Tracking status of this bounding box.
Definition: Types.h:444
VPI_ERROR_INVALID_PYRAMID_TYPE
@ VPI_ERROR_INVALID_PYRAMID_TYPE
Pyramid type not accepted.
Definition: Types.h:494
VPI_INTERP_CATMULL_ROM_PRECISE
@ VPI_INTERP_CATMULL_ROM_PRECISE
Catmull-Rom cubic interpolation.
Definition: Types.h:328
VPIHomographyTransform2D
Stores a generic 2D homography transform.
Definition: Types.h:407
VPI_IMAGE_TYPE_S16
@ VPI_IMAGE_TYPE_S16
signed 16-bit grayscale.
Definition: Types.h:195
VPI_PIXEL_TYPE_1C_S8
@ VPI_PIXEL_TYPE_1C_S8
Definition: Types.h:234
VPI_ARRAY_TYPE_S16
@ VPI_ARRAY_TYPE_S16
signed 16-bit.
Definition: Types.h:261
VPI_PIXEL_TYPE_INVALID
@ VPI_PIXEL_TYPE_INVALID
Signal type conversion errors.
Definition: Types.h:221
VPI_IMAGE_TYPE_1C_F32
@ VPI_IMAGE_TYPE_1C_F32
Definition: Types.h:209
VPI_INTERP_LINEAR
@ VPI_INTERP_LINEAR
Alias to fast linear interpolation.
Definition: Types.h:312
VPI_PIXEL_TYPE_4C_U8
@ VPI_PIXEL_TYPE_4C_U8
Definition: Types.h:239
VPI_PIXEL_TYPE_2U8
@ VPI_PIXEL_TYPE_2U8
2 interleaved channels of unsigned 8-bit values.
Definition: Types.h:226
VPI_ERROR_NOT_IMPLEMENTED
@ VPI_ERROR_NOT_IMPLEMENTED
Operation isn't implemented.
Definition: Types.h:490
VPI_ERROR_INVALID_IMAGE_TYPE
@ VPI_ERROR_INVALID_IMAGE_TYPE
Image type not accepted.
Definition: Types.h:492
VPI_PIXEL_TYPE_U8
@ VPI_PIXEL_TYPE_U8
1 channel of unsigned 8-bit values.
Definition: Types.h:222
VPIParallelForConfig::maxThreads
int maxThreads
The maximum number of threads used by the parallel_for implementation code.
Definition: Types.h:121
VPIParallelForCallback
void(* VPIParallelForCallback)(VPIParallelTask task, int taskCount, void *vpiData, void *userData)
Definition: Types.h:109
VPI_INTERP_NEAREST
@ VPI_INTERP_NEAREST
Nearest neighbor interpolation.
Definition: Types.h:279
VPI_IMAGE_TYPE_BGRA8
@ VPI_IMAGE_TYPE_BGRA8
8-bit BGRA, B having the lowest address.
Definition: Types.h:202
VPI_ARRAY_TYPE_HOMOGRAPHY_TRANSFORM_2D
@ VPI_ARRAY_TYPE_HOMOGRAPHY_TRANSFORM_2D
VPIHomographyTransform2D element.
Definition: Types.h:265
VPI_ERROR_INVALID_ARRAY_TYPE
@ VPI_ERROR_INVALID_ARRAY_TYPE
Array type not accepted.
Definition: Types.h:493
VPI_ERROR_BUFFER_LOCKED
@ VPI_ERROR_BUFFER_LOCKED
Invalid operation on a locked buffer.
Definition: Types.h:500
VPI_PIXEL_TYPE_1C_S16
@ VPI_PIXEL_TYPE_1C_S16
Definition: Types.h:236
VPIPixelType
VPIPixelType
Pixel formats.
Definition: Types.h:219
VPI_LOCK_READ
@ VPI_LOCK_READ
Lock memory only for reading.
Definition: Types.h:466
VPI_ARRAY_TYPE_INVALID
@ VPI_ARRAY_TYPE_INVALID
Signal type conversion errors.
Definition: Types.h:258
VPI_ERROR_INVALID_ARGUMENT
@ VPI_ERROR_INVALID_ARGUMENT
Invalid argument, either wrong range or value not accepted.
Definition: Types.h:491
VPI_INTERP_CATMULL_ROM_FAST
@ VPI_INTERP_CATMULL_ROM_FAST
Fast Catmull-Rom cubic interpolation.
Definition: Types.h:346
VPIBoundingBox::width
float width
Bounding box width.
Definition: Types.h:427
VPI_PIXEL_TYPE_2C_U8
@ VPI_PIXEL_TYPE_2C_U8
Definition: Types.h:237
VPIParallelTask
void(* VPIParallelTask)(int taskId, int threadId, void *vpiData)
Definition: Types.h:86
VPI_PIXEL_TYPE_S16
@ VPI_PIXEL_TYPE_S16
1 channel of signed 16-bit values.
Definition: Types.h:225
VPI_ERROR_DEVICE
@ VPI_ERROR_DEVICE
Device backend error.
Definition: Types.h:498
VPI_IMAGE_TYPE_INVALID
@ VPI_IMAGE_TYPE_INVALID
Signal type conversion errors.
Definition: Types.h:191
VPI_ERROR_INTERNAL
@ VPI_ERROR_INTERNAL
Internal, non specific error.
Definition: Types.h:502
VPI_INTERP_CATMULL_ROM
@ VPI_INTERP_CATMULL_ROM
Alias to fast Catmull-Rom cubic interpolator.
Definition: Types.h:351
VPI_IMAGE_TYPE_2C_F32
@ VPI_IMAGE_TYPE_2C_F32
Definition: Types.h:210
VPI_LOCK_WRITE
@ VPI_LOCK_WRITE
Lock memory only for writing.
Definition: Types.h:477
VPI_PIXEL_TYPE_2F32
@ VPI_PIXEL_TYPE_2F32
2 interleaved channels of 32-bit float values.
Definition: Types.h:230
VPI_PIXEL_TYPE_1C_U16
@ VPI_PIXEL_TYPE_1C_U16
Definition: Types.h:235
VPI_IMAGE_TYPE_U8
@ VPI_IMAGE_TYPE_U8
unsigned 8-bit grayscale.
Definition: Types.h:192
VPI_CONVERSION_CLAMP
@ VPI_CONVERSION_CLAMP
Clamps input to output's type range.
Definition: Types.h:372
VPIKLTTrackedBoundingBox::templateStatus
uint8_t templateStatus
Status of the template related to this bounding box.
Definition: Types.h:451
VPI_ARRAY_TYPE_KEYPOINT
@ VPI_ARRAY_TYPE_KEYPOINT
VPIKeypoint element.
Definition: Types.h:264
VPIBoundingBox::height
float height
Bounding box height.
Definition: Types.h:428
VPIBoundaryCond
VPIBoundaryCond
Image boundary condition specify how pixel values outside of the image domain should be constructed.
Definition: Types.h:250
VPI_IMAGE_TYPE_Y8
@ VPI_IMAGE_TYPE_Y8
Definition: Types.h:205
VPIBoundingBox::xform
VPIHomographyTransform2D xform
Defines the bounding box top left corner and its homography.
Definition: Types.h:426
VPIArrayType
VPIArrayType
Array element formats.
Definition: Types.h:257
VPI_ERROR_NOT_READY
@ VPI_ERROR_NOT_READY
Operation not completed yet, try again later.
Definition: Types.h:499
VPIEvent
struct VPIEventImpl * VPIEvent
Definition: Types.h:158
VPI_ARRAY_TYPE_KLT_TRACKED_BOUNDING_BOX
@ VPI_ARRAY_TYPE_KLT_TRACKED_BOUNDING_BOX
VPIKLTTrackedBoundingBox element.
Definition: Types.h:266
VPI_IMAGE_TYPE_Y16
@ VPI_IMAGE_TYPE_Y16
Definition: Types.h:207
VPIImage
struct VPIImageImpl * VPIImage
Definition: Types.h:170
VPI_ERROR_OUT_OF_MEMORY
@ VPI_ERROR_OUT_OF_MEMORY
Not enough free memory to allocate object.
Definition: Types.h:501
VPIInterpolationType
VPIInterpolationType
Interpolation types supported by several algorithms.
Definition: Types.h:273
VPI_IMAGE_TYPE_BGR8
@ VPI_IMAGE_TYPE_BGR8
8-bit BGR, B having the lowest address.
Definition: Types.h:201
VPI_PIXEL_TYPE_2C_F32
@ VPI_PIXEL_TYPE_2C_F32
Definition: Types.h:241
VPI_IMAGE_TYPE_F32
@ VPI_IMAGE_TYPE_F32
1 channel of 32-bit float.
Definition: Types.h:199
VPI_DEVICE_TYPE_INVALID
@ VPI_DEVICE_TYPE_INVALID
Invalid backend.
Definition: Types.h:514
VPIStatus
VPIStatus
Error codes.
Definition: Types.h:488
VPI_PIXEL_TYPE_F32
@ VPI_PIXEL_TYPE_F32
1 channel of 32-bit float values.
Definition: Types.h:229
VPI_ERROR_INVALID_PAYLOAD_TYPE
@ VPI_ERROR_INVALID_PAYLOAD_TYPE
Payload not created for this algorithm.
Definition: Types.h:495
VPI_IMAGE_TYPE_U16
@ VPI_IMAGE_TYPE_U16
unsigned 16-bit grayscale.
Definition: Types.h:194
VPI_IMAGE_TYPE_NV12
@ VPI_IMAGE_TYPE_NV12
8-bit NV12.
Definition: Types.h:196
VPI_BOUNDARY_COND_CLAMP
@ VPI_BOUNDARY_COND_CLAMP
Border pixels are repeated indefinitely.
Definition: Types.h:252
VPI_IMAGE_TYPE_RGB8
@ VPI_IMAGE_TYPE_RGB8
8-bit RGB, R having the lowest address.
Definition: Types.h:197
VPIKLTTrackedBoundingBox::reserved2
uint8_t reserved2
Reserved for future use.
Definition: Types.h:455
VPI_PIXEL_TYPE_1C_F32
@ VPI_PIXEL_TYPE_1C_F32
Definition: Types.h:240
VPI_IMAGE_TYPE_RGBA8
@ VPI_IMAGE_TYPE_RGBA8
8-bit RGBA, R having the lowest address.
Definition: Types.h:198
VPI_PIXEL_TYPE_3U8
@ VPI_PIXEL_TYPE_3U8
3 interleaved channels of unsigned 8-bit values.
Definition: Types.h:227
VPILockMode
VPILockMode
Defines the lock modes used by memory lock functions.
Definition: Types.h:463
VPI_BOUNDARY_COND_ZERO
@ VPI_BOUNDARY_COND_ZERO
All pixels outside the image are considered to be zero.
Definition: Types.h:251
VPI_IMAGE_TYPE_Y8I
@ VPI_IMAGE_TYPE_Y8I
Definition: Types.h:206
VPI_ARRAY_TYPE_S8
@ VPI_ARRAY_TYPE_S8
signed 8-bit.
Definition: Types.h:259
VPI_CONVERSION_INVALID
@ VPI_CONVERSION_INVALID
Invalid conversion.
Definition: Types.h:360
VPI_SUCCESS
@ VPI_SUCCESS
Operation completed successfully.
Definition: Types.h:489
VPIUserFunction
VPIStatus(* VPIUserFunction)(void *)
Pointer to user function.
Definition: Types.h:509
VPI_ARRAY_TYPE_U16
@ VPI_ARRAY_TYPE_U16
unsigned 16-bit.
Definition: Types.h:262
VPI_DEVICE_TYPE_PVA
@ VPI_DEVICE_TYPE_PVA
PVA backend.
Definition: Types.h:517
VPI_IMAGE_TYPE_2F32
@ VPI_IMAGE_TYPE_2F32
2 interleaved channels of 32-bit floats.
Definition: Types.h:200
VPIPayload
struct VPIPayloadImpl * VPIPayload
A handle to an algorithm payload.
Definition: Types.h:181
VPIArray
struct VPIArrayImpl * VPIArray
Definition: Types.h:146
VPI_LOCK_READ_WRITE
@ VPI_LOCK_READ_WRITE
Lock memory for reading and writing.
Definition: Types.h:480
VPINativeThreadHandle
void * VPINativeThreadHandle
Definition: Types.h:140
VPIConversionPolicy
VPIConversionPolicy
Policy used when converting between image types.
Definition: Types.h:358
VPI_ARRAY_TYPE_U32
@ VPI_ARRAY_TYPE_U32
unsigned 32-bit.
Definition: Types.h:263
VPI_PIXEL_TYPE_4U8
@ VPI_PIXEL_TYPE_4U8
4 interleaved channels of unsigned 8-bit values.
Definition: Types.h:228
VPIStream
struct VPIStreamImpl * VPIStream
Definition: Types.h:164
VPI_ERROR_INVALID_OPERATION
@ VPI_ERROR_INVALID_OPERATION
Operation isn't valid in this context.
Definition: Types.h:496
VPIPyramid
struct VPIPyramidImpl * VPIPyramid
Definition: Types.h:176
VPI_DEVICE_TYPE_CUDA
@ VPI_DEVICE_TYPE_CUDA
CUDA backend.
Definition: Types.h:516
VPI_IMAGE_TYPE_S8
@ VPI_IMAGE_TYPE_S8
signed 8-bit grayscale.
Definition: Types.h:193
VPIBoundingBox
Stores a generic 2D bounding box.
Definition: Types.h:425
VPI_DEVICE_TYPE_CPU
@ VPI_DEVICE_TYPE_CPU
CPU backend.
Definition: Types.h:515
VPIParallelForConfig::callback
VPIParallelForCallback callback
A pointer to the parallel_for implementation.
Definition: Types.h:128
VPI_INTERP_LINEAR_FAST
@ VPI_INTERP_LINEAR_FAST
Fast linear interpolation.
Definition: Types.h:307