1279 lines · plain
1.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later2 3.. _pixfmt-rgb:4 5***********6RGB Formats7***********8 9These formats encode each pixel as a triplet of RGB values. They are packed10formats, meaning that the RGB values for one pixel are stored consecutively in11memory and each pixel consumes an integer number of bytes. When the number of12bits required to store a pixel is not aligned to a byte boundary, the data is13padded with additional bits to fill the remaining byte.14 15The formats differ by the number of bits per RGB component (typically but not16always the same for all components), the order of components in memory, and the17presence of an alpha component or additional padding bits.18 19The usage and value of the alpha bits in formats that support them (named ARGB20or a permutation thereof, collectively referred to as alpha formats) depend on21the device type and hardware operation. :ref:`Capture <capture>` devices22(including capture queues of mem-to-mem devices) fill the alpha component in23memory. When the device captures an alpha channel the alpha component will have24a meaningful value. Otherwise, when the device doesn't capture an alpha channel25but can set the alpha bit to a user-configurable value, the26:ref:`V4L2_CID_ALPHA_COMPONENT <v4l2-alpha-component>` control is used to27specify that alpha value, and the alpha component of all pixels will be set to28the value specified by that control. Otherwise a corresponding format without29an alpha component (XRGB or XBGR) must be used instead of an alpha format.30 31:ref:`Output <output>` devices (including output queues of mem-to-mem devices32and :ref:`video output overlay <osd>` devices) read the alpha component from33memory. When the device processes the alpha channel the alpha component must be34filled with meaningful values by applications. Otherwise a corresponding format35without an alpha component (XRGB or XBGR) must be used instead of an alpha36format.37 38Formats that contain padding bits are named XRGB (or a permutation thereof).39The padding bits contain undefined values and must be ignored by applications,40devices and drivers, for both :ref:`capture` and :ref:`output` devices.41 42.. note::43 44 - In all the tables that follow, bit 7 is the most significant bit in a byte.45 - 'r', 'g' and 'b' denote bits of the red, green and blue components46 respectively. 'a' denotes bits of the alpha component (if supported by the47 format), and 'x' denotes padding bits.48 49 50Less Than 8 Bits Per Component51==============================52 53These formats store an RGB triplet in one, two or four bytes. They are named54based on the order of the RGB components as seen in a 8-, 16- or 32-bit word,55which is then stored in memory in little endian byte order (unless otherwise56noted by the presence of bit 31 in the 4CC value), and on the number of bits57for each component. For instance, the RGB565 format stores a pixel in a 16-bit58word [15:0] laid out at as [R\ :sub:`4` R\ :sub:`3` R\ :sub:`2` R\ :sub:`1`59R\ :sub:`0` G\ :sub:`5` G\ :sub:`4` G\ :sub:`3` G\ :sub:`2` G\ :sub:`1`60G\ :sub:`0` B\ :sub:`4` B\ :sub:`3` B\ :sub:`2` B\ :sub:`1` B\ :sub:`0`], and61stored in memory in two bytes, [R\ :sub:`4` R\ :sub:`3` R\ :sub:`2` R\ :sub:`1`62R\ :sub:`0` G\ :sub:`5` G\ :sub:`4` G\ :sub:`3`] followed by [G\ :sub:`2`63G\ :sub:`1` G\ :sub:`0` B\ :sub:`4` B\ :sub:`3` B\ :sub:`2` B\ :sub:`1`64B\ :sub:`0`].65 66.. raw:: latex67 68 \begingroup69 \tiny70 \setlength{\tabcolsep}{2pt}71 72.. tabularcolumns:: |p{2.8cm}|p{2.0cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|73 74 75.. flat-table:: RGB Formats With Less Than 8 Bits Per Component76 :header-rows: 277 :stub-columns: 078 79 * - Identifier80 - Code81 - :cspan:`7` Byte 0 in memory82 - :cspan:`7` Byte 183 - :cspan:`7` Byte 284 - :cspan:`7` Byte 385 * -86 -87 - 788 - 689 - 590 - 491 - 392 - 293 - 194 - 095 96 - 797 - 698 - 599 - 4100 - 3101 - 2102 - 1103 - 0104 105 - 7106 - 6107 - 5108 - 4109 - 3110 - 2111 - 1112 - 0113 114 - 7115 - 6116 - 5117 - 4118 - 3119 - 2120 - 1121 - 0122 * .. _V4L2-PIX-FMT-RGB332:123 124 - ``V4L2_PIX_FMT_RGB332``125 - 'RGB1'126 127 - r\ :sub:`2`128 - r\ :sub:`1`129 - r\ :sub:`0`130 - g\ :sub:`2`131 - g\ :sub:`1`132 - g\ :sub:`0`133 - b\ :sub:`1`134 - b\ :sub:`0`135 -136 * .. _V4L2-PIX-FMT-ARGB444:137 138 - ``V4L2_PIX_FMT_ARGB444``139 - 'AR12'140 141 - g\ :sub:`3`142 - g\ :sub:`2`143 - g\ :sub:`1`144 - g\ :sub:`0`145 - b\ :sub:`3`146 - b\ :sub:`2`147 - b\ :sub:`1`148 - b\ :sub:`0`149 150 - a\ :sub:`3`151 - a\ :sub:`2`152 - a\ :sub:`1`153 - a\ :sub:`0`154 - r\ :sub:`3`155 - r\ :sub:`2`156 - r\ :sub:`1`157 - r\ :sub:`0`158 -159 * .. _V4L2-PIX-FMT-XRGB444:160 161 - ``V4L2_PIX_FMT_XRGB444``162 - 'XR12'163 164 - g\ :sub:`3`165 - g\ :sub:`2`166 - g\ :sub:`1`167 - g\ :sub:`0`168 - b\ :sub:`3`169 - b\ :sub:`2`170 - b\ :sub:`1`171 - b\ :sub:`0`172 173 - x174 - x175 - x176 - x177 - r\ :sub:`3`178 - r\ :sub:`2`179 - r\ :sub:`1`180 - r\ :sub:`0`181 -182 * .. _V4L2-PIX-FMT-RGBA444:183 184 - ``V4L2_PIX_FMT_RGBA444``185 - 'RA12'186 187 - b\ :sub:`3`188 - b\ :sub:`2`189 - b\ :sub:`1`190 - b\ :sub:`0`191 - a\ :sub:`3`192 - a\ :sub:`2`193 - a\ :sub:`1`194 - a\ :sub:`0`195 196 - r\ :sub:`3`197 - r\ :sub:`2`198 - r\ :sub:`1`199 - r\ :sub:`0`200 - g\ :sub:`3`201 - g\ :sub:`2`202 - g\ :sub:`1`203 - g\ :sub:`0`204 -205 * .. _V4L2-PIX-FMT-RGBX444:206 207 - ``V4L2_PIX_FMT_RGBX444``208 - 'RX12'209 210 - b\ :sub:`3`211 - b\ :sub:`2`212 - b\ :sub:`1`213 - b\ :sub:`0`214 - x215 - x216 - x217 - x218 219 - r\ :sub:`3`220 - r\ :sub:`2`221 - r\ :sub:`1`222 - r\ :sub:`0`223 - g\ :sub:`3`224 - g\ :sub:`2`225 - g\ :sub:`1`226 - g\ :sub:`0`227 -228 * .. _V4L2-PIX-FMT-ABGR444:229 230 - ``V4L2_PIX_FMT_ABGR444``231 - 'AB12'232 233 - g\ :sub:`3`234 - g\ :sub:`2`235 - g\ :sub:`1`236 - g\ :sub:`0`237 - r\ :sub:`3`238 - r\ :sub:`2`239 - r\ :sub:`1`240 - r\ :sub:`0`241 242 - a\ :sub:`3`243 - a\ :sub:`2`244 - a\ :sub:`1`245 - a\ :sub:`0`246 - b\ :sub:`3`247 - b\ :sub:`2`248 - b\ :sub:`1`249 - b\ :sub:`0`250 -251 * .. _V4L2-PIX-FMT-XBGR444:252 253 - ``V4L2_PIX_FMT_XBGR444``254 - 'XB12'255 256 - g\ :sub:`3`257 - g\ :sub:`2`258 - g\ :sub:`1`259 - g\ :sub:`0`260 - r\ :sub:`3`261 - r\ :sub:`2`262 - r\ :sub:`1`263 - r\ :sub:`0`264 265 - x266 - x267 - x268 - x269 - b\ :sub:`3`270 - b\ :sub:`2`271 - b\ :sub:`1`272 - b\ :sub:`0`273 -274 * .. _V4L2-PIX-FMT-BGRA444:275 276 - ``V4L2_PIX_FMT_BGRA444``277 - 'BA12'278 279 - r\ :sub:`3`280 - r\ :sub:`2`281 - r\ :sub:`1`282 - r\ :sub:`0`283 - a\ :sub:`3`284 - a\ :sub:`2`285 - a\ :sub:`1`286 - a\ :sub:`0`287 288 - b\ :sub:`3`289 - b\ :sub:`2`290 - b\ :sub:`1`291 - b\ :sub:`0`292 - g\ :sub:`3`293 - g\ :sub:`2`294 - g\ :sub:`1`295 - g\ :sub:`0`296 -297 * .. _V4L2-PIX-FMT-BGRX444:298 299 - ``V4L2_PIX_FMT_BGRX444``300 - 'BX12'301 302 - r\ :sub:`3`303 - r\ :sub:`2`304 - r\ :sub:`1`305 - r\ :sub:`0`306 - x307 - x308 - x309 - x310 311 - b\ :sub:`3`312 - b\ :sub:`2`313 - b\ :sub:`1`314 - b\ :sub:`0`315 - g\ :sub:`3`316 - g\ :sub:`2`317 - g\ :sub:`1`318 - g\ :sub:`0`319 -320 * .. _V4L2-PIX-FMT-ARGB555:321 322 - ``V4L2_PIX_FMT_ARGB555``323 - 'AR15'324 325 - g\ :sub:`2`326 - g\ :sub:`1`327 - g\ :sub:`0`328 - b\ :sub:`4`329 - b\ :sub:`3`330 - b\ :sub:`2`331 - b\ :sub:`1`332 - b\ :sub:`0`333 334 - a335 - r\ :sub:`4`336 - r\ :sub:`3`337 - r\ :sub:`2`338 - r\ :sub:`1`339 - r\ :sub:`0`340 - g\ :sub:`4`341 - g\ :sub:`3`342 -343 * .. _V4L2-PIX-FMT-XRGB555:344 345 - ``V4L2_PIX_FMT_XRGB555``346 - 'XR15'347 348 - g\ :sub:`2`349 - g\ :sub:`1`350 - g\ :sub:`0`351 - b\ :sub:`4`352 - b\ :sub:`3`353 - b\ :sub:`2`354 - b\ :sub:`1`355 - b\ :sub:`0`356 357 - x358 - r\ :sub:`4`359 - r\ :sub:`3`360 - r\ :sub:`2`361 - r\ :sub:`1`362 - r\ :sub:`0`363 - g\ :sub:`4`364 - g\ :sub:`3`365 -366 * .. _V4L2-PIX-FMT-RGBA555:367 368 - ``V4L2_PIX_FMT_RGBA555``369 - 'RA15'370 371 - g\ :sub:`1`372 - g\ :sub:`0`373 - b\ :sub:`4`374 - b\ :sub:`3`375 - b\ :sub:`2`376 - b\ :sub:`1`377 - b\ :sub:`0`378 - a379 380 - r\ :sub:`4`381 - r\ :sub:`3`382 - r\ :sub:`2`383 - r\ :sub:`1`384 - r\ :sub:`0`385 - g\ :sub:`4`386 - g\ :sub:`3`387 - g\ :sub:`2`388 -389 * .. _V4L2-PIX-FMT-RGBX555:390 391 - ``V4L2_PIX_FMT_RGBX555``392 - 'RX15'393 394 - g\ :sub:`1`395 - g\ :sub:`0`396 - b\ :sub:`4`397 - b\ :sub:`3`398 - b\ :sub:`2`399 - b\ :sub:`1`400 - b\ :sub:`0`401 - x402 403 - r\ :sub:`4`404 - r\ :sub:`3`405 - r\ :sub:`2`406 - r\ :sub:`1`407 - r\ :sub:`0`408 - g\ :sub:`4`409 - g\ :sub:`3`410 - g\ :sub:`2`411 -412 * .. _V4L2-PIX-FMT-ABGR555:413 414 - ``V4L2_PIX_FMT_ABGR555``415 - 'AB15'416 417 - g\ :sub:`2`418 - g\ :sub:`1`419 - g\ :sub:`0`420 - r\ :sub:`4`421 - r\ :sub:`3`422 - r\ :sub:`2`423 - r\ :sub:`1`424 - r\ :sub:`0`425 426 - a427 - b\ :sub:`4`428 - b\ :sub:`3`429 - b\ :sub:`2`430 - b\ :sub:`1`431 - b\ :sub:`0`432 - g\ :sub:`4`433 - g\ :sub:`3`434 -435 * .. _V4L2-PIX-FMT-XBGR555:436 437 - ``V4L2_PIX_FMT_XBGR555``438 - 'XB15'439 440 - g\ :sub:`2`441 - g\ :sub:`1`442 - g\ :sub:`0`443 - r\ :sub:`4`444 - r\ :sub:`3`445 - r\ :sub:`2`446 - r\ :sub:`1`447 - r\ :sub:`0`448 449 - x450 - b\ :sub:`4`451 - b\ :sub:`3`452 - b\ :sub:`2`453 - b\ :sub:`1`454 - b\ :sub:`0`455 - g\ :sub:`4`456 - g\ :sub:`3`457 -458 * .. _V4L2-PIX-FMT-BGRA555:459 460 - ``V4L2_PIX_FMT_BGRA555``461 - 'BA15'462 463 - g\ :sub:`1`464 - g\ :sub:`0`465 - r\ :sub:`4`466 - r\ :sub:`3`467 - r\ :sub:`2`468 - r\ :sub:`1`469 - r\ :sub:`0`470 - a471 472 - b\ :sub:`4`473 - b\ :sub:`3`474 - b\ :sub:`2`475 - b\ :sub:`1`476 - b\ :sub:`0`477 - g\ :sub:`4`478 - g\ :sub:`3`479 - g\ :sub:`2`480 -481 * .. _V4L2-PIX-FMT-BGRX555:482 483 - ``V4L2_PIX_FMT_BGRX555``484 - 'BX15'485 486 - g\ :sub:`1`487 - g\ :sub:`0`488 - r\ :sub:`4`489 - r\ :sub:`3`490 - r\ :sub:`2`491 - r\ :sub:`1`492 - r\ :sub:`0`493 - x494 495 - b\ :sub:`4`496 - b\ :sub:`3`497 - b\ :sub:`2`498 - b\ :sub:`1`499 - b\ :sub:`0`500 - g\ :sub:`4`501 - g\ :sub:`3`502 - g\ :sub:`2`503 -504 * .. _V4L2-PIX-FMT-RGB565:505 506 - ``V4L2_PIX_FMT_RGB565``507 - 'RGBP'508 509 - g\ :sub:`2`510 - g\ :sub:`1`511 - g\ :sub:`0`512 - b\ :sub:`4`513 - b\ :sub:`3`514 - b\ :sub:`2`515 - b\ :sub:`1`516 - b\ :sub:`0`517 518 - r\ :sub:`4`519 - r\ :sub:`3`520 - r\ :sub:`2`521 - r\ :sub:`1`522 - r\ :sub:`0`523 - g\ :sub:`5`524 - g\ :sub:`4`525 - g\ :sub:`3`526 -527 * .. _V4L2-PIX-FMT-ARGB555X:528 529 - ``V4L2_PIX_FMT_ARGB555X``530 - 'AR15' | (1 << 31)531 532 - a533 - r\ :sub:`4`534 - r\ :sub:`3`535 - r\ :sub:`2`536 - r\ :sub:`1`537 - r\ :sub:`0`538 - g\ :sub:`4`539 - g\ :sub:`3`540 541 - g\ :sub:`2`542 - g\ :sub:`1`543 - g\ :sub:`0`544 - b\ :sub:`4`545 - b\ :sub:`3`546 - b\ :sub:`2`547 - b\ :sub:`1`548 - b\ :sub:`0`549 -550 * .. _V4L2-PIX-FMT-XRGB555X:551 552 - ``V4L2_PIX_FMT_XRGB555X``553 - 'XR15' | (1 << 31)554 555 - x556 - r\ :sub:`4`557 - r\ :sub:`3`558 - r\ :sub:`2`559 - r\ :sub:`1`560 - r\ :sub:`0`561 - g\ :sub:`4`562 - g\ :sub:`3`563 564 - g\ :sub:`2`565 - g\ :sub:`1`566 - g\ :sub:`0`567 - b\ :sub:`4`568 - b\ :sub:`3`569 - b\ :sub:`2`570 - b\ :sub:`1`571 - b\ :sub:`0`572 -573 * .. _V4L2-PIX-FMT-RGB565X:574 575 - ``V4L2_PIX_FMT_RGB565X``576 - 'RGBR'577 578 - r\ :sub:`4`579 - r\ :sub:`3`580 - r\ :sub:`2`581 - r\ :sub:`1`582 - r\ :sub:`0`583 - g\ :sub:`5`584 - g\ :sub:`4`585 - g\ :sub:`3`586 587 - g\ :sub:`2`588 - g\ :sub:`1`589 - g\ :sub:`0`590 - b\ :sub:`4`591 - b\ :sub:`3`592 - b\ :sub:`2`593 - b\ :sub:`1`594 - b\ :sub:`0`595 -596 * .. _V4L2-PIX-FMT-BGR666:597 598 - ``V4L2_PIX_FMT_BGR666``599 - 'BGRH'600 601 - b\ :sub:`5`602 - b\ :sub:`4`603 - b\ :sub:`3`604 - b\ :sub:`2`605 - b\ :sub:`1`606 - b\ :sub:`0`607 - g\ :sub:`5`608 - g\ :sub:`4`609 610 - g\ :sub:`3`611 - g\ :sub:`2`612 - g\ :sub:`1`613 - g\ :sub:`0`614 - r\ :sub:`5`615 - r\ :sub:`4`616 - r\ :sub:`3`617 - r\ :sub:`2`618 619 - r\ :sub:`1`620 - r\ :sub:`0`621 - x622 - x623 - x624 - x625 - x626 - x627 628 - x629 - x630 - x631 - x632 - x633 - x634 - x635 - x636 637.. raw:: latex638 639 \endgroup640 641 6428 Bits Per Component643====================644 645These formats store an RGB triplet in three or four bytes. They are named based646on the order of the RGB components as stored in memory, and on the total number647of bits per pixel. For instance, RGB24 format stores a pixel with [R\ :sub:`7`648R\ :sub:`6` R\ :sub:`5` R\ :sub:`4` R\ :sub:`3` R\ :sub:`2` R\ :sub:`1`649R\ :sub:`0`] in the first byte, [G\ :sub:`7` G\ :sub:`6` G\ :sub:`5` G\ :sub:`4`650G\ :sub:`3` G\ :sub:`2` G\ :sub:`1` G\ :sub:`0`] in the second byte and651[B\ :sub:`7` B\ :sub:`6` B\ :sub:`5` B\ :sub:`4` B\ :sub:`3` B\ :sub:`2`652B\ :sub:`1` B\ :sub:`0`] in the third byte. This differs from the DRM format653nomenclature that instead use the order of components as seen in a 24- or65432-bit little endian word.655 656.. raw:: latex657 658 \small659 660.. flat-table:: RGB Formats With 8 Bits Per Component661 :header-rows: 1662 :stub-columns: 0663 664 * - Identifier665 - Code666 - Byte 0 in memory667 - Byte 1668 - Byte 2669 - Byte 3670 * .. _V4L2-PIX-FMT-BGR24:671 672 - ``V4L2_PIX_FMT_BGR24``673 - 'BGR3'674 675 - B\ :sub:`7-0`676 - G\ :sub:`7-0`677 - R\ :sub:`7-0`678 -679 * .. _V4L2-PIX-FMT-RGB24:680 681 - ``V4L2_PIX_FMT_RGB24``682 - 'RGB3'683 684 - R\ :sub:`7-0`685 - G\ :sub:`7-0`686 - B\ :sub:`7-0`687 -688 * .. _V4L2-PIX-FMT-ABGR32:689 690 - ``V4L2_PIX_FMT_ABGR32``691 - 'AR24'692 693 - B\ :sub:`7-0`694 - G\ :sub:`7-0`695 - R\ :sub:`7-0`696 - A\ :sub:`7-0`697 * .. _V4L2-PIX-FMT-XBGR32:698 699 - ``V4L2_PIX_FMT_XBGR32``700 - 'XR24'701 702 - B\ :sub:`7-0`703 - G\ :sub:`7-0`704 - R\ :sub:`7-0`705 - X\ :sub:`7-0`706 * .. _V4L2-PIX-FMT-BGRA32:707 708 - ``V4L2_PIX_FMT_BGRA32``709 - 'RA24'710 711 - A\ :sub:`7-0`712 - B\ :sub:`7-0`713 - G\ :sub:`7-0`714 - R\ :sub:`7-0`715 * .. _V4L2-PIX-FMT-BGRX32:716 717 - ``V4L2_PIX_FMT_BGRX32``718 - 'RX24'719 720 - X\ :sub:`7-0`721 - B\ :sub:`7-0`722 - G\ :sub:`7-0`723 - R\ :sub:`7-0`724 * .. _V4L2-PIX-FMT-RGBA32:725 726 - ``V4L2_PIX_FMT_RGBA32``727 - 'AB24'728 729 - R\ :sub:`7-0`730 - G\ :sub:`7-0`731 - B\ :sub:`7-0`732 - A\ :sub:`7-0`733 * .. _V4L2-PIX-FMT-RGBX32:734 735 - ``V4L2_PIX_FMT_RGBX32``736 - 'XB24'737 738 - R\ :sub:`7-0`739 - G\ :sub:`7-0`740 - B\ :sub:`7-0`741 - X\ :sub:`7-0`742 * .. _V4L2-PIX-FMT-ARGB32:743 744 - ``V4L2_PIX_FMT_ARGB32``745 - 'BA24'746 747 - A\ :sub:`7-0`748 - R\ :sub:`7-0`749 - G\ :sub:`7-0`750 - B\ :sub:`7-0`751 * .. _V4L2-PIX-FMT-XRGB32:752 753 - ``V4L2_PIX_FMT_XRGB32``754 - 'BX24'755 756 - X\ :sub:`7-0`757 - R\ :sub:`7-0`758 - G\ :sub:`7-0`759 - B\ :sub:`7-0`760 761.. raw:: latex762 763 \normalsize764 765 76610 Bits Per Component767=====================768 769These formats store a 30-bit RGB triplet with an optional 2 bit alpha in four770bytes. They are named based on the order of the RGB components as seen in a77132-bit word, which is then stored in memory in little endian byte order772(unless otherwise noted by the presence of bit 31 in the 4CC value), and on the773number of bits for each component.774 775.. raw:: latex776 777 \begingroup778 \tiny779 \setlength{\tabcolsep}{2pt}780 781.. tabularcolumns:: |p{3.2cm}|p{0.8cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|782 783 784.. flat-table:: RGB Formats 10 Bits Per Color Component785 :header-rows: 2786 :stub-columns: 0787 788 * - Identifier789 - Code790 - :cspan:`7` Byte 0 in memory791 - :cspan:`7` Byte 1792 - :cspan:`7` Byte 2793 - :cspan:`7` Byte 3794 * -795 -796 - 7797 - 6798 - 5799 - 4800 - 3801 - 2802 - 1803 - 0804 805 - 7806 - 6807 - 5808 - 4809 - 3810 - 2811 - 1812 - 0813 814 - 7815 - 6816 - 5817 - 4818 - 3819 - 2820 - 1821 - 0822 823 - 7824 - 6825 - 5826 - 4827 - 3828 - 2829 - 1830 - 0831 * .. _V4L2-PIX-FMT-RGBX1010102:832 833 - ``V4L2_PIX_FMT_RGBX1010102``834 - 'RX30'835 836 - b\ :sub:`5`837 - b\ :sub:`4`838 - b\ :sub:`3`839 - b\ :sub:`2`840 - b\ :sub:`1`841 - b\ :sub:`0`842 - x843 - x844 845 - g\ :sub:`3`846 - g\ :sub:`2`847 - g\ :sub:`1`848 - g\ :sub:`0`849 - b\ :sub:`9`850 - b\ :sub:`8`851 - b\ :sub:`7`852 - b\ :sub:`6`853 854 - r\ :sub:`1`855 - r\ :sub:`0`856 - g\ :sub:`9`857 - g\ :sub:`8`858 - g\ :sub:`7`859 - g\ :sub:`6`860 - g\ :sub:`5`861 - g\ :sub:`4`862 863 - r\ :sub:`9`864 - r\ :sub:`8`865 - r\ :sub:`7`866 - r\ :sub:`6`867 - r\ :sub:`5`868 - r\ :sub:`4`869 - r\ :sub:`3`870 - r\ :sub:`2`871 * .. _V4L2-PIX-FMT-RGBA1010102:872 873 - ``V4L2_PIX_FMT_RGBA1010102``874 - 'RA30'875 876 - b\ :sub:`5`877 - b\ :sub:`4`878 - b\ :sub:`3`879 - b\ :sub:`2`880 - b\ :sub:`1`881 - b\ :sub:`0`882 - a\ :sub:`1`883 - a\ :sub:`0`884 885 - g\ :sub:`3`886 - g\ :sub:`2`887 - g\ :sub:`1`888 - g\ :sub:`0`889 - b\ :sub:`9`890 - b\ :sub:`8`891 - b\ :sub:`7`892 - b\ :sub:`6`893 894 - r\ :sub:`1`895 - r\ :sub:`0`896 - g\ :sub:`9`897 - g\ :sub:`8`898 - g\ :sub:`7`899 - g\ :sub:`6`900 - g\ :sub:`5`901 - g\ :sub:`4`902 903 - r\ :sub:`9`904 - r\ :sub:`8`905 - r\ :sub:`7`906 - r\ :sub:`6`907 - r\ :sub:`5`908 - r\ :sub:`4`909 - r\ :sub:`3`910 - r\ :sub:`2`911 * .. _V4L2-PIX-FMT-ARGB2101010:912 913 - ``V4L2_PIX_FMT_ARGB2101010``914 - 'AR30'915 916 - b\ :sub:`7`917 - b\ :sub:`6`918 - b\ :sub:`5`919 - b\ :sub:`4`920 - b\ :sub:`3`921 - b\ :sub:`2`922 - b\ :sub:`1`923 - b\ :sub:`0`924 925 - g\ :sub:`5`926 - g\ :sub:`4`927 - g\ :sub:`3`928 - g\ :sub:`2`929 - g\ :sub:`1`930 - g\ :sub:`0`931 - b\ :sub:`9`932 - b\ :sub:`8`933 934 - r\ :sub:`3`935 - r\ :sub:`2`936 - r\ :sub:`1`937 - r\ :sub:`0`938 - g\ :sub:`9`939 - g\ :sub:`8`940 - g\ :sub:`7`941 - g\ :sub:`6`942 943 - a\ :sub:`1`944 - a\ :sub:`0`945 - r\ :sub:`9`946 - r\ :sub:`8`947 - r\ :sub:`7`948 - r\ :sub:`6`949 - r\ :sub:`5`950 - r\ :sub:`4`951 952.. raw:: latex953 954 \endgroup955 95612 Bits Per Component957==============================958 959These formats store an RGB triplet in six or eight bytes, with 12 bits per component.960Expand the bits per component to 16 bits, data in the high bits, zeros in the low bits,961arranged in little endian order.962 963.. raw:: latex964 965 \small966 967.. flat-table:: RGB Formats With 12 Bits Per Component968 :header-rows: 1969 970 * - Identifier971 - Code972 - Byte 1-0973 - Byte 3-2974 - Byte 5-4975 - Byte 7-6976 * .. _V4L2-PIX-FMT-BGR48-12:977 978 - ``V4L2_PIX_FMT_BGR48_12``979 - 'B312'980 981 - B\ :sub:`15-4`982 - G\ :sub:`15-4`983 - R\ :sub:`15-4`984 -985 * .. _V4L2-PIX-FMT-ABGR64-12:986 987 - ``V4L2_PIX_FMT_ABGR64_12``988 - 'B412'989 990 - B\ :sub:`15-4`991 - G\ :sub:`15-4`992 - R\ :sub:`15-4`993 - A\ :sub:`15-4`994 995.. raw:: latex996 997 \normalsize998 99916 Bits Per Component1000=====================1001 1002These formats store an RGB triplet in six bytes, with 16 bits per component1003stored in memory in little endian byte order. They are named based on the order1004of the RGB components as stored in memory. For instance, RGB48 stores R\1005:sub:`7:0` and R\ :sub:`15:8` in bytes 0 and 1 respectively. This differs from1006the DRM format nomenclature that instead uses the order of components as seen in1007the 48-bits little endian word.1008 1009.. raw:: latex1010 1011 \small1012 1013.. flat-table:: RGB Formats With 16 Bits Per Component1014 :header-rows: 11015 1016 * - Identifier1017 - Code1018 - Byte 01019 - Byte 11020 - Byte 21021 - Byte 31022 - Byte 41023 - Byte 51024 1025 * .. _V4L2-PIX-FMT-BGR48:1026 1027 - ``V4L2_PIX_FMT_BGR48``1028 - 'BGR6'1029 1030 - B\ :sub:`7-0`1031 - B\ :sub:`15-8`1032 - G\ :sub:`7-0`1033 - G\ :sub:`15-8`1034 - R\ :sub:`7-0`1035 - R\ :sub:`15-8`1036 1037 * .. _V4L2-PIX-FMT-RGB48:1038 1039 - ``V4L2_PIX_FMT_RGB48``1040 - 'RGB6'1041 1042 - R\ :sub:`7-0`1043 - R\ :sub:`15-8`1044 - G\ :sub:`7-0`1045 - G\ :sub:`15-8`1046 - B\ :sub:`7-0`1047 - B\ :sub:`15-8`1048 1049.. raw:: latex1050 1051 \normalsize1052 1053Deprecated RGB Formats1054======================1055 1056Formats defined in :ref:`pixfmt-rgb-deprecated` are deprecated and must not be1057used by new drivers. They are documented here for reference. The meaning of1058their alpha bits ``(a)`` is ill-defined and they are interpreted as in either1059the corresponding ARGB or XRGB format, depending on the driver.1060 1061.. raw:: latex1062 1063 \begingroup1064 \tiny1065 \setlength{\tabcolsep}{2pt}1066 1067.. tabularcolumns:: |p{2.6cm}|p{0.70cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|1068 1069.. _pixfmt-rgb-deprecated:1070 1071.. flat-table:: Deprecated Packed RGB Image Formats1072 :header-rows: 21073 :stub-columns: 01074 1075 * - Identifier1076 - Code1077 - :cspan:`7` Byte 0 in memory1078 1079 - :cspan:`7` Byte 11080 1081 - :cspan:`7` Byte 21082 1083 - :cspan:`7` Byte 31084 * -1085 -1086 - 71087 - 61088 - 51089 - 41090 - 31091 - 21092 - 11093 - 01094 1095 - 71096 - 61097 - 51098 - 41099 - 31100 - 21101 - 11102 - 01103 1104 - 71105 - 61106 - 51107 - 41108 - 31109 - 21110 - 11111 - 01112 1113 - 71114 - 61115 - 51116 - 41117 - 31118 - 21119 - 11120 - 01121 * .. _V4L2-PIX-FMT-RGB444:1122 1123 - ``V4L2_PIX_FMT_RGB444``1124 - 'R444'1125 1126 - g\ :sub:`3`1127 - g\ :sub:`2`1128 - g\ :sub:`1`1129 - g\ :sub:`0`1130 - b\ :sub:`3`1131 - b\ :sub:`2`1132 - b\ :sub:`1`1133 - b\ :sub:`0`1134 1135 - a\ :sub:`3`1136 - a\ :sub:`2`1137 - a\ :sub:`1`1138 - a\ :sub:`0`1139 - r\ :sub:`3`1140 - r\ :sub:`2`1141 - r\ :sub:`1`1142 - r\ :sub:`0`1143 -1144 * .. _V4L2-PIX-FMT-RGB555:1145 1146 - ``V4L2_PIX_FMT_RGB555``1147 - 'RGBO'1148 1149 - g\ :sub:`2`1150 - g\ :sub:`1`1151 - g\ :sub:`0`1152 - b\ :sub:`4`1153 - b\ :sub:`3`1154 - b\ :sub:`2`1155 - b\ :sub:`1`1156 - b\ :sub:`0`1157 1158 - a1159 - r\ :sub:`4`1160 - r\ :sub:`3`1161 - r\ :sub:`2`1162 - r\ :sub:`1`1163 - r\ :sub:`0`1164 - g\ :sub:`4`1165 - g\ :sub:`3`1166 -1167 * .. _V4L2-PIX-FMT-RGB555X:1168 1169 - ``V4L2_PIX_FMT_RGB555X``1170 - 'RGBQ'1171 1172 - a1173 - r\ :sub:`4`1174 - r\ :sub:`3`1175 - r\ :sub:`2`1176 - r\ :sub:`1`1177 - r\ :sub:`0`1178 - g\ :sub:`4`1179 - g\ :sub:`3`1180 1181 - g\ :sub:`2`1182 - g\ :sub:`1`1183 - g\ :sub:`0`1184 - b\ :sub:`4`1185 - b\ :sub:`3`1186 - b\ :sub:`2`1187 - b\ :sub:`1`1188 - b\ :sub:`0`1189 -1190 * .. _V4L2-PIX-FMT-BGR32:1191 1192 - ``V4L2_PIX_FMT_BGR32``1193 - 'BGR4'1194 1195 - b\ :sub:`7`1196 - b\ :sub:`6`1197 - b\ :sub:`5`1198 - b\ :sub:`4`1199 - b\ :sub:`3`1200 - b\ :sub:`2`1201 - b\ :sub:`1`1202 - b\ :sub:`0`1203 1204 - g\ :sub:`7`1205 - g\ :sub:`6`1206 - g\ :sub:`5`1207 - g\ :sub:`4`1208 - g\ :sub:`3`1209 - g\ :sub:`2`1210 - g\ :sub:`1`1211 - g\ :sub:`0`1212 1213 - r\ :sub:`7`1214 - r\ :sub:`6`1215 - r\ :sub:`5`1216 - r\ :sub:`4`1217 - r\ :sub:`3`1218 - r\ :sub:`2`1219 - r\ :sub:`1`1220 - r\ :sub:`0`1221 1222 - a\ :sub:`7`1223 - a\ :sub:`6`1224 - a\ :sub:`5`1225 - a\ :sub:`4`1226 - a\ :sub:`3`1227 - a\ :sub:`2`1228 - a\ :sub:`1`1229 - a\ :sub:`0`1230 * .. _V4L2-PIX-FMT-RGB32:1231 1232 - ``V4L2_PIX_FMT_RGB32``1233 - 'RGB4'1234 1235 - a\ :sub:`7`1236 - a\ :sub:`6`1237 - a\ :sub:`5`1238 - a\ :sub:`4`1239 - a\ :sub:`3`1240 - a\ :sub:`2`1241 - a\ :sub:`1`1242 - a\ :sub:`0`1243 1244 - r\ :sub:`7`1245 - r\ :sub:`6`1246 - r\ :sub:`5`1247 - r\ :sub:`4`1248 - r\ :sub:`3`1249 - r\ :sub:`2`1250 - r\ :sub:`1`1251 - r\ :sub:`0`1252 1253 - g\ :sub:`7`1254 - g\ :sub:`6`1255 - g\ :sub:`5`1256 - g\ :sub:`4`1257 - g\ :sub:`3`1258 - g\ :sub:`2`1259 - g\ :sub:`1`1260 - g\ :sub:`0`1261 1262 - b\ :sub:`7`1263 - b\ :sub:`6`1264 - b\ :sub:`5`1265 - b\ :sub:`4`1266 - b\ :sub:`3`1267 - b\ :sub:`2`1268 - b\ :sub:`1`1269 - b\ :sub:`0`1270 1271.. raw:: latex1272 1273 \endgroup1274 1275A test utility to determine which RGB formats a driver actually supports1276is available from the LinuxTV v4l-dvb repository. See1277`https://linuxtv.org/repo/ <https://linuxtv.org/repo/>`__ for access1278instructions.1279