Detailed Description

Implements the Color Conversion Kernel. The output image dimensions should be the same as the dimensions of the input image.

This kernel converts an image of a designated vx_df_image_e format to another vx_df_image_e format for those combinations listed in the below table, where the columns are output types and the rows are input types. The API version first supporting the conversion is also listed.

If the channel range is defined as VX_CHANNEL_RANGE_RESTRICTED, the conversion between the integer quantizations of color channels and the continuous representations is defined for red, green, blue, and Y as:

In all cases, for the purposes of conversion, these colour representations are interpreted as nonlinear in intensity, as defined by the BT.601, BT.709, and sRGB specifications. That is, the encoded colour channels are nonlinear R', G' and B', Y', Pb, and Pr.

Each channel of the R'G'B' representation can be converted to and from a linear-intensity RGB channel by these formulae:

As the different color spaces have different RGB primaries, a conversion between them must transform the color coordinates into the new RGB space. Working with linear RGB values, the conversion formulae are:

A conversion between one YUV color space and another may therefore consist of the following transformations:

Convert quantized Y'CbCr (“YUV”) to continuous, nonlinear Y'PbPr.

Convert continuous Y'PbPr to continuous, nonlinear R'G'B'.

Convert nonlinear R'G'B' to linear-intensity RGB (gamma-correction).

Convert linear RGB from the first color space to linear RGB in the second color space.

Convert linear RGB to nonlinear R'G'B' (gamma-conversion).

Convert nonlinear R'G'B' to Y'PbPr.

Convert continuous Y'PbPr to quantized Y'CbCr (“YUV”).

The above formulae and constants are defined in the ITU BT.601 and BT.709 specifications. The formulae for converting between RGB primaries can be derived from the specified primary chromaticity values and the specified white point by solving for the relative intensity of the primaries.