Image 2D (nvmimg_2d)
The NvMedia Image 2D sample application nvmimg_2d
demonstrates how to use
the NvMedia Image 2D API to execute a single NvMedia2DCompose
test case
defined in .cfg
format for NvMediaImage conversion.
The application requires you to provide command line input as well as a group of settings as defined in the configuration file.
Usage
The command syntax is:
$ nvmimg_2d <config filename>
Configuration File Structure
The configuration file structure consists of parameters, assigned values, and comments.
Parameter values are assigned with a line such as Parameter = Value
in the
configuration file. Lines starting with #
are comments.
The sample application contains example configuration files (.cfg
).
Surface Data File Format
The input and output files (configured with SrcLayerXInputFile and DstOutputFile configuration parameters) contain the surface pixel data as binary dump. The exact layout of the data is determined by the file I/O mode and the surface format set with the configuration parameters.
Configuration Parameters
The following table describes the configuration parameters.
The X
in parameters starting with SrcLayerX
is an integer
in range 1-16
.
The Y
in parameters containing the string PlaneY
is an
integer in range 1-3
.
Parameter | Description | Type | Range |
---|---|---|---|
FileIOMode |
Defines how the surface data in input and output files are interpreted. Valid values:
With NvSci, With LineByLine, a simple copy of the surface data occurs line-by-line, discarding any padding. Optional. If not set, defaults to NvSci. |
STRING | See description |
SrcLayerXInputFile | File where the surface data for the source layer is read. Mandatory if the layer is used. | STRING | Max 256 char |
SrcLayerXLayout |
Memory layout to use for the source surface. Valid values:
Mandatory if the layer is used. |
STRING | See description |
SrcLayerXScanType |
Scan type to use for the source surface. Valid values:
Mandatory if the layer is used. |
STRING | See description |
SrcLayerXPlaneYColorFormat |
Color format to use for the source surface plane. Valid values:
Mandatory if the plane is used. |
STRING | See description |
SrcLayerXPlaneYColorStandard |
Color standard to use for the source surface plane. Valid values:
Optional. If set for one plane, set the value for all planes of the surface. |
STRING | See description |
SrcLayerXPlaneYWidth | Width of the source surface plane. Mandatory if the plane is used. | UINT |
16 - 16384 16 - 8192 if color format with 16-bit components is used. |
SrcLayerXPlaneYHeight | Height of the source surface plane. Mandatory if the plane is used. | UINT |
16 - 16384 16 - 8192 if color format with 16-bit components is used. |
SrcLayerXSrcRectLeft | The source layer’s source rectangle left coordinate. Optional. If set, all layer’s source rectangle coordinates must be set. | UINT | 0 – source surface width |
SrcLayerXSrcRectTop | The source layer’s source rectangle top coordinate. Optional. If set, all layer’s source rectangle coordinates must be set. | UINT | 0 – source surface height |
SrcLayerXSrcRectRight | The source layer’s source rectangle right coordinate. Optional. If set, all layer’s source rectangle coordinates must be set. | UINT | 0 – source surface width |
SrcLayerXSrcRectBottom | The source layer’s source rectangle bottom coordinate. Optional. If set, all layer’s source rectangle coordinates must be set. | UINT | 0 – source surface height |
SrcLayerXDstRectLeft | The source layer’s destination rectangle left coordinate. Optional. If set, all layer’s destination rectangle coordinates must be set. | UINT | 0 – destination surface width |
SrcLayerXDstRectTop | The source layer’s destination rectangle top coordinate. Optional. If set, all layer’s destination rectangle coordinates must be set. | UINT | 0 – destination surface height |
SrcLayerXDstRectRight | The source layer’s destination rectangle right coordinate. Optional. If set, all layer’s destination rectangle coordinates must be set. | UINT | 0 – destination surface width |
SrcLayerXDstRectBottom | The source layer’s destination rectangle bottom coordinate. Optional. If set, all layer’s destination rectangle coordinates must be set. | UINT | 0 – destination surface height |
SrcLayerXTransform |
Transformation to apply for the source layer. Valid values:
Optional |
STRING | See description |
SrcLayerXFiltering |
Filtering to apply for the source layer. Valid values:
Optional |
STRING | See description |
SrcLayerXBlending |
Blending to apply for the source layer.
Valid values:
Optional |
STRING | See description |
SrcLayerXBlendingConstantAlpha | Constant alpha factor to use in blending. Mandatory if blending is configured for the layer. | FLOAT | 0.0 – 1.0 |
DstOutputFile | File where the destination surface data is written to. Mandatory. | STRING | Max 256 char |
DstLayout | Memory layout to use for the destination surface. See SrcLayerXLayout
for valid values. Mandatory. |
STRING | See description |
DstScanType | Scan type to use for the destination surface. See
SrcLayerXScanType for valid values. Mandatory. |
STRING | See description |
DstPlaneYColorFormat | Color format to use for the destination surface plane. See
SrcLayerXPlaneYColorFormat for valid values. Mandatory if the
plane is used. |
STRING | See description |
DstPlaneYColorStandard | Color standard to use for the destination surface plane. See
SrcLayerXPlaneYColorStandard for valid values. Optional. If set for one
plane,the value must be set for all planes of the surface. |
STRING | See description |
DstPlaneYWidth | Width of the destination surface plane. Mandatory if the plane is used. | UINT |
16 - 16384
16 - 8192 if color format with 16-bit components is used. |
DstPlaneYHeight | Height of the destination surface plane. Mandatory if the plane is used. | UINT |
16 - 16384
16 - 8192 if color format with 16-bit components is used. |