Color Conversion

The color conversion functions convert one image format to another image format, for the combinations listed in the following table. The rows represent the input formats and the columns represent the output formats. Supported conversions are discussed in the following sections.

Table 1.Supported Color Conversions
I/O Formats RGBA NV12 NV21 IYUV UYVY YUYV YUV4
RGBA N/A

For details, see theRGBA to NV12

For details, see theRGBA to NV21

For details, see theRGBA to IYUV

For details, see theRGBA to YUV4

NV12

For details, see theNV12 to RGBA

N/A

For details, see theNV12 to IYUV

For details, see theNV12 to YUV4

NV21

For details, see theNV21 to RGBA

N/A

For details, see theNV21 to IYUV

For details, see theNV21 to YUV4

IYUV

For details, see theIYUV to RGBA

For details, see theIYUV to NV12

N/A

For details, see theIYUV to YUV4

UYVY

For details, see theUYVY to RGBA

For details, see theUYVY to NV12

For details, see theUYVY to IYUV

N/A
YUYV

For details, see theYUYV to RGBA

For details, see theYUYV to NV12

For details, see theYUYV to IYUV

N/A
YUV4 N/A

RGB to YUV Conversion Matrix

Following is the formula to convert RGB data to YUV data:

YUV to RGB Conversion Matrix

Following is the formula to convert YUV data to RGB data:

Source:http://www.fourcc.org/fccyvrgb.php