NVIDIA DeepStream SDK API Reference

9.2 Release
includes/nvbufsurftransform.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2019-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3  * SPDX-License-Identifier: Apache-2.0
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
27 #ifndef NVBUFSURFTRANSFORM_H_
28 #define NVBUFSURFTRANSFORM_H_
29 #include "nvbufsurface.h"
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
38 #define NVBUFSURF_MAX_SYNCOBJ 5
39 
40 typedef struct CUstream_st* cudaStream_t;
41 
51 typedef enum
52 {
61 
62 
66 typedef enum
67 {
85 
86 
90 typedef enum
91 {
107 
111 typedef enum
112 {
124 
128 typedef enum {
141 
143 
147 typedef enum {
159 
163 typedef struct
164 {
166  uint32_t top;
168  uint32_t left;
170  uint32_t width;
172  uint32_t height;
174  void *reserved[STRUCTURE_PADDING];
176 
181 {
185 
187  int32_t gpu_id;
188 
192 
195 
197 
202 {
204  uint32_t transform_flag;
218 
223 {
225  uint32_t composite_flag;
227  uint32_t input_buf_count;
238 
240  double red;
243  double green;
246  double blue;
249  double alpha;
254 
259 {
263  uint32_t input_buf_count;
275  uint32_t *perform_blending;
278 
280 
286 {
296  float *alpha;
300 
306 typedef struct NvBufSurfTransformSyncObj* NvBufSurfTransformSyncObj_t;
307 
321 (NvBufSurfTransformConfigParams *config_params);
322 
333 (NvBufSurfTransformConfigParams *config_params);
334 
359  NvBufSurfTransformParams *transform_params);
360 
381  NvBufSurface *dst, NvBufSurfTransformCompositeParams *composite_params);
382 
416  NvBufSurface *dst, NvBufSurfTransformParams *transform_params,
417  NvBufSurfTransformSyncObj_t *sync_obj);
418 
448  NvBufSurface *dst, NvBufSurfTransformCompositeParams *composite_params,
449  NvBufSurfTransformSyncObj_t *sync_obj);
450 
476  NvBufSurface *src1, NvBufSurface *alpha, NvBufSurface *dst,
478 
499  NvBufSurface *dst, NvBufSurfTransformCompositeBlendParamsEx *composite_blend_params);
500 
531  NvBufSurface *dst, NvBufSurfTransformCompositeBlendParamsEx *composite_blend_params,
532  NvBufSurfTransformSyncObj_t *sync_obj);
533 
534 
548 NvBufSurfTransformSyncObj_t sync_obj, uint32_t time_out);
549 
550 
562  NvBufSurfTransformSyncObj_t* sync_obj);
563 
580  int file, NvBufSurfTransformSyncObj_t* sync_obj, unsigned int *num_sync_objs);
581 
589 
591 #ifdef __cplusplus
592 }
593 #endif
594 #endif
_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: includes/nvbufsurftransform.h:270
NvBufSurfTransform_Rotate90
@ NvBufSurfTransform_Rotate90
Specifies rotating 90 degrees clockwise.
Definition: includes/nvbufsurftransform.h:71
_NvBufSurfTransformCompositeBlendParamsEx::composite_blend_filter
NvBufSurfTransform_Inter * composite_blend_filter
Holds composite filters to use for composition/blending.
Definition: includes/nvbufsurftransform.h:294
NvBufSurfTransformInter_Nearest
@ NvBufSurfTransformInter_Nearest
Specifies Nearest Interpolation Method interpolation.
Definition: includes/nvbufsurftransform.h:93
NvBufSurfTransformCompositeBlendParamsEx
struct _NvBufSurfTransformCompositeBlendParamsEx NvBufSurfTransformCompositeBlendParamsEx
Holds extended composite blend parameters for NvBufSurfTransformMultiInputBufCompositeBlend and NvBuf...
_NvBufSurfaceTransformParams::dst_rect
NvBufSurfTransformRect * dst_rect
Holds a pointer to list of destination rectangle coordinates for a crop operation.
Definition: includes/nvbufsurftransform.h:214
_NvBufSurfTransformCompositeParams
Holds composite parameters for a composite call.
Definition: includes/nvbufsurftransform.h:222
_NvBufSurfTransformConfigParams::compute_mode
NvBufSurfTransform_Compute compute_mode
Holds the mode of operation: VIC (Jetson) or GPU (iGPU + dGPU) If VIC is configured,...
Definition: includes/nvbufsurftransform.h:184
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: includes/nvbufsurftransform.h:306
NVBUFSURF_TRANSFORM_FLIP
@ NVBUFSURF_TRANSFORM_FLIP
Specifies a transform to set the flip method.
Definition: includes/nvbufsurftransform.h:136
NVBUFSURF_TRANSFORM_CROP_DST
@ NVBUFSURF_TRANSFORM_CROP_DST
Specifies a transform to crop the destination rectangle.
Definition: includes/nvbufsurftransform.h:132
NvBufSurfTransform_Rotate180
@ NvBufSurfTransform_Rotate180
Specifies rotating 180 degree clockwise.
Definition: includes/nvbufsurftransform.h:73
_NvBufSurfaceTransformParams::transform_filter
NvBufSurfTransform_Inter transform_filter
Holds a transform filter.
Definition: includes/nvbufsurftransform.h:208
NvBufSurfTransform_Composite_Flag
NvBufSurfTransform_Composite_Flag
Specifies types of composition operations.
Definition: includes/nvbufsurftransform.h:147
_NvBufSurfaceTransformParams
Holds transform parameters for a transform call.
Definition: includes/nvbufsurftransform.h:201
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: includes/nvbufsurftransform.h:285
NvBufSurfTransformError_Invalid_Params
@ NvBufSurfTransformError_Invalid_Params
Specifies invalid input parameters.
Definition: includes/nvbufsurftransform.h:116
NVBUFSURF_TRANSFORM_FILTER
@ NVBUFSURF_TRANSFORM_FILTER
Specifies a transform to set the filter type.
Definition: includes/nvbufsurftransform.h:134
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: includes/nvbufsurftransform.h:77
NvBufSurface
Holds information about batched buffers.
Definition: includes/nvbufsurface.h:602
_NvBufSurfaceTransformParams::transform_flag
uint32_t transform_flag
Holds a flag that indicates which transform parameters are valid.
Definition: includes/nvbufsurftransform.h:204
_NvBufSurfTransformCompositeBlendParamsEx::dst_comp_rect
NvBufSurfTransformRect * dst_comp_rect
Holds destination rectangle coordinates of input buffers for compositing.
Definition: includes/nvbufsurftransform.h:292
NVBUFSURF_TRANSFORM_CROP_SRC
@ NVBUFSURF_TRANSFORM_CROP_SRC
Specifies a transform to crop the source rectangle.
Definition: includes/nvbufsurftransform.h:130
_NvBufSurfTransformCompositeParams::composite_filter
NvBufSurfTransform_Inter composite_filter
Holds a composite filter.
Definition: includes/nvbufsurftransform.h:234
NvBufSurfTransform
NvBufSurfTransform_Error NvBufSurfTransform(NvBufSurface *src, NvBufSurface *dst, NvBufSurfTransformParams *transform_params)
Performs a transformation on batched input images.
_NvBufSurfTransformCompositeBlendParams::reserved
void * reserved[STRUCTURE_PADDING]
Reserved fields for future expansion.
Definition: includes/nvbufsurftransform.h:277
NvBufSurfTransformInter_Algo4
@ NvBufSurfTransformInter_Algo4
Specifies GPU-Ignored, VIC-Nicest interpolation.
Definition: includes/nvbufsurftransform.h:103
cudaStream_t
struct CUstream_st * cudaStream_t
Forward declaration of cudaStream_t.
Definition: includes/nvbufsurftransform.h:40
NvBufSurfTransformRect
Holds the coordinates of a rectangle.
Definition: includes/nvbufsurftransform.h:163
_NvBufSurfTransformCompositeParams::dst_comp_rect
NvBufSurfTransformRect * dst_comp_rect
Holds destination rectangle coordinates of input buffers for compositing.
Definition: includes/nvbufsurftransform.h:232
NVBUFSURF_TRANSFORM_ALLOW_ODD_CROP
@ NVBUFSURF_TRANSFORM_ALLOW_ODD_CROP
Specifies a transform to allow odd crop.
Definition: includes/nvbufsurftransform.h:140
_NvBufSurfTransformCompositeBlendParams::composite_blend_filter
NvBufSurfTransform_Inter composite_blend_filter
Holds a blend/composite filter applicable only
Definition: includes/nvbufsurftransform.h:265
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: includes/nvbufsurftransform.h:97
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: includes/nvbufsurftransform.h:51
_NvBufSurfTransformCompositeParams::input_buf_count
uint32_t input_buf_count
Holds the number of input buffers to be composited.
Definition: includes/nvbufsurftransform.h:227
_NvBufSurfTransformCompositeParams::composite_flag
uint32_t composite_flag
Holds a flag that indicates which composition parameters are valid.
Definition: includes/nvbufsurftransform.h:225
NVBUFSURF_TRANSFORM_COMPOSITE
@ NVBUFSURF_TRANSFORM_COMPOSITE
Specifies a flag to describe the requested compositing operation.
Definition: includes/nvbufsurftransform.h:149
NVBUFSURF_TRANSFORM_NORMALIZE
@ NVBUFSURF_TRANSFORM_NORMALIZE
Specifies a transform to normalize output.
Definition: includes/nvbufsurftransform.h:138
_NvBufSurfTransform_ColorParams::blue
double blue
Holds the blue component of color.
Definition: includes/nvbufsurftransform.h:246
STRUCTURE_PADDING
#define STRUCTURE_PADDING
Defines the default padding length for reserved fields of structures.
Definition: includes/nvbufsurface.h:53
_NvBufSurfTransformConfigParams::gpu_id
int32_t gpu_id
Holds the GPU ID to be used for processing.
Definition: includes/nvbufsurftransform.h:187
NvBufSurfTransform_ColorParams
struct _NvBufSurfTransform_ColorParams NvBufSurfTransform_ColorParams
_NvBufSurfTransform_ColorParams
Definition: includes/nvbufsurftransform.h:239
_NvBufSurfTransformConfigParams
Holds configuration parameters for a transform/composite session.
Definition: includes/nvbufsurftransform.h:180
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: includes/nvbufsurftransform.h:249
_NvBufSurfTransformCompositeBlendParams::perform_blending
uint32_t * perform_blending
Holds a boolean flag list indicating whether blending to be done for particular buffer,...
Definition: includes/nvbufsurftransform.h:275
NvBufSurfTransformError_ROI_Error
@ NvBufSurfTransformError_ROI_Error
Specifies an error in source or destination ROI.
Definition: includes/nvbufsurftransform.h:114
NvBufSurfTransformInter_Bilinear
@ NvBufSurfTransformInter_Bilinear
Specifies Bilinear Interpolation Method interpolation.
Definition: includes/nvbufsurftransform.h:95
_NvBufSurfaceTransformParams::reserved
void * reserved[STRUCTURE_PADDING]
Reserved fields for future expansion.
Definition: includes/nvbufsurftransform.h:216
NvBufSurfTransform_FlipY
@ NvBufSurfTransform_FlipY
Specifies video flip with respect to the Y-axis.
Definition: includes/nvbufsurftransform.h:79
NvBufSurfTransform_Error
NvBufSurfTransform_Error
Specifies error codes returned by NvBufSurfTransform functions.
Definition: includes/nvbufsurftransform.h:111
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: includes/nvbufsurftransform.h:57
_NvBufSurfTransformConfigParams::reserved
void * reserved[STRUCTURE_PADDING]
Reserved fields for future expansion.
Definition: includes/nvbufsurftransform.h:194
NvBufSurfTransformError_Unsupported
@ NvBufSurfTransformError_Unsupported
Specifies an unsupported feature or format.
Definition: includes/nvbufsurftransform.h:120
_NvBufSurfTransformCompositeBlendParamsEx::src_comp_rect
NvBufSurfTransformRect * src_comp_rect
Holds source rectangle coordinates of input buffers for compositing.
Definition: includes/nvbufsurftransform.h:290
_NvBufSurfTransformCompositeBlendParams::composite_blend_flag
uint32_t composite_blend_flag
Holds a flag that indicates which composition parameters are valid.
Definition: includes/nvbufsurftransform.h:261
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: includes/nvbufsurftransform.h:157
NvBufSurfTransformRect::height
uint32_t height
Holds the rectangle height.
Definition: includes/nvbufsurftransform.h:172
NvBufSurfTransform_Rotate270
@ NvBufSurfTransform_Rotate270
Specifies rotating 270 degree clockwise.
Definition: includes/nvbufsurftransform.h:75
NvBufSurfTransform_None
@ NvBufSurfTransform_None
Specifies no video flip.
Definition: includes/nvbufsurftransform.h:69
NvBufSurfTransformCompute_Default
@ NvBufSurfTransformCompute_Default
Specifies VIC as a compute device for Jetson or dGPU for an x86_64 system.
Definition: includes/nvbufsurftransform.h:55
NvBufSurfTransform_Transpose
@ NvBufSurfTransform_Transpose
Specifies video flip transpose.
Definition: includes/nvbufsurftransform.h:81
_NvBufSurfTransformCompositeParams::src_comp_rect
NvBufSurfTransformRect * src_comp_rect
Holds source rectangle coordinates of input buffers for compositing.
Definition: includes/nvbufsurftransform.h:229
NvBufSurfTransformRect::top
uint32_t top
Holds the rectangle top.
Definition: includes/nvbufsurftransform.h:166
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: includes/nvbufsurftransform.h:263
NvBufSurfTransform_Inter
NvBufSurfTransform_Inter
Specifies video interpolation methods.
Definition: includes/nvbufsurftransform.h:90
NvBufSurfTransformRect::left
uint32_t left
Holds the rectangle left side.
Definition: includes/nvbufsurftransform.h:168
NvBufSurfTransformError_Success
@ NvBufSurfTransformError_Success
Specifies a successful operation.
Definition: includes/nvbufsurftransform.h:122
NvBufSurfTransformInter_Algo2
@ NvBufSurfTransformInter_Algo2
Specifies GPU-Super, VIC-10 Tap interpolation.
Definition: includes/nvbufsurftransform.h:99
_NvBufSurfaceTransformParams::transform_flip
NvBufSurfTransform_Flip transform_flip
Holds the flip method.
Definition: includes/nvbufsurftransform.h:206
NVBUFSURF_TRANSFORM_BLEND
@ NVBUFSURF_TRANSFORM_BLEND
Specifies a flag to describe the requested blending operation.
Definition: includes/nvbufsurftransform.h:155
NvBufSurfTransformInter_Default
@ NvBufSurfTransformInter_Default
Specifies GPU-Nearest, VIC-Nearest interpolation.
Definition: includes/nvbufsurftransform.h:105
NvBufSurfTransform_Flip
NvBufSurfTransform_Flip
Specifies video flip methods.
Definition: includes/nvbufsurftransform.h:66
NvBufSurfTransform_Transform_Flag
NvBufSurfTransform_Transform_Flag
Specifies transform types.
Definition: includes/nvbufsurftransform.h:128
NvBufSurfTransform_InvTranspose
@ NvBufSurfTransform_InvTranspose
Specifies video flip inverse transpose.
Definition: includes/nvbufsurftransform.h:83
NvBufSurfTransformError_Execution_Error
@ NvBufSurfTransformError_Execution_Error
Specifies a runtime execution error.
Definition: includes/nvbufsurftransform.h:118
_NvBufSurfTransform_ColorParams::green
double green
Holds the green component of color.
Definition: includes/nvbufsurftransform.h:243
NvBufSurfTransformConfigParams
struct _NvBufSurfTransformConfigParams NvBufSurfTransformConfigParams
Holds configuration parameters for a transform/composite session.
NvBufSurfTransformRect::width
uint32_t width
Holds the rectangle width.
Definition: includes/nvbufsurftransform.h:170
_NvBufSurfTransformCompositeBlendParams
Holds composite blend parameters for a composite blender call.
Definition: includes/nvbufsurftransform.h:258
NvBufSurfTransformSetSessionParams
NvBufSurfTransform_Error NvBufSurfTransformSetSessionParams(NvBufSurfTransformConfigParams *config_params)
Sets user-defined session parameters.
_NvBufSurfTransformCompositeParams::reserved
void * reserved[STRUCTURE_PADDING]
Reserved fields for future expansion.
Definition: includes/nvbufsurftransform.h:236
_NvBufSurfTransform_ColorParams::red
double red
Holds the red component of color.
Definition: includes/nvbufsurftransform.h:240
_NvBufSurfTransform_ColorParams::reserved
void * reserved[STRUCTURE_PADDING]
Reserved fields for future expansion.
Definition: includes/nvbufsurftransform.h:252
NvBufSurfTransformCompositeBlendParams
struct _NvBufSurfTransformCompositeBlendParams NvBufSurfTransformCompositeBlendParams
Holds composite blend parameters for a composite blender call.
_NvBufSurfaceTransformParams::src_rect
NvBufSurfTransformRect * src_rect
Holds a pointer to a list of source rectangle coordinates for a crop operation.
Definition: includes/nvbufsurftransform.h:211
_NvBufSurfTransformCompositeBlendParamsEx::alpha
float * alpha
Holds alpha values of input buffers for the blending.
Definition: includes/nvbufsurftransform.h:296
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: includes/nvbufsurftransform.h:101
_NvBufSurfTransformConfigParams::cuda_stream
cudaStream_t cuda_stream
User configure stream to be used.
Definition: includes/nvbufsurftransform.h:191
nvbufsurface.h
_NvBufSurfTransformCompositeBlendParamsEx::reserved
void * reserved[STRUCTURE_PADDING]
reserved fields.
Definition: includes/nvbufsurftransform.h:298
_NvBufSurfTransformCompositeBlendParamsEx::params
NvBufSurfTransformCompositeBlendParams params
Holds legacy composite blend parameters.
Definition: includes/nvbufsurftransform.h:288
NvBufSurfTransformCompute_VIC
@ NvBufSurfTransformCompute_VIC
Specifies that the VIC as a compute device.
Definition: includes/nvbufsurftransform.h:59
NvBufSurfTransformCompositeBlend
NvBufSurfTransform_Error NvBufSurfTransformCompositeBlend(NvBufSurface *src0, NvBufSurface *src1, NvBufSurface *alpha, NvBufSurface *dst, NvBufSurfTransformCompositeBlendParams *blend_params)
Composites/Blends batched input images.