1.. Permission is granted to copy, distribute and/or modify this
2.. document under the terms of the GNU Free Documentation License,
3.. Version 1.1 or any later version published by the Free Software
4.. Foundation, with no Invariant Sections, no Front-Cover Texts
5.. and no Back-Cover Texts. A copy of the license is included at
6.. Documentation/userspace-api/media/fdl-appendix.rst.
7..
8.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
9
10.. _V4L2-PIX-FMT-SRGGB12P:
11.. _v4l2-pix-fmt-sbggr12p:
12.. _v4l2-pix-fmt-sgbrg12p:
13.. _v4l2-pix-fmt-sgrbg12p:
14
15*******************************************************************************************************************************
16V4L2_PIX_FMT_SRGGB12P ('pRCC'), V4L2_PIX_FMT_SGRBG12P ('pgCC'), V4L2_PIX_FMT_SGBRG12P ('pGCC'), V4L2_PIX_FMT_SBGGR12P ('pBCC'),
17*******************************************************************************************************************************
18
19
2012-bit packed Bayer formats
21---------------------------
22
23
24Description
25===========
26
27These four pixel formats are packed raw sRGB / Bayer formats with 12
28bits per colour. Every two consecutive samples are packed into three
29bytes. Each of the first two bytes contain the 8 high order bits of
30the pixels, and the third byte contains the four least significants
31bits of each pixel, in the same order.
32
33Each n-pixel row contains n/2 green samples and n/2 blue or red
34samples, with alternating green-red and green-blue rows. They are
35conventionally described as GRGR... BGBG..., RGRG... GBGB..., etc.
36Below is an example of a small V4L2_PIX_FMT_SBGGR12P image:
37
38**Byte Order.**
39Each cell is one byte.
40
41.. tabularcolumns:: |p{2.2cm}|p{1.2cm}|p{1.2cm}|p{3.1cm}|p{1.2cm}|p{1.2cm}|p{3.1cm}|
42
43
44.. flat-table::
45    :header-rows:  0
46    :stub-columns: 0
47    :widths:       2 1 1 1 1 1 1
48
49
50    -  -  start + 0:
51       -  B\ :sub:`00high`
52       -  G\ :sub:`01high`
53       -  G\ :sub:`01low`\ (bits 7--4)
54
55          B\ :sub:`00low`\ (bits 3--0)
56       -  B\ :sub:`02high`
57       -  G\ :sub:`03high`
58       -  G\ :sub:`03low`\ (bits 7--4)
59
60          B\ :sub:`02low`\ (bits 3--0)
61
62    -  -  start + 6:
63       -  G\ :sub:`10high`
64       -  R\ :sub:`11high`
65       -  R\ :sub:`11low`\ (bits 7--4)
66
67          G\ :sub:`10low`\ (bits 3--0)
68       -  G\ :sub:`12high`
69       -  R\ :sub:`13high`
70       -  R\ :sub:`13low`\ (bits 3--2)
71
72          G\ :sub:`12low`\ (bits 3--0)
73    -  -  start + 12:
74       -  B\ :sub:`20high`
75       -  G\ :sub:`21high`
76       -  G\ :sub:`21low`\ (bits 7--4)
77
78          B\ :sub:`20low`\ (bits 3--0)
79       -  B\ :sub:`22high`
80       -  G\ :sub:`23high`
81       -  G\ :sub:`23low`\ (bits 7--4)
82
83          B\ :sub:`22low`\ (bits 3--0)
84    -  -  start + 18:
85       -  G\ :sub:`30high`
86       -  R\ :sub:`31high`
87       -  R\ :sub:`31low`\ (bits 7--4)
88
89          G\ :sub:`30low`\ (bits 3--0)
90       -  G\ :sub:`32high`
91       -  R\ :sub:`33high`
92       -  R\ :sub:`33low`\ (bits 3--2)
93
94          G\ :sub:`32low`\ (bits 3--0)
95