NVIDIA DRIVE 5.0 Linux SDK API Reference

5.0.5.0 Release

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages

Detailed Description

Blit functions define valid parameters for a blit.

Data Structures

struct  NvMedia2DBlitParameters
 Struct for setting the additional parameters for a blit. More...
 
struct  NvMedia2DBlitParametersOut
 Struct for returning additional values from a blit. More...
 

Enumerations

enum  NvMedia2DBlitFlags { NVMEDIA_2D_BLIT_FLAG_RETURN_CRC = (1u << 0) }
 Operation flags that affect blit behavior. More...
 
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)
}
 Bit-mask for validFields in NvMedia2DBlitParameters. More...
 

Functions

NvMedia2DNvMedia2DCreate (NvMediaDevice *device)
 Create a 2D object. More...
 
void NvMedia2DDestroy (NvMedia2D *i2d)
 Destroy a 2D object. More...
 
NvMediaStatus NvMedia2DBlitEx (NvMedia2D *i2d, NvMediaImage *dstSurface, const NvMediaRect *dstRect, NvMediaImage *srcSurface, const NvMediaRect *srcRect, const NvMedia2DBlitParameters *params, NvMedia2DBlitParametersOut *paramsOut)
 Perform a 2D blit operation with supplementary return values. More...
 
NvMediaStatus NvMedia2DCopyPlane (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

Operation flags that affect blit behavior.

Enumerator
NVMEDIA_2D_BLIT_FLAG_RETURN_CRC 

Compute and return CRC value.

Definition at line 61 of file nvmedia_2d.h.

Bit-mask for validFields in NvMedia2DBlitParameters.

Enumerator
NVMEDIA_2D_BLIT_PARAMS_FILTER 

Enable use of stretch filter.

NVMEDIA_2D_BLIT_PARAMS_FLAGS 

Enable use of blit flags.

NVMEDIA_2D_BLIT_PARAMS_DST_TRANSFORM 

Enable use of destination transform.

NVMEDIA_2D_BLIT_PARAMS_COLOR_STD 

Enable use of color space conversion standard.

Definition at line 77 of file nvmedia_2d.h.

Function Documentation

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

Perform 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.

The interface aims at making the typical uses of normal pixel copy easy, by not mandating the setting of advanced blit parameters unless they are actually required.

Passing in NULL as params invokes a standard pixel copy blit without additional transformations. If the dimensions of the source rectangle do not match the dimensions of the destination rectangle, pixels are scaled to fit the destination rectangle. The filtering mode for the scale defaults to NVMEDIA_2D_STRETCH_FILTER_LOW. Additional filtering modes are available by setting the corresponding parameter in NvMedia2DBlitParameters.

Passing in NULL as srcRect defaults to a source rectangle the size of the full source surface, likewise for dstRect and the destination surface.

If paramsOut is not NULL, the blit operation stores supplementary return values for the blit to the structure pointed to by paramsOut, if applicable. If paramsOut is NULL, no supplementatry information is returned.

Supplementary values are returned when using blit flag:

NVMEDIA_2D_BLIT_FLAG_RETURN_CRC returns a CRC value of blitted pixels.

A straight pixel copy between surfaces of the same dimensions (but not necessary the same bit depth or even color format) is issued by:

NvMedia2DBlitEx(i2d, dst, NULL, src, NULL, NULL, NULL);
Parameters
[in]i2dImage 2D object.
[in]dstSurfaceDestination surface.
[in]dstRectDestination rectangle.
[in]srcSurfaceSource surface.
[in]srcRectSource rectangle.
[in]paramsParameters.
[out]paramsOutReturned parameters.
Returns
NvMediaStatus The completion status of the operation. Possible values are:
NVMEDIA_STATUS_OK
NVMEDIA_STATUS_BAD_PARAMETER
NVMEDIA_STATUS_BAD_PARAMETER if any of the mandatory pointer is invalid.
NvMediaStatus NvMedia2DCopyPlane ( 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 be of the same format.

Parameters
[in]dstSurfaceA pointer to a destination surface.
[in]dstPlaneDestination plane.
[in]srcSurfaceA pointer to the source surface.
[in]srcPlaneSource plane.
Returns
NvMediaStatus The completion status of the operation. Possible values are:
NVMEDIA_STATUS_OK
NVMEDIA_STATUS_BAD_PARAMETER
NVMEDIA_STATUS_NOT_SUPPORTED
NVMEDIA_STATUS_ERROR
NvMedia2D* NvMedia2DCreate ( NvMediaDevice device)

Create a 2D object.

Parameters
[in]deviceThe NvMediaDevice device this 2D object will use.
Returns
NvMedia2D The new 2D object's handle or NULL if unsuccessful.
void NvMedia2DDestroy ( NvMedia2D i2d)

Destroy a 2D object.

Parameters
[in]i2dThe 2D object to be destoryed.
Returns
void