VPI - Vision Programming Interface

0.1.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 
69 typedef void (*VPIParallelTask)(int taskId, int threadId, void *vpiData);
70 
92 typedef void (*VPIParallelForCallback)(VPIParallelTask task, int taskCount, void *vpiData, void *userData);
93 
96 typedef struct
97 {
105 
112 
116  void *userData;
118 
123 typedef void *VPINativeThreadHandle;
124 
129 typedef struct VPIArrayImpl *VPIArray;
130 
135 typedef struct VPIContextImpl *VPIContext;
136 
141 typedef struct VPIEventImpl *VPIEvent;
142 
147 typedef struct VPIStreamImpl *VPIStream;
148 
153 typedef struct VPIImageImpl *VPIImage;
154 
159 typedef struct VPIPyramidImpl *VPIPyramid;
160 
164 typedef struct VPIPayloadImpl *VPIPayload;
165 
172 typedef enum {
181 } VPIImageType;
182 
187 typedef enum {
197 } VPIPixelType;
198 
203 typedef enum {
207 
209 typedef enum {
219 } VPIArrayType;
220 
224 typedef enum {
231 
246 
259 
275 
294 
298 typedef struct
299 {
300  float x,
301  y;
302 } VPIKeypoint;
303 
326 typedef struct
327 {
328  float mat3[3][3];
330 
344 typedef struct
345 {
347  float width,
348  height;
350 
354 typedef struct
355 {
358 
364  uint8_t trackingStatus;
365 
371  uint8_t templateStatus;
372 
375  uint8_t reserved1, reserved2;
378 
382 typedef enum
383 {
387 
398 
401 } VPILockMode;
402 
407 typedef enum {
422 } VPIStatus;
423 
428 typedef VPIStatus (*VPIUserFunction)(void *);
429 
431 typedef enum {
436 } VPIDeviceType;
437 
438 #ifdef __cplusplus
439 }
440 #endif
441 
442 #endif // NV_VPI_TYPES_H
VPI_PIXEL_TYPE_DEFAULT
Used to signal that the pixel type must be inferred from image type.
Definition: Types.h:188
VPI_ERROR_INVALID_CONTEXT
Context is invalid or is already destroyed.
Definition: Types.h:416
VPIParallelForConfig
Definition: Types.h:96
VPIContext
struct VPIContextImpl * VPIContext
Definition: Types.h:135
VPIParallelForConfig::userData
void * userData
A user defined opaque pointer passed to callback function unaltered.
Definition: Types.h:116
VPIDeviceType
VPIDeviceType
Device types.
Definition: Types.h:431
VPI_PIXEL_TYPE_3C_U8
3 interleaved channels of unsigned 8-bit values.
Definition: Types.h:195
VPIImageType
VPIImageType
Image formats.
Definition: Types.h:172
VPI_IMAGE_TYPE_Y16I
signed 16-bit grayscale/luma.
Definition: Types.h:177
VPIKLTTrackedBoundingBox
Stores a bounding box that is being tracked by KLT Tracker.
Definition: Types.h:354
VPIKLTTrackedBoundingBox::bbox
VPIBoundingBox bbox
Bounding box being tracked.
Definition: Types.h:357
VPI_ARRAY_TYPE_U8
unsigned 8-bit.
Definition: Types.h:212
VPI_PIXEL_TYPE_1C_U8
1 channel of unsigned 8-bit values.
Definition: Types.h:190
VPIKeypoint
Stores a keypoint coordinate.
Definition: Types.h:298
VPIKeypoint::y
float y
Keypoint's y coordinate.
Definition: Types.h:300
VPIKLTTrackedBoundingBox::trackingStatus
uint8_t trackingStatus
Tracking status of this bounding box.
Definition: Types.h:364
VPI_ERROR_INVALID_PYRAMID_TYPE
Pyramid type not accepted.
Definition: Types.h:413
VPIHomographyTransform2D
Stores a generic 2D homography transform.
Definition: Types.h:326
VPI_PIXEL_TYPE_1C_S8
1 channel of signed 8-bit values.
Definition: Types.h:191
VPI_ARRAY_TYPE_S16
signed 16-bit.
Definition: Types.h:213
VPI_PIXEL_TYPE_INVALID
Signal type conversion errors.
Definition: Types.h:189
VPI_INTERP_LINEAR
Linear interpolation.
Definition: Types.h:245
VPI_PIXEL_TYPE_4C_U8
4 interleaved channels of unsigned 8-bit values.
Definition: Types.h:196
VPI_ERROR_NOT_IMPLEMENTED
Operation isn't implemented.
Definition: Types.h:409
VPI_ERROR_INVALID_IMAGE_TYPE
Image type not accepted.
Definition: Types.h:411
VPIParallelForConfig::maxThreads
int maxThreads
The maximum number of threads used by the parallel_for implementation code.
Definition: Types.h:104
VPIParallelForCallback
void(* VPIParallelForCallback)(VPIParallelTask task, int taskCount, void *vpiData, void *userData)
Definition: Types.h:92
VPI_INTERP_NEAREST
Nearest neighbor interpolation.
Definition: Types.h:230
VPI_ARRAY_TYPE_HOMOGRAPHY_TRANSFORM_2D
VPIHomographyTransform2D element.
Definition: Types.h:217
VPI_ERROR_INVALID_ARRAY_TYPE
Array type not accepted.
Definition: Types.h:412
VPI_ERROR_BUFFER_LOCKED
Invalid operation on a locked buffer.
Definition: Types.h:419
VPI_PIXEL_TYPE_1C_S16
1 channel of signed 16-bit values.
Definition: Types.h:193
VPIPixelType
VPIPixelType
Pixel formats.
Definition: Types.h:187
VPI_LOCK_READ
Lock memory only for reading.
Definition: Types.h:386
VPI_ARRAY_TYPE_INVALID
Signal type conversion errors.
Definition: Types.h:210
VPI_ERROR_INVALID_ARGUMENT
Invalid argument, either wrong range or value not accepted.
Definition: Types.h:410
VPI_INTERP_CATMULL_ROM_FAST
Fast Catmull-Rom cubic interpolation.
Definition: Types.h:292
VPIBoundingBox::width
float width
Bounding box width.
Definition: Types.h:347
VPI_PIXEL_TYPE_2C_U8
2 interleaved channels of unsigned 8-bit values.
Definition: Types.h:194
VPIParallelTask
void(* VPIParallelTask)(int taskId, int threadId, void *vpiData)
Definition: Types.h:69
VPI_ERROR_DEVICE
Device backend error.
Definition: Types.h:417
VPI_IMAGE_TYPE_INVALID
Signal type conversion errors.
Definition: Types.h:173
VPI_ERROR_INTERNAL
Internal, non specific error.
Definition: Types.h:421
VPI_INTERP_CATMULL_ROM
Catmull-Rom cubic interpolation.
Definition: Types.h:274
VPI_LOCK_WRITE
Lock memory only for writing.
Definition: Types.h:397
VPI_PIXEL_TYPE_1C_U16
1 channel of unsigned 16-bit values.
Definition: Types.h:192
VPIKLTTrackedBoundingBox::templateStatus
uint8_t templateStatus
Status of the template related to this bounding box.
Definition: Types.h:371
VPI_ARRAY_TYPE_KEYPOINT
VPIKeypoint element.
Definition: Types.h:216
VPIBoundaryCond
VPIBoundaryCond
Image boundary condition specify how pixel values outside of the image domain should be constructed.
Definition: Types.h:203
VPI_IMAGE_TYPE_Y8
unsigned 8-bit grayscale/luma.
Definition: Types.h:174
VPIBoundingBox::xform
VPIHomographyTransform2D xform
Defines the bounding box top left corner and its homography.
Definition: Types.h:346
VPIArrayType
VPIArrayType
Array element formats.
Definition: Types.h:209
VPI_ERROR_NOT_READY
Operation not completed yet, try again later.
Definition: Types.h:418
VPIEvent
struct VPIEventImpl * VPIEvent
Definition: Types.h:141
VPI_ARRAY_TYPE_KLT_TRACKED_BOUNDING_BOX
VPIKLTTrackedBoundingBox element.
Definition: Types.h:218
VPI_IMAGE_TYPE_Y16
unsigned 16-bit grayscale/luma.
Definition: Types.h:176
VPIImage
struct VPIImageImpl * VPIImage
Definition: Types.h:153
VPI_ERROR_OUT_OF_MEMORY
Not enough free memory to allocate object.
Definition: Types.h:420
VPIInterpolationType
VPIInterpolationType
Interpolation types supported by several algorithms.
Definition: Types.h:224
VPI_DEVICE_TYPE_INVALID
Invalid backend.
Definition: Types.h:432
VPIStatus
VPIStatus
Error codes.
Definition: Types.h:407
VPI_ERROR_INVALID_PAYLOAD_TYPE
Payload not created for this algorithm.
Definition: Types.h:414
VPI_IMAGE_TYPE_NV12
8-bit NV12.
Definition: Types.h:178
VPI_BOUNDARY_COND_CLAMP
Border pixels are repeated indefinitely.
Definition: Types.h:205
VPI_IMAGE_TYPE_RGB8
8-bit RGB, R being the most significant byte.
Definition: Types.h:179
VPIKLTTrackedBoundingBox::reserved2
uint8_t reserved2
Reserved for future use.
Definition: Types.h:375
VPI_IMAGE_TYPE_RGBA8
8-bit RGBA, R being the MSB.
Definition: Types.h:180
VPILockMode
VPILockMode
Defines the lock modes used by memory lock functions.
Definition: Types.h:382
VPI_BOUNDARY_COND_ZERO
All pixels outside the image are considered to be zero.
Definition: Types.h:204
VPI_IMAGE_TYPE_Y8I
signed 8-bit grayscale/luma.
Definition: Types.h:175
VPI_ARRAY_TYPE_S8
signed 8-bit.
Definition: Types.h:211
VPI_SUCCESS
Operation completed successfully.
Definition: Types.h:408
VPIUserFunction
VPIStatus(* VPIUserFunction)(void *)
Pointer to user function.
Definition: Types.h:428
VPI_ARRAY_TYPE_U16
unsigned 16-bit.
Definition: Types.h:214
VPI_DEVICE_TYPE_PVA
PVA backend.
Definition: Types.h:435
VPIPayload
struct VPIPayloadImpl * VPIPayload
A handle to an algorithm payload.
Definition: Types.h:164
VPIArray
struct VPIArrayImpl * VPIArray
Definition: Types.h:129
VPI_LOCK_READ_WRITE
Lock memory for reading and writing.
Definition: Types.h:400
VPINativeThreadHandle
void * VPINativeThreadHandle
Definition: Types.h:123
VPI_ARRAY_TYPE_U32
unsigned 32-bit.
Definition: Types.h:215
VPIStream
struct VPIStreamImpl * VPIStream
Definition: Types.h:147
VPI_ERROR_INVALID_OPERATION
Operation isn't valid in this context.
Definition: Types.h:415
VPIPyramid
struct VPIPyramidImpl * VPIPyramid
Definition: Types.h:159
VPI_DEVICE_TYPE_CUDA
CUDA backend.
Definition: Types.h:434
VPIBoundingBox
Stores a generic 2D bounding box.
Definition: Types.h:344
VPI_DEVICE_TYPE_CPU
CPU backend.
Definition: Types.h:433
VPIParallelForConfig::callback
VPIParallelForCallback callback
A pointer to the parallel_for implementation.
Definition: Types.h:111
VPI_INTERP_LINEAR_FAST
Fast linear interpolation.
Definition: Types.h:258