Jetson Linux API Reference

35.2.1 Release
nvbufsurftransform.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2019-2022, 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 
29 typedef struct CUstream_st* cudaStream_t;
30 
40 typedef enum
41 {
50 
51 
55 typedef enum
56 {
74 
75 
79 typedef enum
80 {
96 
100 typedef enum
101 {
113 
117 typedef enum {
128 
130 
134 typedef enum {
146 
150 typedef struct
151 {
153  uint32_t top;
155  uint32_t left;
157  uint32_t width;
159  uint32_t height;
161 
166 {
170 
172  int32_t gpu_id;
173 
177 
179 
184 {
186  uint32_t transform_flag;
198 
203 {
205  uint32_t composite_flag;
207  uint32_t input_buf_count;
216 
218  double red;
221  double green;
224  double blue;
227  double alpha;
230 
235 {
239  uint32_t input_buf_count;
251  uint32_t *perform_blending;
252 
254 
260 {
270  float *alpha;
274 
280 typedef struct NvBufSurfTransformSyncObj* NvBufSurfTransformSyncObj_t;
281 
295 (NvBufSurfTransformConfigParams *config_params);
296 
307 (NvBufSurfTransformConfigParams *config_params);
308 
333  NvBufSurfTransformParams *transform_params);
334 
355  NvBufSurface *dst, NvBufSurfTransformCompositeParams *composite_params);
356 
390  NvBufSurface *dst, NvBufSurfTransformParams *transform_params,
391  NvBufSurfTransformSyncObj_t *sync_obj);
392 
422  NvBufSurface *dst, NvBufSurfTransformCompositeParams *composite_params,
423  NvBufSurfTransformSyncObj_t *sync_obj);
424 
450  NvBufSurface *src1, NvBufSurface *alpha, NvBufSurface *dst,
452 
473  NvBufSurface *dst, NvBufSurfTransformCompositeBlendParamsEx *composite_blend_params);
474 
505  NvBufSurface *dst, NvBufSurfTransformCompositeBlendParamsEx *composite_blend_params,
506  NvBufSurfTransformSyncObj_t *sync_obj);
507 
508 
522 NvBufSurfTransformSyncObj_t sync_obj, uint32_t time_out);
523 
524 
536  NvBufSurfTransformSyncObj_t* sync_obj);
537 
539 #ifdef __cplusplus
540 }
541 #endif
542 #endif
NvBufSurfTransform_Rotate90
@ NvBufSurfTransform_Rotate90
Specifies rotating 90 degrees clockwise.
Definition: nvbufsurftransform.h:60
_NvBufSurfTransformCompositeBlendParamsEx::dst_comp_rect
NvBufSurfTransformRect * dst_comp_rect
Holds destination rectangle coordinates of input buffers for compositing.
Definition: nvbufsurftransform.h:266
NvBufSurfTransformInter_Nearest
@ NvBufSurfTransformInter_Nearest
Specifies Nearest Interpolation Method interpolation.
Definition: nvbufsurftransform.h:82
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:212
_NvBufSurfTransformCompositeParams
Holds composite parameters for a composite call.
Definition: nvbufsurftransform.h:202
_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:169
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:280
NVBUFSURF_TRANSFORM_FLIP
@ NVBUFSURF_TRANSFORM_FLIP
Specifies a transform to set the flip method.
Definition: nvbufsurftransform.h:125
NVBUFSURF_TRANSFORM_CROP_DST
@ NVBUFSURF_TRANSFORM_CROP_DST
Specifies a transform to crop the destination rectangle.
Definition: nvbufsurftransform.h:121
NvBufSurfTransform_Rotate180
@ NvBufSurfTransform_Rotate180
Specifies rotating 180 degree clockwise.
Definition: nvbufsurftransform.h:62
_NvBufSurfaceTransformParams::transform_filter
NvBufSurfTransform_Inter transform_filter
Holds a transform filter.
Definition: nvbufsurftransform.h:190
NvBufSurfTransform_Composite_Flag
NvBufSurfTransform_Composite_Flag
Specifies types of composition operations.
Definition: nvbufsurftransform.h:134
_NvBufSurfaceTransformParams
Holds transform parameters for a transform call.
Definition: nvbufsurftransform.h:183
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:259
NvBufSurfTransformError_Invalid_Params
@ NvBufSurfTransformError_Invalid_Params
Specifies invalid input parameters.
Definition: nvbufsurftransform.h:105
NVBUFSURF_TRANSFORM_FILTER
@ NVBUFSURF_TRANSFORM_FILTER
Specifies a transform to set the filter type.
Definition: nvbufsurftransform.h:123
NvBufSurfTransformSyncObjDestroy
NvBufSurfTransform_Error NvBufSurfTransformSyncObjDestroy(NvBufSurfTransformSyncObj_t *sync_obj)
Destroy the synchroization object.
NvBufSurfTransform_FlipX
@ NvBufSurfTransform_FlipX
Specifies video flip with respect to the X-axis.
Definition: nvbufsurftransform.h:66
NvBufSurface
Holds information about batched buffers.
Definition: nvbufsurface.h:460
_NvBufSurfaceTransformParams::transform_flag
uint32_t transform_flag
Holds a flag that indicates which transform parameters are valid.
Definition: nvbufsurftransform.h:186
_NvBufSurfTransformCompositeBlendParams::perform_blending
uint32_t * perform_blending
Holds a boolean flag list indicating whether blending to be done for particular buffer,...
Definition: nvbufsurftransform.h:251
NVBUFSURF_TRANSFORM_CROP_SRC
@ NVBUFSURF_TRANSFORM_CROP_SRC
Specifies a transform to crop the source rectangle.
Definition: nvbufsurftransform.h:119
_NvBufSurfTransformCompositeParams::composite_filter
NvBufSurfTransform_Inter composite_filter
Holds a composite filter.
Definition: nvbufsurftransform.h:214
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:270
NvBufSurfTransformInter_Algo4
@ NvBufSurfTransformInter_Algo4
Specifies GPU-Ignored, VIC-Nicest interpolation.
Definition: nvbufsurftransform.h:92
NvBufSurfTransformRect
Holds the coordinates of a rectangle.
Definition: nvbufsurftransform.h:150
_NvBufSurfTransformCompositeBlendParamsEx::reserved
void * reserved[STRUCTURE_PADDING]
reserved fields.
Definition: nvbufsurftransform.h:272
_NvBufSurfTransformCompositeParams::src_comp_rect
NvBufSurfTransformRect * src_comp_rect
Holds source rectangle coordinates of input buffers for compositing.
Definition: nvbufsurftransform.h:209
_NvBufSurfTransformCompositeBlendParams::composite_blend_filter
NvBufSurfTransform_Inter composite_blend_filter
Holds a blend/composite filter applicable only
Definition: nvbufsurftransform.h:241
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:86
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:40
_NvBufSurfTransformCompositeParams::input_buf_count
uint32_t input_buf_count
Holds the number of input buffers to be composited.
Definition: nvbufsurftransform.h:207
_NvBufSurfTransformCompositeParams::composite_flag
uint32_t composite_flag
Holds a flag that indicates which composition parameters are valid.
Definition: nvbufsurftransform.h:205
NVBUFSURF_TRANSFORM_COMPOSITE
@ NVBUFSURF_TRANSFORM_COMPOSITE
Specifies a flag to describe the requested compositing operation.
Definition: nvbufsurftransform.h:136
NVBUFSURF_TRANSFORM_NORMALIZE
@ NVBUFSURF_TRANSFORM_NORMALIZE
Specifies a transform to normalize output.
Definition: nvbufsurftransform.h:127
_NvBufSurfTransform_ColorParams::blue
double blue
Holds the blue component of color.
Definition: nvbufsurftransform.h:224
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:172
NvBufSurfTransform_ColorParams
struct _NvBufSurfTransform_ColorParams NvBufSurfTransform_ColorParams
_NvBufSurfTransform_ColorParams
Definition: nvbufsurftransform.h:217
_NvBufSurfTransformConfigParams
Holds configuration parameters for a transform/composite session.
Definition: nvbufsurftransform.h:165
_NvBufSurfTransform_ColorParams::alpha
double alpha
Holds the alpha component of color.
Definition: nvbufsurftransform.h:227
NvBufSurfTransformError_ROI_Error
@ NvBufSurfTransformError_ROI_Error
Specifies an error in source or destination ROI.
Definition: nvbufsurftransform.h:103
NvBufSurfTransformInter_Bilinear
@ NvBufSurfTransformInter_Bilinear
Specifies Bilinear Interpolation Method interpolation.
Definition: nvbufsurftransform.h:84
NvBufSurfTransform_FlipY
@ NvBufSurfTransform_FlipY
Specifies video flip with respect to the Y-axis.
Definition: nvbufsurftransform.h:68
NvBufSurfTransform_Error
NvBufSurfTransform_Error
Specifies error codes returned by NvBufSurfTransform functions.
Definition: nvbufsurftransform.h:100
cudaStream_t
struct CUstream_st * cudaStream_t
Forward declaration of cudaStream_t.
Definition: nvbufsurftransform.h:29
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:46
NvBufSurfTransformError_Unsupported
@ NvBufSurfTransformError_Unsupported
Specifies an unsupported feature or format.
Definition: nvbufsurftransform.h:109
_NvBufSurfTransformCompositeBlendParams::composite_blend_flag
uint32_t composite_blend_flag
Holds a flag that indicates which composition parameters are valid.
Definition: nvbufsurftransform.h:237
NvBufSurfTransformSyncObjWait
NvBufSurfTransform_Error NvBufSurfTransformSyncObjWait(NvBufSurfTransformSyncObj_t sync_obj, uint32_t time_out)
Wait on the synchroization 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:144
NvBufSurfTransformRect::height
uint32_t height
Holds the rectangle height.
Definition: nvbufsurftransform.h:159
NvBufSurfTransform_Rotate270
@ NvBufSurfTransform_Rotate270
Specifies rotating 270 degree clockwise.
Definition: nvbufsurftransform.h:64
NvBufSurfTransform_None
@ NvBufSurfTransform_None
Specifies no video flip.
Definition: nvbufsurftransform.h:58
NvBufSurfTransformCompute_Default
@ NvBufSurfTransformCompute_Default
Specifies VIC as a compute device for Jetson or dGPU for an x86_64 system.
Definition: nvbufsurftransform.h:44
NvBufSurfTransform_Transpose
@ NvBufSurfTransform_Transpose
Specifies video flip transpose.
Definition: nvbufsurftransform.h:70
NvBufSurfTransformRect::top
uint32_t top
Holds the rectangle top.
Definition: nvbufsurftransform.h:153
_NvBufSurfTransformCompositeBlendParamsEx::composite_blend_filter
NvBufSurfTransform_Inter * composite_blend_filter
Holds composite filters to use for composition/blending.
Definition: nvbufsurftransform.h:268
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:239
NvBufSurfTransform_Inter
NvBufSurfTransform_Inter
Specifies video interpolation methods.
Definition: nvbufsurftransform.h:79
NvBufSurfTransformRect::left
uint32_t left
Holds the rectangle left side.
Definition: nvbufsurftransform.h:155
NvBufSurfTransformError_Success
@ NvBufSurfTransformError_Success
Specifies a successful operation.
Definition: nvbufsurftransform.h:111
NvBufSurfTransformInter_Algo2
@ NvBufSurfTransformInter_Algo2
Specifies GPU-Super, VIC-10 Tap interpolation.
Definition: nvbufsurftransform.h:88
_NvBufSurfaceTransformParams::transform_flip
NvBufSurfTransform_Flip transform_flip
Holds the flip method.
Definition: nvbufsurftransform.h:188
NVBUFSURF_TRANSFORM_BLEND
@ NVBUFSURF_TRANSFORM_BLEND
Specifies a flag to describe the requested blending operation.
Definition: nvbufsurftransform.h:142
_NvBufSurfTransformCompositeBlendParamsEx::src_comp_rect
NvBufSurfTransformRect * src_comp_rect
Holds source rectangle coordinates of input buffers for compositing.
Definition: nvbufsurftransform.h:264
_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:246
NvBufSurfTransformInter_Default
@ NvBufSurfTransformInter_Default
Specifies GPU-Nearest, VIC-Nearest interpolation.
Definition: nvbufsurftransform.h:94
NvBufSurfTransform_Flip
NvBufSurfTransform_Flip
Specifies video flip methods.
Definition: nvbufsurftransform.h:55
NvBufSurfTransform_Transform_Flag
NvBufSurfTransform_Transform_Flag
Specifies transform types.
Definition: nvbufsurftransform.h:117
NvBufSurfTransform_InvTranspose
@ NvBufSurfTransform_InvTranspose
Specifies video flip inverse transpose.
Definition: nvbufsurftransform.h:72
NvBufSurfTransformError_Execution_Error
@ NvBufSurfTransformError_Execution_Error
Specifies a runtime execution error.
Definition: nvbufsurftransform.h:107
_NvBufSurfTransform_ColorParams::green
double green
Holds the green component of color.
Definition: nvbufsurftransform.h:221
NvBufSurfTransformConfigParams
struct _NvBufSurfTransformConfigParams NvBufSurfTransformConfigParams
Holds configuration parameters for a transform/composite session.
NvBufSurfTransformRect::width
uint32_t width
Holds the rectangle width.
Definition: nvbufsurftransform.h:157
_NvBufSurfTransformCompositeBlendParams
Holds composite blend parameters for a composite blender call.
Definition: nvbufsurftransform.h:234
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:218
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:196
NvBufSurfTransformInter_Algo3
@ NvBufSurfTransformInter_Algo3
Specifies GPU-Lanzos, VIC-Smart interpolation.
Definition: nvbufsurftransform.h:90
_NvBufSurfTransformConfigParams::cuda_stream
cudaStream_t cuda_stream
User configure stream to be used.
Definition: nvbufsurftransform.h:176
_NvBufSurfaceTransformParams::src_rect
NvBufSurfTransformRect * src_rect
Holds a pointer to a list of source rectangle coordinates for a crop operation.
Definition: nvbufsurftransform.h:193
_NvBufSurfTransformCompositeBlendParamsEx::params
NvBufSurfTransformCompositeBlendParams params
Holds legacy composite blend parameters.
Definition: nvbufsurftransform.h:262
NvBufSurfTransformCompute_VIC
@ NvBufSurfTransformCompute_VIC
Specifies that the VIC as a compute device.
Definition: nvbufsurftransform.h:48
NvBufSurfTransformCompositeBlend
NvBufSurfTransform_Error NvBufSurfTransformCompositeBlend(NvBufSurface *src0, NvBufSurface *src1, NvBufSurface *alpha, NvBufSurface *dst, NvBufSurfTransformCompositeBlendParams *blend_params)
Composites/Blends batched input images.