Packed RGB formats — Packed RGB formats
These formats are designed to match the pixel formats of typical PC graphics frame buffers. They occupy 8, 16, 24 or 32 bits per pixel. These are all packed-pixel formats, meaning all the data for a pixel lie next to each other in memory.
Table 2.16. Packed RGB Image Formats
Bit 7 is the most significant bit.
The usage and value of the alpha bits (a) in the ARGB and ABGR formats
(collectively referred to as alpha formats) depend on the device type and
hardware operation. Capture devices
(including capture queues of mem-to-mem devices) fill the alpha component in
memory. When the device outputs an alpha channel the alpha component will
have a meaningful value. Otherwise, when the device doesn't output an alpha
channel but can set the alpha bit to a user-configurable value, the V4L2_CID_ALPHA_COMPONENT
control is used to specify that alpha value, and the alpha component
of all pixels will be set to the value specified by that control. Otherwise
a corresponding format without an alpha component (XRGB or XBGR) must be
used instead of an alpha format.
Output devices (including output queues of mem-to-mem devices and video output overlay devices) read the alpha component from memory. When the device processes the alpha channel the alpha component must be filled with meaningful values by applications. Otherwise a corresponding format without an alpha component (XRGB or XBGR) must be used instead of an alpha format.
The XRGB and XBGR formats contain undefined bits (-). Applications, devices and drivers must ignore those bits, for both capture and output devices.
Example 2.1. V4L2_PIX_FMT_BGR24
4 × 4 pixel
image
Byte Order. Each cell is one byte.
start + 0: | B00 | G00 | R00 | B01 | G01 | R01 | B02 | G02 | R02 | B03 | G03 | R03 |
start + 12: | B10 | G10 | R10 | B11 | G11 | R11 | B12 | G12 | R12 | B13 | G13 | R13 |
start + 24: | B20 | G20 | R20 | B21 | G21 | R21 | B22 | G22 | R22 | B23 | G23 | R23 |
start + 36: | B30 | G30 | R30 | B31 | G31 | R31 | B32 | G32 | R32 | B33 | G33 | R33 |
Formats defined in Table 2.17, “Deprecated Packed RGB Image Formats” are deprecated and must not be used by new drivers. They are documented here for reference. The meaning of their alpha bits (a) is ill-defined and interpreted as in either the corresponding ARGB or XRGB format, depending on the driver.
Table 2.17. Deprecated Packed RGB Image Formats
A test utility to determine which RGB formats a driver actually supports is available from the LinuxTV v4l-dvb repository. See http://linuxtv.org/repo/ for access instructions.