NVIDIA DeepStream SDK API Reference

7.0 Release
nvbufsurftransform.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2019-2024, NVIDIA CORPORATION. All rights reserved.
3  *
4  * NVIDIA Corporation and its licensors retain all intellectual property
5  * and proprietary rights in and to this software, related documentation
6  * and any modifications thereto. Any use, reproduction, disclosure or
7  * distribution of this software and related documentation without an express
8  * license agreement from NVIDIA Corporation is strictly prohibited.
9  *
10  */
11 
21 #ifndef NVBUFSURFTRANSFORM_H_
22 #define NVBUFSURFTRANSFORM_H_
23 #include "nvbufsurface.h"
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
32 #define NVBUFSURF_MAX_SYNCOBJ 5
33 
34 typedef struct CUstream_st* cudaStream_t;
35 
45 typedef enum
46 {
55 
56 
60 typedef enum
61 {
79 
80 
84 typedef enum
85 {
101 
105 typedef enum
106 {
118 
122 typedef enum {
135 
137 
141 typedef enum {
153 
157 typedef struct
158 {
160  uint32_t top;
162  uint32_t left;
164  uint32_t width;
166  uint32_t height;
168 
173 {
177 
179  int32_t gpu_id;
180 
184 
186 
191 {
193  uint32_t transform_flag;
205 
210 {
212  uint32_t composite_flag;
214  uint32_t input_buf_count;
223 
225  double red;
228  double green;
231  double blue;
234  double alpha;
237 
242 {
246  uint32_t input_buf_count;
258  uint32_t *perform_blending;
259 
261 
267 {
277  float *alpha;
281 
287 typedef struct NvBufSurfTransformSyncObj* NvBufSurfTransformSyncObj_t;
288 
302 (NvBufSurfTransformConfigParams *config_params);
303 
314 (NvBufSurfTransformConfigParams *config_params);
315 
340  NvBufSurfTransformParams *transform_params);
341 
362  NvBufSurface *dst, NvBufSurfTransformCompositeParams *composite_params);
363 
397  NvBufSurface *dst, NvBufSurfTransformParams *transform_params,
398  NvBufSurfTransformSyncObj_t *sync_obj);
399 
429  NvBufSurface *dst, NvBufSurfTransformCompositeParams *composite_params,
430  NvBufSurfTransformSyncObj_t *sync_obj);
431 
457  NvBufSurface *src1, NvBufSurface *alpha, NvBufSurface *dst,
459 
480  NvBufSurface *dst, NvBufSurfTransformCompositeBlendParamsEx *composite_blend_params);
481 
512  NvBufSurface *dst, NvBufSurfTransformCompositeBlendParamsEx *composite_blend_params,
513  NvBufSurfTransformSyncObj_t *sync_obj);
514 
515 
529 NvBufSurfTransformSyncObj_t sync_obj, uint32_t time_out);
530 
531 
543  NvBufSurfTransformSyncObj_t* sync_obj);
544 
561  int file, NvBufSurfTransformSyncObj_t* sync_obj, unsigned int *num_sync_objs);
562 
570 
572 #ifdef __cplusplus
573 }
574 #endif
575 #endif
NvBufSurfTransform_Rotate90
@ NvBufSurfTransform_Rotate90
Specifies rotating 90 degrees clockwise.
Definition: nvbufsurftransform.h:65
_NvBufSurfTransformCompositeBlendParamsEx::dst_comp_rect
NvBufSurfTransformRect * dst_comp_rect
Holds destination rectangle coordinates of input buffers for compositing.
Definition: nvbufsurftransform.h:273
NvBufSurfTransformInter_Nearest
@ NvBufSurfTransformInter_Nearest
Specifies Nearest Interpolation Method interpolation.
Definition: nvbufsurftransform.h:87
NvBufSurfTransformCompositeBlendParamsEx
struct _NvBufSurfTransformCompositeBlendParamsEx NvBufSurfTransformCompositeBlendParamsEx
Holds extended composite blend parameters for NvBufSurfTransformMultiInputBufCompositeBlend and NvBuf...
_NvBufSurfTransformCompositeParams::dst_comp_rect
NvBufSurfTransformRect * dst_comp_rect
Holds destination rectangle coordinates of input buffers for compositing.
Definition: nvbufsurftransform.h:219
_NvBufSurfTransformCompositeParams
Holds composite parameters for a composite call.
Definition: nvbufsurftransform.h:209
_NvBufSurfTransformConfigParams::compute_mode
NvBufSurfTransform_Compute compute_mode
Holds the mode of operation: VIC (Jetson) or GPU (iGPU + dGPU) If VIC is configured,...
Definition: nvbufsurftransform.h:176
NvBufSurfTransformComposite
NvBufSurfTransform_Error NvBufSurfTransformComposite(NvBufSurface *src, NvBufSurface *dst, NvBufSurfTransformCompositeParams *composite_params)
Composites batched input images.
NvBufSurfTransformSyncObj_t
struct NvBufSurfTransformSyncObj * NvBufSurfTransformSyncObj_t
Holds the information about synchronization objects for asynchronous transform/composite APIs.
Definition: nvbufsurftransform.h:287
NVBUFSURF_TRANSFORM_FLIP
@ NVBUFSURF_TRANSFORM_FLIP
Specifies a transform to set the flip method.
Definition: nvbufsurftransform.h:130
NVBUFSURF_TRANSFORM_CROP_DST
@ NVBUFSURF_TRANSFORM_CROP_DST
Specifies a transform to crop the destination rectangle.
Definition: nvbufsurftransform.h:126
NvBufSurfTransform_Rotate180
@ NvBufSurfTransform_Rotate180
Specifies rotating 180 degree clockwise.
Definition: nvbufsurftransform.h:67
_NvBufSurfaceTransformParams::transform_filter
NvBufSurfTransform_Inter transform_filter
Holds a transform filter.
Definition: nvbufsurftransform.h:197
NvBufSurfTransform_Composite_Flag
NvBufSurfTransform_Composite_Flag
Specifies types of composition operations.
Definition: nvbufsurftransform.h:141
_NvBufSurfaceTransformParams
Holds transform parameters for a transform call.
Definition: nvbufsurftransform.h:190
NvBufSurfTransformGetSessionParams
NvBufSurfTransform_Error NvBufSurfTransformGetSessionParams(NvBufSurfTransformConfigParams *config_params)
Gets the session parameters used by NvBufSurfTransform().
_NvBufSurfTransformCompositeBlendParamsEx
Holds extended composite blend parameters for NvBufSurfTransformMultiInputBufCompositeBlend and NvBuf...
Definition: nvbufsurftransform.h:266
NvBufSurfTransformError_Invalid_Params
@ NvBufSurfTransformError_Invalid_Params
Specifies invalid input parameters.
Definition: nvbufsurftransform.h:110
NVBUFSURF_TRANSFORM_FILTER
@ NVBUFSURF_TRANSFORM_FILTER
Specifies a transform to set the filter type.
Definition: nvbufsurftransform.h:128
NvBufSurfTransformSyncObjDestroy
NvBufSurfTransform_Error NvBufSurfTransformSyncObjDestroy(NvBufSurfTransformSyncObj_t *sync_obj)
Destroy the synchronization object.
NvBufSurfTransform_FlipX
@ NvBufSurfTransform_FlipX
Specifies video flip with respect to the X-axis.
Definition: nvbufsurftransform.h:71
NvBufSurface
Holds information about batched buffers.
Definition: nvbufsurface.h:509
_NvBufSurfaceTransformParams::transform_flag
uint32_t transform_flag
Holds a flag that indicates which transform parameters are valid.
Definition: nvbufsurftransform.h:193
_NvBufSurfTransformCompositeBlendParams::perform_blending
uint32_t * perform_blending
Holds a boolean flag list indicating whether blending to be done for particular buffer,...
Definition: nvbufsurftransform.h:258
NVBUFSURF_TRANSFORM_CROP_SRC
@ NVBUFSURF_TRANSFORM_CROP_SRC
Specifies a transform to crop the source rectangle.
Definition: nvbufsurftransform.h:124
_NvBufSurfTransformCompositeParams::composite_filter
NvBufSurfTransform_Inter composite_filter
Holds a composite filter.
Definition: nvbufsurftransform.h:221
NvBufSurfTransform
NvBufSurfTransform_Error NvBufSurfTransform(NvBufSurface *src, NvBufSurface *dst, NvBufSurfTransformParams *transform_params)
Performs a transformation on batched input images.
_NvBufSurfTransformCompositeBlendParamsEx::alpha
float * alpha
Holds alpha values of input buffers for the blending.
Definition: nvbufsurftransform.h:277
NvBufSurfTransformInter_Algo4
@ NvBufSurfTransformInter_Algo4
Specifies GPU-Ignored, VIC-Nicest interpolation.
Definition: nvbufsurftransform.h:97
NvBufSurfTransformRect
Holds the coordinates of a rectangle.
Definition: nvbufsurftransform.h:157
_NvBufSurfTransformCompositeBlendParamsEx::reserved
void * reserved[STRUCTURE_PADDING]
reserved fields.
Definition: nvbufsurftransform.h:279
NVBUFSURF_TRANSFORM_ALLOW_ODD_CROP
@ NVBUFSURF_TRANSFORM_ALLOW_ODD_CROP
Specifies a transform to allow odd crop.
Definition: nvbufsurftransform.h:134
_NvBufSurfTransformCompositeParams::src_comp_rect
NvBufSurfTransformRect * src_comp_rect
Holds source rectangle coordinates of input buffers for compositing.
Definition: nvbufsurftransform.h:216
_NvBufSurfTransformCompositeBlendParams::composite_blend_filter
NvBufSurfTransform_Inter composite_blend_filter
Holds a blend/composite filter applicable only
Definition: nvbufsurftransform.h:248
NvBufSurfTransformCompositeParams
struct _NvBufSurfTransformCompositeParams NvBufSurfTransformCompositeParams
Holds composite parameters for a composite call.
NvBufSurfTransformParams
struct _NvBufSurfaceTransformParams NvBufSurfTransformParams
Holds transform parameters for a transform call.
NvBufSurfTransformInter_Algo1
@ NvBufSurfTransformInter_Algo1
Specifies GPU-Cubic, VIC-5 Tap interpolation.
Definition: nvbufsurftransform.h:91
NvBufSurfTransformCompositeAsync
NvBufSurfTransform_Error NvBufSurfTransformCompositeAsync(NvBufSurface *src, NvBufSurface *dst, NvBufSurfTransformCompositeParams *composite_params, NvBufSurfTransformSyncObj_t *sync_obj)
Composites batched input images Asynchronously (non-blocking).
NvBufSurfTransform_Compute
NvBufSurfTransform_Compute
Specifies compute devices used by NvBufSurfTransform.
Definition: nvbufsurftransform.h:45
_NvBufSurfTransformCompositeParams::input_buf_count
uint32_t input_buf_count
Holds the number of input buffers to be composited.
Definition: nvbufsurftransform.h:214
_NvBufSurfTransformCompositeParams::composite_flag
uint32_t composite_flag
Holds a flag that indicates which composition parameters are valid.
Definition: nvbufsurftransform.h:212
NVBUFSURF_TRANSFORM_COMPOSITE
@ NVBUFSURF_TRANSFORM_COMPOSITE
Specifies a flag to describe the requested compositing operation.
Definition: nvbufsurftransform.h:143
NVBUFSURF_TRANSFORM_NORMALIZE
@ NVBUFSURF_TRANSFORM_NORMALIZE
Specifies a transform to normalize output.
Definition: nvbufsurftransform.h:132
_NvBufSurfTransform_ColorParams::blue
double blue
Holds the blue component of color.
Definition: nvbufsurftransform.h:231
STRUCTURE_PADDING
#define STRUCTURE_PADDING
Defines the default padding length for reserved fields of structures.
Definition: nvbufsurface.h:46
_NvBufSurfTransformConfigParams::gpu_id
int32_t gpu_id
Holds the GPU ID to be used for processing.
Definition: nvbufsurftransform.h:179
NvBufSurfTransform_ColorParams
struct _NvBufSurfTransform_ColorParams NvBufSurfTransform_ColorParams
_NvBufSurfTransform_ColorParams
Definition: nvbufsurftransform.h:224
_NvBufSurfTransformConfigParams
Holds configuration parameters for a transform/composite session.
Definition: nvbufsurftransform.h:172
NvBufSurfTransformSetDefaultSession
NvBufSurfTransform_Error NvBufSurfTransformSetDefaultSession(void)
Sets the default transform session as the current session for all upcoming transforms.
_NvBufSurfTransform_ColorParams::alpha
double alpha
Holds the alpha component of color.
Definition: nvbufsurftransform.h:234
NvBufSurfTransformError_ROI_Error
@ NvBufSurfTransformError_ROI_Error
Specifies an error in source or destination ROI.
Definition: nvbufsurftransform.h:108
NvBufSurfTransformInter_Bilinear
@ NvBufSurfTransformInter_Bilinear
Specifies Bilinear Interpolation Method interpolation.
Definition: nvbufsurftransform.h:89
NvBufSurfTransform_FlipY
@ NvBufSurfTransform_FlipY
Specifies video flip with respect to the Y-axis.
Definition: nvbufsurftransform.h:73
NvBufSurfTransform_Error
NvBufSurfTransform_Error
Specifies error codes returned by NvBufSurfTransform functions.
Definition: nvbufsurftransform.h:105
cudaStream_t
struct CUstream_st * cudaStream_t
Forward declaration of cudaStream_t.
Definition: nvbufsurftransform.h:34
NvBufSurfTransformMultiInputBufCompositeBlendAsync
NvBufSurfTransform_Error NvBufSurfTransformMultiInputBufCompositeBlendAsync(NvBufSurface **src, NvBufSurface *dst, NvBufSurfTransformCompositeBlendParamsEx *composite_blend_params, NvBufSurfTransformSyncObj_t *sync_obj)
Performs Composition and Blending on multiple input images(batch size=1) and provide single output im...
NvBufSurfTransformCompute_GPU
@ NvBufSurfTransformCompute_GPU
Specifies that the GPU is the compute device.
Definition: nvbufsurftransform.h:51
NvBufSurfTransformError_Unsupported
@ NvBufSurfTransformError_Unsupported
Specifies an unsupported feature or format.
Definition: nvbufsurftransform.h:114
_NvBufSurfTransformCompositeBlendParams::composite_blend_flag
uint32_t composite_blend_flag
Holds a flag that indicates which composition parameters are valid.
Definition: nvbufsurftransform.h:244
NvBufSurfTransformSyncObjWait
NvBufSurfTransform_Error NvBufSurfTransformSyncObjWait(NvBufSurfTransformSyncObj_t sync_obj, uint32_t time_out)
Wait on the synchronization object.
NvBufSurfTransformAsync
NvBufSurfTransform_Error NvBufSurfTransformAsync(NvBufSurface *src, NvBufSurface *dst, NvBufSurfTransformParams *transform_params, NvBufSurfTransformSyncObj_t *sync_obj)
An asynchronous (non-blocking) transformation on batched input images.
NVBUFSURF_TRANSFORM_COMPOSITE_FILTER
@ NVBUFSURF_TRANSFORM_COMPOSITE_FILTER
Specifies a composite to set the filter type.
Definition: nvbufsurftransform.h:151
NvBufSurfTransformRect::height
uint32_t height
Holds the rectangle height.
Definition: nvbufsurftransform.h:166
NvBufSurfTransform_Rotate270
@ NvBufSurfTransform_Rotate270
Specifies rotating 270 degree clockwise.
Definition: nvbufsurftransform.h:69
NvBufSurfTransform_None
@ NvBufSurfTransform_None
Specifies no video flip.
Definition: nvbufsurftransform.h:63
NvBufSurfTransformCompute_Default
@ NvBufSurfTransformCompute_Default
Specifies VIC as a compute device for Jetson or dGPU for an x86_64 system.
Definition: nvbufsurftransform.h:49
NvBufSurfTransform_Transpose
@ NvBufSurfTransform_Transpose
Specifies video flip transpose.
Definition: nvbufsurftransform.h:75
NvBufSurfTransformRect::top
uint32_t top
Holds the rectangle top.
Definition: nvbufsurftransform.h:160
_NvBufSurfTransformCompositeBlendParamsEx::composite_blend_filter
NvBufSurfTransform_Inter * composite_blend_filter
Holds composite filters to use for composition/blending.
Definition: nvbufsurftransform.h:275
NvBufSurfTransformMultiInputBufCompositeBlend
NvBufSurfTransform_Error NvBufSurfTransformMultiInputBufCompositeBlend(NvBufSurface **src, NvBufSurface *dst, NvBufSurfTransformCompositeBlendParamsEx *composite_blend_params)
Performs Composition and Blending on multiple input images(batch size=1) and provide single output im...
_NvBufSurfTransformCompositeBlendParams::input_buf_count
uint32_t input_buf_count
Holds the number of input buffers to be composited.
Definition: nvbufsurftransform.h:246
NvBufSurfTransform_Inter
NvBufSurfTransform_Inter
Specifies video interpolation methods.
Definition: nvbufsurftransform.h:84
NvBufSurfTransformRect::left
uint32_t left
Holds the rectangle left side.
Definition: nvbufsurftransform.h:162
NvBufSurfTransformError_Success
@ NvBufSurfTransformError_Success
Specifies a successful operation.
Definition: nvbufsurftransform.h:116
NvBufSurfTransformInter_Algo2
@ NvBufSurfTransformInter_Algo2
Specifies GPU-Super, VIC-10 Tap interpolation.
Definition: nvbufsurftransform.h:93
_NvBufSurfaceTransformParams::transform_flip
NvBufSurfTransform_Flip transform_flip
Holds the flip method.
Definition: nvbufsurftransform.h:195
NVBUFSURF_TRANSFORM_BLEND
@ NVBUFSURF_TRANSFORM_BLEND
Specifies a flag to describe the requested blending operation.
Definition: nvbufsurftransform.h:149
_NvBufSurfTransformCompositeBlendParamsEx::src_comp_rect
NvBufSurfTransformRect * src_comp_rect
Holds source rectangle coordinates of input buffers for compositing.
Definition: nvbufsurftransform.h:271
_NvBufSurfTransformCompositeBlendParams::color_bg
NvBufSurfTransform_ColorParams * color_bg
Holds background color list for blending if background buffer is absent, if NULL it wont be used,...
Definition: nvbufsurftransform.h:253
NvBufSurfTransformInter_Default
@ NvBufSurfTransformInter_Default
Specifies GPU-Nearest, VIC-Nearest interpolation.
Definition: nvbufsurftransform.h:99
NvBufSurfTransform_Flip
NvBufSurfTransform_Flip
Specifies video flip methods.
Definition: nvbufsurftransform.h:60
NvBufSurfTransform_Transform_Flag
NvBufSurfTransform_Transform_Flag
Specifies transform types.
Definition: nvbufsurftransform.h:122
NvBufSurfTransform_InvTranspose
@ NvBufSurfTransform_InvTranspose
Specifies video flip inverse transpose.
Definition: nvbufsurftransform.h:77
NvBufSurfTransformError_Execution_Error
@ NvBufSurfTransformError_Execution_Error
Specifies a runtime execution error.
Definition: nvbufsurftransform.h:112
_NvBufSurfTransform_ColorParams::green
double green
Holds the green component of color.
Definition: nvbufsurftransform.h:228
NvBufSurfTransformConfigParams
struct _NvBufSurfTransformConfigParams NvBufSurfTransformConfigParams
Holds configuration parameters for a transform/composite session.
NvBufSurfTransformRect::width
uint32_t width
Holds the rectangle width.
Definition: nvbufsurftransform.h:164
_NvBufSurfTransformCompositeBlendParams
Holds composite blend parameters for a composite blender call.
Definition: nvbufsurftransform.h:241
NvBufSurfTransformSetSessionParams
NvBufSurfTransform_Error NvBufSurfTransformSetSessionParams(NvBufSurfTransformConfigParams *config_params)
Sets user-defined session parameters.
_NvBufSurfTransform_ColorParams::red
double red
Holds the red component of color.
Definition: nvbufsurftransform.h:225
NvBufSurfTransformCompositeBlendParams
struct _NvBufSurfTransformCompositeBlendParams NvBufSurfTransformCompositeBlendParams
Holds composite blend parameters for a composite blender call.
nvbufsurface.h
_NvBufSurfaceTransformParams::dst_rect
NvBufSurfTransformRect * dst_rect
Holds a pointer to list of destination rectangle coordinates for a crop operation.
Definition: nvbufsurftransform.h:203
NvBufSurfTransformSyncObjFromFile
NvBufSurfTransform_Error NvBufSurfTransformSyncObjFromFile(int file, NvBufSurfTransformSyncObj_t *sync_obj, unsigned int *num_sync_objs)
Get the synchronization object from sync point FD.
NvBufSurfTransformInter_Algo3
@ NvBufSurfTransformInter_Algo3
Specifies GPU-Lanzos, VIC-Smart interpolation.
Definition: nvbufsurftransform.h:95
_NvBufSurfTransformConfigParams::cuda_stream
cudaStream_t cuda_stream
User configure stream to be used.
Definition: nvbufsurftransform.h:183
_NvBufSurfaceTransformParams::src_rect
NvBufSurfTransformRect * src_rect
Holds a pointer to a list of source rectangle coordinates for a crop operation.
Definition: nvbufsurftransform.h:200
_NvBufSurfTransformCompositeBlendParamsEx::params
NvBufSurfTransformCompositeBlendParams params
Holds legacy composite blend parameters.
Definition: nvbufsurftransform.h:269
NvBufSurfTransformCompute_VIC
@ NvBufSurfTransformCompute_VIC
Specifies that the VIC as a compute device.
Definition: nvbufsurftransform.h:53
NvBufSurfTransformCompositeBlend
NvBufSurfTransform_Error NvBufSurfTransformCompositeBlend(NvBufSurface *src0, NvBufSurface *src1, NvBufSurface *alpha, NvBufSurface *dst, NvBufSurfTransformCompositeBlendParams *blend_params)
Composites/Blends batched input images.