Analytical sample routines to learn the official API: RGB, YUV image format Introduction

First, the relevant image color space introduced

1. RGB color space

RGB color space to Red, Green, Blue three basic colors, based on varying degrees of superposition, resulting in a rich and wide range of colors, so called three-color mode.

Common RGB formats: RGB_565, RGB_888, ARGB_8888, ARGB_4444 and so on.

2. YUV color space

In the YUV color space, Y is used to represent the luminance, U and V represent chrominance used.

Common YUV format in the following categories:

planar: Y, U, V all successively stored, such as I420, YV12, i.e. three plane

packed: Y, U, V interleaved, such as YUYV, i.e. a plane

semi-planar: Y stored contiguously, U, V interleaved, such NV21 (Hass YVU in image format), in NV12, i.e. two plane

Second, the relevant image format introduced

Here are just Hass describes commonly used in YUV format:

1. NV21 image format

NV21 image format YUV color space belongs YUV420SP format, each set of four Y components share a U and V components, consecutively ordered Y, U and V cross-sorting.

The arrangement:

 

2. NV12 image format

NV12 image format YUV color space belongs YUV420SP format, each set of four Y components share a U and V components, consecutively ordered Y, U and V cross-ordering (NV12 and NV21 position just opposite to the U and V).

The arrangement:

3. I420 image format

I420 image format YUV color space belongs YUV420P format, each set of four Y components share a U and V components, Y, U, V are each consecutively ordered.

The arrangement:

4. YV12 image format

YV12 image format YUV color space belongs YUV420P format, each set of four Y components share a U and V components, Y, U, V are each successive sorting (YV12 and I420 position just opposite to the U and V).

The arrangement:

5. YUYV format images

YUYV image format YUV color space belonging to the YUV422 format, each of the two components share a Y U and V components, Y, U, V intersect sort.

The arrangement:

 

 

 

 

发布了36 篇原创文章 · 获赞 4 · 访问量 2805

Guess you like

Origin blog.csdn.net/qq845699/article/details/104148640