NVIDIA DeepStream SDK API Reference

4.0.2 Release

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
nvbufsurftransform.h File Reference

Detailed Description

Copyright (c) 2019, NVIDIA CORPORATION.

All rights reserved.

NVIDIA Corporation and its licensors retain all intellectual property and proprietary rights in and to this software, related documentation and any modifications thereto. Any use, reproduction, disclosure or distribution of this software and related documentation without an express license agreement from NVIDIA Corporation is strictly prohibited.

NvBufSurfTransform Interface

This file specifies the NvBufSurfTransform image transformation APIs.

NvBufSurfTransform APIs provides methods to set / get session parameters and transform / composite APIs.

Definition in file nvbufsurftransform.h.

Go to the source code of this file.

Data Structures

struct  NvBufSurfTransformRect
 Holds coordinates for a rectangle. More...
 
struct  _NvBufSurfTransformConfigParams
 Holds configuration parameters for Transform/Composite Session. More...
 
struct  _NvBufSurfaceTransformParams
 Holds Transform parameters for Transform Call. More...
 
struct  _NvBufSurfTransformCompositeParams
 Holds Composite parameters for Composite Call. More...
 

NvBufSurfTransform types and functions.

This section describes types and functions of NvBufSurfTransform application programming interface.

enum  NvBufSurfTransform_Compute {
  NvBufSurfTransformCompute_Default,
  NvBufSurfTransformCompute_GPU,
  NvBufSurfTransformCompute_VIC
}
 Defines compute devices used by NvBufSurfTransform. More...
 
enum  NvBufSurfTransform_Flip {
  NvBufSurfTransform_None,
  NvBufSurfTransform_Rotate90,
  NvBufSurfTransform_Rotate180,
  NvBufSurfTransform_Rotate270,
  NvBufSurfTransform_FlipX,
  NvBufSurfTransform_FlipY,
  NvBufSurfTransform_Transpose,
  NvBufSurfTransform_InvTranspose
}
 Defines video flip methods. More...
 
enum  NvBufSurfTransform_Inter {
  NvBufSurfTransformInter_Nearest = 0,
  NvBufSurfTransformInter_Bilinear,
  NvBufSurfTransformInter_Algo1,
  NvBufSurfTransformInter_Algo2,
  NvBufSurfTransformInter_Algo3,
  NvBufSurfTransformInter_Algo4,
  NvBufSurfTransformInter_Default
}
 Defines video interpolation methods. More...
 
enum  NvBufSurfTransform_Error {
  NvBufSurfTransformError_ROI_Error = -4,
  NvBufSurfTransformError_Invalid_Params = -3,
  NvBufSurfTransformError_Execution_Error = -2,
  NvBufSurfTransformError_Unsupported = -1,
  NvBufSurfTransformError_Success = 0
}
 Defines Error codes returned by NvBufSurfTransform APIs. More...
 
enum  NvBufSurfTransform_Transform_Flag {
  NVBUFSURF_TRANSFORM_CROP_SRC = 1,
  NVBUFSURF_TRANSFORM_CROP_DST = 1 << 1,
  NVBUFSURF_TRANSFORM_FILTER = 1 << 2,
  NVBUFSURF_TRANSFORM_FLIP = 1 << 3
}
 Defines flags to indicate for valid transform. More...
 
enum  NvBufSurfTransform_Composite_Flag { NVBUFSURF_TRANSFORM_COMPOSITE = 1 }
 Defines flags that specify valid composition operations. More...
 
typedef struct
_NvBufSurfTransformConfigParams 
NvBufSurfTransformConfigParams
 Holds configuration parameters for Transform/Composite Session. More...
 
typedef struct
_NvBufSurfaceTransformParams 
NvBufSurfTransformParams
 Holds Transform parameters for Transform Call. More...
 
typedef struct
_NvBufSurfTransformCompositeParams 
NvBufSurfTransformCompositeParams
 Holds Composite parameters for Composite Call. More...
 
NvBufSurfTransform_Error NvBufSurfTransformSetSessionParams (NvBufSurfTransformConfigParams *config_params)
 Set user defined session parameters to be used, if default session is not to be used by NvBufSurfTransform. More...
 
NvBufSurfTransform_Error NvBufSurfTransformGetSessionParams (NvBufSurfTransformConfigParams *config_params)
 Get current session parameters used by NvBufSurfTransform. More...
 
NvBufSurfTransform_Error NvBufSurfTransform (NvBufSurface *src, NvBufSurface *dst, NvBufSurfTransformParams *transform_params)
 Performs Transformation on batched input images. More...
 
NvBufSurfTransform_Error NvBufSurfTransformComposite (NvBufSurface *src, NvBufSurface *dst, NvBufSurfTransformCompositeParams *composite_params)
 Performs Composition on batched input images. More...
 

Typedef Documentation

Holds Composite parameters for Composite Call.

Holds configuration parameters for Transform/Composite Session.

Holds Transform parameters for Transform Call.

Enumeration Type Documentation

Defines flags that specify valid composition operations.

Enumerator
NVBUFSURF_TRANSFORM_COMPOSITE 

flag to set for composition.

Definition at line 132 of file nvbufsurftransform.h.

Defines compute devices used by NvBufSurfTransform.

Enumerator
NvBufSurfTransformCompute_Default 

Use VIC as compute device for Jetson or GPU for x86_64 system.

NvBufSurfTransformCompute_GPU 

Use GPU as compute device.

NvBufSurfTransformCompute_VIC 

Use VIC as compute device, only applicable for Jetson.

Definition at line 42 of file nvbufsurftransform.h.

Defines Error codes returned by NvBufSurfTransform APIs.

Enumerator
NvBufSurfTransformError_ROI_Error 

Error in source or destination ROI.

NvBufSurfTransformError_Invalid_Params 

Invalid input parameters.

NvBufSurfTransformError_Execution_Error 

Runtime execution Error.

NvBufSurfTransformError_Unsupported 

Unsupported Feature/Format.

NvBufSurfTransformError_Success 

Operation successful.

Definition at line 101 of file nvbufsurftransform.h.

Defines video flip methods.

Only Supported for Jetson

Enumerator
NvBufSurfTransform_None 

Video flip none.

NvBufSurfTransform_Rotate90 

Video flip rotate 90 degree clockwise.

NvBufSurfTransform_Rotate180 

Video flip rotate 180 degree clockwise.

NvBufSurfTransform_Rotate270 

Video flip rotate 270 degree clockwise.

NvBufSurfTransform_FlipX 

Video flip with respect to X-axis.

NvBufSurfTransform_FlipY 

Video flip with respect to Y-axis.

NvBufSurfTransform_Transpose 

Video flip transpose.

NvBufSurfTransform_InvTranspose 

Video flip inverse transpose.

Definition at line 56 of file nvbufsurftransform.h.

Defines video interpolation methods.

Enumerator
NvBufSurfTransformInter_Nearest 

Nearest Interpolation Method.

NvBufSurfTransformInter_Bilinear 

Bilinear Interpolation Method.

NvBufSurfTransformInter_Algo1 

GPU-Cubic, VIC-5 Tap.

NvBufSurfTransformInter_Algo2 

GPU-Super, VIC-10 Tap.

NvBufSurfTransformInter_Algo3 

GPU-Lanzos, VIC-Smart.

NvBufSurfTransformInter_Algo4 

GPU-Ignored, VIC-Nicest.

NvBufSurfTransformInter_Default 

GPU-Nearest, VIC-Nearest.

Definition at line 80 of file nvbufsurftransform.h.

Defines flags to indicate for valid transform.

Enumerator
NVBUFSURF_TRANSFORM_CROP_SRC 

transform flag to crop source rectangle.

NVBUFSURF_TRANSFORM_CROP_DST 

transform flag to crop destination rectangle.

NVBUFSURF_TRANSFORM_FILTER 

transform flag to set filter type.

NVBUFSURF_TRANSFORM_FLIP 

transform flag to set flip method.

Definition at line 118 of file nvbufsurftransform.h.

Function Documentation

NvBufSurfTransform_Error NvBufSurfTransform ( NvBufSurface src,
NvBufSurface dst,
NvBufSurfTransformParams transform_params 
)

Performs Transformation on batched input images.

Transforms batched input pointed by src pointer. Transformation includes scaling / format conversion croping for both source and destination, and all of the above in combination, flip / rotation is supported on VIC, dst pointer is user allocated. Type of Transformation to be done is set in transform_params In case of destination cropping the memory other than crop location is not touched and may have stale information, its callers responsibility to memset it if required before sending for transformation

Use NvBufSurfTransformSetSessionParams before each call, if user defined session parameters are to be used.

Parameters
[in]srcpointer to input batched buffers to be transformed.
[out]dstpointer to where transformed output would be stored.
[in]transform_paramspointer to NvBufSurfTransformParams structure.
Returns
NvBufSurfTransform_Error indicating success or failure.
NvBufSurfTransform_Error NvBufSurfTransformComposite ( NvBufSurface src,
NvBufSurface dst,
NvBufSurfTransformCompositeParams composite_params 
)

Performs Composition on batched input images.

Composites batched input pointed by src pointer. Compositer scales and stitches batched buffers pointed by src into single dst buffer, the parameters for location to be composited is provided by composite_params Use NvBufSurfTransformSetSessionParams before each call, if user defined session parameters are to be used.

Parameters
[in]srcpointer to input batched buffers to be transformed.
[out]dstpointer (single buffer) where composited output would be stored.
[in]composite_paramspointer to NvBufSurfTransformCompositeParams structure.
Returns
NvBufSurfTransform_Error indicating success or failure.
NvBufSurfTransform_Error NvBufSurfTransformGetSessionParams ( NvBufSurfTransformConfigParams config_params)

Get current session parameters used by NvBufSurfTransform.

Parameters
[out]config_paramspointer(caller allocated), populated with session params used.
Returns
NvBufSurfTransform_Error notifying succes or failure.
NvBufSurfTransform_Error NvBufSurfTransformSetSessionParams ( NvBufSurfTransformConfigParams config_params)

Set user defined session parameters to be used, if default session is not to be used by NvBufSurfTransform.

Parameters
[in]config_paramspointer, populated with session params to be used.
Returns
NvBufSurfTransform_Error notifying succes or failure.