![]() |
NVIDIA DRIVE 5.0 Linux SDK API Reference5.0.10.3 Release |
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 | NvMedia2DBlitFlags { NVMEDIA_2D_BLIT_FLAG_RETURN_CRC = (1u << 0) } |
Specifies 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) } |
Specifies bit-mask for NvMedia2DBlitParameters::validFields. More... | |
Functions | |
NvMedia2D * | NvMedia2DCreate (NvMediaDevice *device) |
Creates a 2D object. More... | |
void | NvMedia2DDestroy (NvMedia2D *i2d) |
Destroys a 2D object. More... | |
NvMediaStatus | NvMedia2DBlitEx (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 | NvMedia2DCopyPlane (NvMediaImage *dstSurface, uint32_t dstPlane, NvMediaImage *srcSurface, uint32_t srcPlane) |
Copies a plane of a YUV image to another YUV image. More... | |
enum NvMedia2DBlitFlags |
Specifies operation flags that affect blit behavior.
Enumerator | |
---|---|
NVMEDIA_2D_BLIT_FLAG_RETURN_CRC |
Specifies compute and return CRC value. |
Definition at line 62 of file nvmedia_2d.h.
Specifies bit-mask for NvMedia2DBlitParameters::validFields.
Definition at line 78 of file nvmedia_2d.h.
NvMediaStatus NvMedia2DBlitEx | ( | 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 that for a YUV surface type with 16-bit depth, only scale and crop are supported. Format conversion is not supported.
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 supplementry information is returned.
Supplementary values are returned when using the 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 necessarily the same bit depth or even color format) is performed by:
[in] | i2d | A pointer to a i2d Image 2D object. |
[in] | dstSurface | A pointer to a destination surface. |
[in] | dstRect | A pointer to a destination rectangle. For a YUV surface type with 16-bit depth, the x0 and y0 of dstRect must be 0. |
[in] | srcSurface | A pointer to a source surface. |
[in] | srcRect | A pointer to a source rectangle. |
[in] | params | A pointer to parameters. |
[out] | paramsOut | A pointer to returned parameters. |
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 have the same format.
[in] | dstSurface | A pointer to a destination surface. |
[in] | dstPlane | Destination plane. |
[in] | srcSurface | A pointer to the source surface. |
[in] | srcPlane | Source plane. |
NvMedia2D* NvMedia2DCreate | ( | NvMediaDevice * | device | ) |
Creates a 2D object.
[in] | device | A pointer to the NvMediaDevice device this 2D object will use. |
void NvMedia2DDestroy | ( | NvMedia2D * | i2d | ) |
Destroys a 2D object.
[in] | i2d | A pointer to the 2D object to destroy. |