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.. _packed-hsv:
11
12******************
13Packed HSV formats
14******************
15
16Description
17===========
18
19The *hue* (h) is measured in degrees, the equivalence between degrees and LSBs
20depends on the hsv-encoding used, see :ref:`colorspaces`.
21The *saturation* (s) and the *value* (v) are measured in percentage of the
22cylinder: 0 being the smallest value and 255 the maximum.
23
24
25The values are packed in 24 or 32 bit formats.
26
27
28.. raw:: latex
29
30    \begingroup
31    \tiny
32    \setlength{\tabcolsep}{2pt}
33
34.. tabularcolumns:: |p{2.6cm}|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}|p{0.22cm}|
35
36.. _packed-hsv-formats:
37
38.. flat-table:: Packed HSV Image Formats
39    :header-rows:  2
40    :stub-columns: 0
41
42    * - Identifier
43      - Code
44      -
45      - :cspan:`7` Byte 0 in memory
46      - :cspan:`7` Byte 1
47      - :cspan:`7` Byte 2
48      - :cspan:`7` Byte 3
49    * -
50      -
51      - Bit
52      - 7
53      - 6
54      - 5
55      - 4
56      - 3
57      - 2
58      - 1
59      - 0
60
61      - 7
62      - 6
63      - 5
64      - 4
65      - 3
66      - 2
67      - 1
68      - 0
69
70      - 7
71      - 6
72      - 5
73      - 4
74      - 3
75      - 2
76      - 1
77      - 0
78
79      - 7
80      - 6
81      - 5
82      - 4
83      - 3
84      - 2
85      - 1
86      - 0
87    * .. _V4L2-PIX-FMT-HSV32:
88
89      - ``V4L2_PIX_FMT_HSV32``
90      - 'HSV4'
91      -
92      -
93      -
94      -
95      -
96      -
97      -
98      -
99      -
100
101      - h\ :sub:`7`
102      - h\ :sub:`6`
103      - h\ :sub:`5`
104      - h\ :sub:`4`
105      - h\ :sub:`3`
106      - h\ :sub:`2`
107      - h\ :sub:`1`
108      - h\ :sub:`0`
109
110      - s\ :sub:`7`
111      - s\ :sub:`6`
112      - s\ :sub:`5`
113      - s\ :sub:`4`
114      - s\ :sub:`3`
115      - s\ :sub:`2`
116      - s\ :sub:`1`
117      - s\ :sub:`0`
118
119      - v\ :sub:`7`
120      - v\ :sub:`6`
121      - v\ :sub:`5`
122      - v\ :sub:`4`
123      - v\ :sub:`3`
124      - v\ :sub:`2`
125      - v\ :sub:`1`
126      - v\ :sub:`0`
127    * .. _V4L2-PIX-FMT-HSV24:
128
129      - ``V4L2_PIX_FMT_HSV24``
130      - 'HSV3'
131      -
132      - h\ :sub:`7`
133      - h\ :sub:`6`
134      - h\ :sub:`5`
135      - h\ :sub:`4`
136      - h\ :sub:`3`
137      - h\ :sub:`2`
138      - h\ :sub:`1`
139      - h\ :sub:`0`
140
141      - s\ :sub:`7`
142      - s\ :sub:`6`
143      - s\ :sub:`5`
144      - s\ :sub:`4`
145      - s\ :sub:`3`
146      - s\ :sub:`2`
147      - s\ :sub:`1`
148      - s\ :sub:`0`
149
150      - v\ :sub:`7`
151      - v\ :sub:`6`
152      - v\ :sub:`5`
153      - v\ :sub:`4`
154      - v\ :sub:`3`
155      - v\ :sub:`2`
156      - v\ :sub:`1`
157      - v\ :sub:`0`
158      -
159
160.. raw:: latex
161
162    \endgroup
163
164Bit 7 is the most significant bit.
165