NVIDIA DRIVE OS Linux SDK API Reference

5.1.15.2 Release
For Test and Development only

Detailed Description

Blit functions define valid parameters for a blit.

Data Structures

struct  NvMedia2DBlitParameters
 Holds the additional parameters for a blit. More...
 
struct  NvMedia2DBlitParametersOut
 Holds additional values returned from a blit. More...
 

Enumerations

enum  NvMedia2DBlitParamField {
  NVMEDIA_2D_BLIT_PARAMS_FILTER = (1u << 0),
  NVMEDIA_2D_BLIT_PARAMS_FLAGS = (1u << 1),
  NVMEDIA_2D_BLIT_PARAMS_DST_TRANSFORM = (1u << 2),
  NVMEDIA_2D_BLIT_PARAMS_COLOR_STD = (1u << 3)
}
 Defines bit masks for NvMedia2DBlitParameters::validFields. More...
 

Functions

NvMedia2DNvMedia2DCreate (NvMediaDevice *device)
 Creates a 2D object. More...
 
void NvMedia2DDestroy (NvMedia2D *i2d)
 Destroys a 2D object. More...
 
NvMediaStatus NvMedia2DBlitEx (const NvMedia2D *i2d, NvMediaImage *dstSurface, const NvMediaRect *dstRect, NvMediaImage *srcSurface, const NvMediaRect *srcRect, const NvMedia2DBlitParameters *params, NvMedia2DBlitParametersOut *paramsOut)
 Performs a 2D blit operation with supplementary return values. More...
 
NvMediaStatus NvMedia2DCopyPlaneNew (const NvMedia2D *i2d, NvMediaImage *dstSurface, uint32_t dstPlane, NvMediaImage *srcSurface, uint32_t srcPlane)
 Copies a plane of a YUV image to another YUV image. More...
 

Enumeration Type Documentation

◆ NvMedia2DBlitParamField

Defines bit masks for NvMedia2DBlitParameters::validFields.

Enumerator
NVMEDIA_2D_BLIT_PARAMS_FILTER 

Specifies enable use of stretch filter.

NVMEDIA_2D_BLIT_PARAMS_FLAGS 

Specifies enabling use of blit flags.

NVMEDIA_2D_BLIT_PARAMS_DST_TRANSFORM 

Specifies enabling use of destination transform.

NVMEDIA_2D_BLIT_PARAMS_COLOR_STD 

Specifies enabling use of color space conversion standard.

Definition at line 159 of file nvmedia_2d.h.

Function Documentation

◆ NvMedia2DBlitEx()

NvMediaStatus NvMedia2DBlitEx ( const NvMedia2D i2d,
NvMediaImage dstSurface,
const NvMediaRect dstRect,
NvMediaImage srcSurface,
const NvMediaRect srcRect,
const NvMedia2DBlitParameters params,
NvMedia2DBlitParametersOut paramsOut 
)

Performs a 2D blit operation with supplementary return values.

A blit transfers pixels from a source surface to a destination surface, applying a variety of transformations to the pixel values on the way.

Note
For a YUV surface type with 16-bit depth, only scale and crop are supported. Format conversion is not supported.

The interface is designed to simplify the typical uses of normal pixel copy by not requiring advanced blit parameters to be set unless they are actually required.

Set params to NULL to invoke a standard pixel copy blit without additional transformations. If the dimensions of the source rectangle do not match the dimensions of the destination rectangle, the blit scales the pixels to fit the destination rectangle. The filtering mode for scale defaults to NVMEDIA_2D_STRETCH_FILTER_LOW. You can use additional filtering modes by setting the corresponding parameter in NvMedia2DBlitParameters.

Set srcRect or dstRect to NULL to default to a source or destination rectangle the size of the full source or destination surface.

This example performs a straight pixel copy between surfaces of the same dimensions (but not necessarily the same bit depth or color format):

NvMedia2DBlitEx(i2d, dst, NULL, src, NULL, NULL, NULL);
Parameters
[in]i2dA pointer to a i2d Image 2D object.
[in]dstSurfaceA pointer to a destination surface.
[in]dstRectA pointer to a destination rectangle. For a YUV surface type with 16-bit depth, the x0 and y0 of dstRect must be 0.
[in]srcSurfaceA pointer to a source surface.
[in]srcRectA pointer to a source rectangle.
[in]paramsA pointer to parameters.
[out]paramsOutReserved for future use. Currently, set paramsOut to NULL.
Returns
NVMEDIA_STATUS_OK if succcessful, or NVMEDIA_STATUS_BAD_PARAMETER if any required pointer parameter was invalid.

◆ NvMedia2DCopyPlaneNew()

NvMediaStatus NvMedia2DCopyPlaneNew ( const NvMedia2D i2d,
NvMediaImage dstSurface,
uint32_t  dstPlane,
NvMediaImage srcSurface,
uint32_t  srcPlane 
)

Copies a plane of a YUV image to another YUV image.

The source and the destination must have the same format.

Parameters
[in]i2dAn NvMedia 2D device handle.
[in]dstSurfaceA pointer to the destination surface.
[in]dstPlaneThe destination plane.
[in]srcSurfaceA pointer to the source surface.
[in]srcPlaneThe source plane.
Return values
NVMEDIA_STATUS_OKindicates that the operation was successful.
NVMEDIA_STATUS_BAD_PARAMETERindicates that one or more parameters were invalid.
NVMEDIA_STATUS_NOT_SUPPORTEDindicates that the requested operation was not supported.
NVMEDIA_STATUS_ERRORindicates that some other error occurred.

◆ NvMedia2DCreate()

NvMedia2D* NvMedia2DCreate ( NvMediaDevice device)

Creates a 2D object.

Parameters
[in]deviceA pointer to the NvMediaDevice device this 2D object is to use.
Returns
The new 2D object's handle if successful, or NULL otherwise.

◆ NvMedia2DDestroy()

void NvMedia2DDestroy ( NvMedia2D i2d)

Destroys a 2D object.

Parameters
[in]i2dA pointer to the 2D object to be destroyed.
NvMedia2DBlitEx
NvMediaStatus NvMedia2DBlitEx(const NvMedia2D *i2d, NvMediaImage *dstSurface, const NvMediaRect *dstRect, NvMediaImage *srcSurface, const NvMediaRect *srcRect, const NvMedia2DBlitParameters *params, NvMedia2DBlitParametersOut *paramsOut)
Performs a 2D blit operation with supplementary return values.