NVIDIA DeepStream SDK API Reference

8.0 Release
nvbufsurftransform.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2019-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3  * SPDX-License-Identifier: LicenseRef-NvidiaProprietary
4  *
5  * NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
6  * property and proprietary rights in and to this material, related
7  * documentation and any modifications thereto. Any use, reproduction,
8  * disclosure or distribution of this material and related documentation
9  * without an express license agreement from NVIDIA CORPORATION or
10  * its affiliates is strictly prohibited.
11  */
12 
22 #ifndef NVBUFSURFTRANSFORM_H_
23 #define NVBUFSURFTRANSFORM_H_
24 #include "nvbufsurface.h"
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
33 #define NVBUFSURF_MAX_SYNCOBJ 5
34 
35 typedef struct CUstream_st* cudaStream_t;
36 
46 typedef enum
47 {
56 
57 
61 typedef enum
62 {
80 
81 
85 typedef enum
86 {
102 
106 typedef enum
107 {
119 
123 typedef enum {
136 
138 
142 typedef enum {
154 
158 typedef struct
159 {
161  uint32_t top;
163  uint32_t left;
165  uint32_t width;
167  uint32_t height;
169  void *reserved[STRUCTURE_PADDING];
171 
176 {
180 
182  int32_t gpu_id;
183 
187 
190 
192 
197 {
199  uint32_t transform_flag;
213 
218 {
220  uint32_t composite_flag;
222  uint32_t input_buf_count;
233 
235  double red;
238  double green;
241  double blue;
244  double alpha;
249 
254 {
258  uint32_t input_buf_count;
270  uint32_t *perform_blending;
273 
275 
281 {
291  float *alpha;
295 
301 typedef struct NvBufSurfTransformSyncObj* NvBufSurfTransformSyncObj_t;
302 
316 (NvBufSurfTransformConfigParams *config_params);
317 
328 (NvBufSurfTransformConfigParams *config_params);
329 
354  NvBufSurfTransformParams *transform_params);
355 
376  NvBufSurface *dst, NvBufSurfTransformCompositeParams *composite_params);
377 
411  NvBufSurface *dst, NvBufSurfTransformParams *transform_params,
412  NvBufSurfTransformSyncObj_t *sync_obj);
413 
443  NvBufSurface *dst, NvBufSurfTransformCompositeParams *composite_params,
444  NvBufSurfTransformSyncObj_t *sync_obj);
445 
471  NvBufSurface *src1, NvBufSurface *alpha, NvBufSurface *dst,
473 
494  NvBufSurface *dst, NvBufSurfTransformCompositeBlendParamsEx *composite_blend_params);
495 
526  NvBufSurface *dst, NvBufSurfTransformCompositeBlendParamsEx *composite_blend_params,
527  NvBufSurfTransformSyncObj_t *sync_obj);
528 
529 
543 NvBufSurfTransformSyncObj_t sync_obj, uint32_t time_out);
544 
545 
557  NvBufSurfTransformSyncObj_t* sync_obj);
558 
575  int file, NvBufSurfTransformSyncObj_t* sync_obj, unsigned int *num_sync_objs);
576 
584 
586 #ifdef __cplusplus
587 }
588 #endif
589 #endif
NvBufSurfTransform_Rotate90
@ NvBufSurfTransform_Rotate90
Specifies rotating 90 degrees clockwise.
Definition: nvbufsurftransform.h:66
_NvBufSurfTransformCompositeBlendParamsEx::dst_comp_rect
NvBufSurfTransformRect * dst_comp_rect
Holds destination rectangle coordinates of input buffers for compositing.
Definition: nvbufsurftransform.h:287
NvBufSurfTransformInter_Nearest
@ NvBufSurfTransformInter_Nearest
Specifies Nearest Interpolation Method interpolation.
Definition: nvbufsurftransform.h:88
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:227
_NvBufSurfTransformCompositeParams
Holds composite parameters for a composite call.
Definition: nvbufsurftransform.h:217
_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:179
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:301
NVBUFSURF_TRANSFORM_FLIP
@ NVBUFSURF_TRANSFORM_FLIP
Specifies a transform to set the flip method.
Definition: nvbufsurftransform.h:131
NVBUFSURF_TRANSFORM_CROP_DST
@ NVBUFSURF_TRANSFORM_CROP_DST
Specifies a transform to crop the destination rectangle.
Definition: nvbufsurftransform.h:127
NvBufSurfTransform_Rotate180
@ NvBufSurfTransform_Rotate180
Specifies rotating 180 degree clockwise.
Definition: nvbufsurftransform.h:68
_NvBufSurfaceTransformParams::transform_filter
NvBufSurfTransform_Inter transform_filter
Holds a transform filter.
Definition: nvbufsurftransform.h:203
NvBufSurfTransform_Composite_Flag
NvBufSurfTransform_Composite_Flag
Specifies types of composition operations.
Definition: nvbufsurftransform.h:142
_NvBufSurfaceTransformParams
Holds transform parameters for a transform call.
Definition: nvbufsurftransform.h:196
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:280
NvBufSurfTransformError_Invalid_Params
@ NvBufSurfTransformError_Invalid_Params
Specifies invalid input parameters.
Definition: nvbufsurftransform.h:111
NVBUFSURF_TRANSFORM_FILTER
@ NVBUFSURF_TRANSFORM_FILTER
Specifies a transform to set the filter type.
Definition: nvbufsurftransform.h:129
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:72
NvBufSurface
Holds information about batched buffers.
Definition: nvbufsurface.h:577
_NvBufSurfaceTransformParams::transform_flag
uint32_t transform_flag
Holds a flag that indicates which transform parameters are valid.
Definition: nvbufsurftransform.h:199
_NvBufSurfTransform_ColorParams::reserved
void * reserved[STRUCTURE_PADDING]
Reserved fields for future expansion.
Definition: nvbufsurftransform.h:247
_NvBufSurfTransformCompositeBlendParams::perform_blending
uint32_t * perform_blending
Holds a boolean flag list indicating whether blending to be done for particular buffer,...
Definition: nvbufsurftransform.h:270
NVBUFSURF_TRANSFORM_CROP_SRC
@ NVBUFSURF_TRANSFORM_CROP_SRC
Specifies a transform to crop the source rectangle.
Definition: nvbufsurftransform.h:125
_NvBufSurfTransformCompositeParams::composite_filter
NvBufSurfTransform_Inter composite_filter
Holds a composite filter.
Definition: nvbufsurftransform.h:229
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: nvbufsurftransform.h:272
_NvBufSurfTransformCompositeBlendParamsEx::alpha
float * alpha
Holds alpha values of input buffers for the blending.
Definition: nvbufsurftransform.h:291
NvBufSurfTransformInter_Algo4
@ NvBufSurfTransformInter_Algo4
Specifies GPU-Ignored, VIC-Nicest interpolation.
Definition: nvbufsurftransform.h:98
NvBufSurfTransformRect
Holds the coordinates of a rectangle.
Definition: nvbufsurftransform.h:158
_NvBufSurfTransformCompositeBlendParamsEx::reserved
void * reserved[STRUCTURE_PADDING]
reserved fields.
Definition: nvbufsurftransform.h:293
NVBUFSURF_TRANSFORM_ALLOW_ODD_CROP
@ NVBUFSURF_TRANSFORM_ALLOW_ODD_CROP
Specifies a transform to allow odd crop.
Definition: nvbufsurftransform.h:135
_NvBufSurfTransformCompositeParams::src_comp_rect
NvBufSurfTransformRect * src_comp_rect
Holds source rectangle coordinates of input buffers for compositing.
Definition: nvbufsurftransform.h:224
_NvBufSurfTransformCompositeBlendParams::composite_blend_filter
NvBufSurfTransform_Inter composite_blend_filter
Holds a blend/composite filter applicable only
Definition: nvbufsurftransform.h:260
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:92
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:46
_NvBufSurfTransformCompositeParams::input_buf_count
uint32_t input_buf_count
Holds the number of input buffers to be composited.
Definition: nvbufsurftransform.h:222
_NvBufSurfTransformCompositeParams::composite_flag
uint32_t composite_flag
Holds a flag that indicates which composition parameters are valid.
Definition: nvbufsurftransform.h:220
NVBUFSURF_TRANSFORM_COMPOSITE
@ NVBUFSURF_TRANSFORM_COMPOSITE
Specifies a flag to describe the requested compositing operation.
Definition: nvbufsurftransform.h:144
NVBUFSURF_TRANSFORM_NORMALIZE
@ NVBUFSURF_TRANSFORM_NORMALIZE
Specifies a transform to normalize output.
Definition: nvbufsurftransform.h:133
_NvBufSurfTransform_ColorParams::blue
double blue
Holds the blue component of color.
Definition: nvbufsurftransform.h:241
_NvBufSurfaceTransformParams::reserved
void * reserved[STRUCTURE_PADDING]
Reserved fields for future expansion.
Definition: nvbufsurftransform.h:211
STRUCTURE_PADDING
#define STRUCTURE_PADDING
Defines the default padding length for reserved fields of structures.
Definition: nvbufsurface.h:48
_NvBufSurfTransformConfigParams::gpu_id
int32_t gpu_id
Holds the GPU ID to be used for processing.
Definition: nvbufsurftransform.h:182
NvBufSurfTransform_ColorParams
struct _NvBufSurfTransform_ColorParams NvBufSurfTransform_ColorParams
_NvBufSurfTransform_ColorParams
Definition: nvbufsurftransform.h:234
_NvBufSurfTransformConfigParams
Holds configuration parameters for a transform/composite session.
Definition: nvbufsurftransform.h:175
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:244
NvBufSurfTransformError_ROI_Error
@ NvBufSurfTransformError_ROI_Error
Specifies an error in source or destination ROI.
Definition: nvbufsurftransform.h:109
NvBufSurfTransformInter_Bilinear
@ NvBufSurfTransformInter_Bilinear
Specifies Bilinear Interpolation Method interpolation.
Definition: nvbufsurftransform.h:90
NvBufSurfTransform_FlipY
@ NvBufSurfTransform_FlipY
Specifies video flip with respect to the Y-axis.
Definition: nvbufsurftransform.h:74
NvBufSurfTransform_Error
NvBufSurfTransform_Error
Specifies error codes returned by NvBufSurfTransform functions.
Definition: nvbufsurftransform.h:106
cudaStream_t
struct CUstream_st * cudaStream_t
Forward declaration of cudaStream_t.
Definition: nvbufsurftransform.h:35
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:52
NvBufSurfTransformError_Unsupported
@ NvBufSurfTransformError_Unsupported
Specifies an unsupported feature or format.
Definition: nvbufsurftransform.h:115
_NvBufSurfTransformCompositeBlendParams::composite_blend_flag
uint32_t composite_blend_flag
Holds a flag that indicates which composition parameters are valid.
Definition: nvbufsurftransform.h:256
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:152
NvBufSurfTransformRect::height
uint32_t height
Holds the rectangle height.
Definition: nvbufsurftransform.h:167
NvBufSurfTransform_Rotate270
@ NvBufSurfTransform_Rotate270
Specifies rotating 270 degree clockwise.
Definition: nvbufsurftransform.h:70
NvBufSurfTransform_None
@ NvBufSurfTransform_None
Specifies no video flip.
Definition: nvbufsurftransform.h:64
NvBufSurfTransformCompute_Default
@ NvBufSurfTransformCompute_Default
Specifies VIC as a compute device for Jetson or dGPU for an x86_64 system.
Definition: nvbufsurftransform.h:50
NvBufSurfTransform_Transpose
@ NvBufSurfTransform_Transpose
Specifies video flip transpose.
Definition: nvbufsurftransform.h:76
NvBufSurfTransformRect::top
uint32_t top
Holds the rectangle top.
Definition: nvbufsurftransform.h:161
_NvBufSurfTransformCompositeBlendParamsEx::composite_blend_filter
NvBufSurfTransform_Inter * composite_blend_filter
Holds composite filters to use for composition/blending.
Definition: nvbufsurftransform.h:289
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:258
NvBufSurfTransform_Inter
NvBufSurfTransform_Inter
Specifies video interpolation methods.
Definition: nvbufsurftransform.h:85
NvBufSurfTransformRect::left
uint32_t left
Holds the rectangle left side.
Definition: nvbufsurftransform.h:163
NvBufSurfTransformError_Success
@ NvBufSurfTransformError_Success
Specifies a successful operation.
Definition: nvbufsurftransform.h:117
NvBufSurfTransformInter_Algo2
@ NvBufSurfTransformInter_Algo2
Specifies GPU-Super, VIC-10 Tap interpolation.
Definition: nvbufsurftransform.h:94
_NvBufSurfaceTransformParams::transform_flip
NvBufSurfTransform_Flip transform_flip
Holds the flip method.
Definition: nvbufsurftransform.h:201
NVBUFSURF_TRANSFORM_BLEND
@ NVBUFSURF_TRANSFORM_BLEND
Specifies a flag to describe the requested blending operation.
Definition: nvbufsurftransform.h:150
_NvBufSurfTransformCompositeBlendParamsEx::src_comp_rect
NvBufSurfTransformRect * src_comp_rect
Holds source rectangle coordinates of input buffers for compositing.
Definition: nvbufsurftransform.h:285
_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:265
NvBufSurfTransformInter_Default
@ NvBufSurfTransformInter_Default
Specifies GPU-Nearest, VIC-Nearest interpolation.
Definition: nvbufsurftransform.h:100
NvBufSurfTransform_Flip
NvBufSurfTransform_Flip
Specifies video flip methods.
Definition: nvbufsurftransform.h:61
NvBufSurfTransform_Transform_Flag
NvBufSurfTransform_Transform_Flag
Specifies transform types.
Definition: nvbufsurftransform.h:123
NvBufSurfTransform_InvTranspose
@ NvBufSurfTransform_InvTranspose
Specifies video flip inverse transpose.
Definition: nvbufsurftransform.h:78
NvBufSurfTransformError_Execution_Error
@ NvBufSurfTransformError_Execution_Error
Specifies a runtime execution error.
Definition: nvbufsurftransform.h:113
_NvBufSurfTransformCompositeParams::reserved
void * reserved[STRUCTURE_PADDING]
Reserved fields for future expansion.
Definition: nvbufsurftransform.h:231
_NvBufSurfTransform_ColorParams::green
double green
Holds the green component of color.
Definition: nvbufsurftransform.h:238
NvBufSurfTransformConfigParams
struct _NvBufSurfTransformConfigParams NvBufSurfTransformConfigParams
Holds configuration parameters for a transform/composite session.
NvBufSurfTransformRect::width
uint32_t width
Holds the rectangle width.
Definition: nvbufsurftransform.h:165
_NvBufSurfTransformCompositeBlendParams
Holds composite blend parameters for a composite blender call.
Definition: nvbufsurftransform.h:253
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:235
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:209
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:96
_NvBufSurfTransformConfigParams::cuda_stream
cudaStream_t cuda_stream
User configure stream to be used.
Definition: nvbufsurftransform.h:186
_NvBufSurfaceTransformParams::src_rect
NvBufSurfTransformRect * src_rect
Holds a pointer to a list of source rectangle coordinates for a crop operation.
Definition: nvbufsurftransform.h:206
_NvBufSurfTransformConfigParams::reserved
void * reserved[STRUCTURE_PADDING]
Reserved fields for future expansion.
Definition: nvbufsurftransform.h:189
_NvBufSurfTransformCompositeBlendParamsEx::params
NvBufSurfTransformCompositeBlendParams params
Holds legacy composite blend parameters.
Definition: nvbufsurftransform.h:283
NvBufSurfTransformCompute_VIC
@ NvBufSurfTransformCompute_VIC
Specifies that the VIC as a compute device.
Definition: nvbufsurftransform.h:54
NvBufSurfTransformCompositeBlend
NvBufSurfTransform_Error NvBufSurfTransformCompositeBlend(NvBufSurface *src0, NvBufSurface *src1, NvBufSurface *alpha, NvBufSurface *dst, NvBufSurfTransformCompositeBlendParams *blend_params)
Composites/Blends batched input images.