Commit | Line | Data |
---|---|---|
5377d91f MH |
1 | .. -*- coding: utf-8; mode: rst -*- |
2 | ||
3 | ******************************** | |
4 | Detailed Colorspace Descriptions | |
5 | ******************************** | |
6 | ||
7 | ||
8 | .. _col-smpte-170m: | |
9 | ||
10 | Colorspace SMPTE 170M (V4L2_COLORSPACE_SMPTE170M) | |
11 | ================================================= | |
12 | ||
13 | The :ref:`smpte170m` standard defines the colorspace used by NTSC and | |
14 | PAL and by SDTV in general. The default transfer function is | |
15 | ``V4L2_XFER_FUNC_709``. The default Y'CbCr encoding is | |
16 | ``V4L2_YCBCR_ENC_601``. The default Y'CbCr quantization is limited | |
17 | range. The chromaticities of the primary colors and the white reference | |
18 | are: | |
19 | ||
20 | ||
21 | ||
22 | .. flat-table:: SMPTE 170M Chromaticities | |
23 | :header-rows: 1 | |
24 | :stub-columns: 0 | |
25 | :widths: 1 1 2 | |
26 | ||
27 | ||
28 | - .. row 1 | |
29 | ||
30 | - Color | |
31 | ||
32 | - x | |
33 | ||
34 | - y | |
35 | ||
36 | - .. row 2 | |
37 | ||
38 | - Red | |
39 | ||
40 | - 0.630 | |
41 | ||
42 | - 0.340 | |
43 | ||
44 | - .. row 3 | |
45 | ||
46 | - Green | |
47 | ||
48 | - 0.310 | |
49 | ||
50 | - 0.595 | |
51 | ||
52 | - .. row 4 | |
53 | ||
54 | - Blue | |
55 | ||
56 | - 0.155 | |
57 | ||
58 | - 0.070 | |
59 | ||
60 | - .. row 5 | |
61 | ||
62 | - White Reference (D65) | |
63 | ||
64 | - 0.3127 | |
65 | ||
66 | - 0.3290 | |
67 | ||
68 | ||
69 | The red, green and blue chromaticities are also often referred to as the | |
70 | SMPTE C set, so this colorspace is sometimes called SMPTE C as well. | |
71 | ||
72 | The transfer function defined for SMPTE 170M is the same as the one | |
73 | defined in Rec. 709. | |
74 | L' = -1.099(-L):sup:`0.45` + 0.099 for L ≤ -0.018 | |
75 | ||
76 | L' = 4.5L for -0.018 < L < 0.018 | |
77 | ||
78 | L' = 1.099L\ :sup:`0.45` - 0.099 for L ≥ 0.018 | |
79 | ||
80 | Inverse Transfer function: | |
81 | L = -((L' - 0.099) / -1.099):sup:`1/0.45` for L' ≤ -0.081 | |
82 | ||
83 | L = L' / 4.5 for -0.081 < L' < 0.081 | |
84 | ||
85 | L = ((L' + 0.099) / 1.099)\ :sup:`1/0.45` for L' ≥ 0.081 | |
86 | ||
87 | The luminance (Y') and color difference (Cb and Cr) are obtained with | |
88 | the following ``V4L2_YCBCR_ENC_601`` encoding: | |
89 | Y' = 0.299R' + 0.587G' + 0.114B' | |
90 | ||
91 | Cb = -0.169R' - 0.331G' + 0.5B' | |
92 | ||
93 | Cr = 0.5R' - 0.419G' - 0.081B' | |
94 | ||
95 | Y' is clamped to the range [0…1] and Cb and Cr are clamped to the range | |
96 | [-0.5…0.5]. This conversion to Y'CbCr is identical to the one defined in | |
97 | the :ref:`itu601` standard and this colorspace is sometimes called | |
98 | BT.601 as well, even though BT.601 does not mention any color primaries. | |
99 | ||
100 | The default quantization is limited range, but full range is possible | |
101 | although rarely seen. | |
102 | ||
103 | ||
104 | .. _col-rec709: | |
105 | ||
106 | Colorspace Rec. 709 (V4L2_COLORSPACE_REC709) | |
107 | ============================================ | |
108 | ||
109 | The :ref:`itu709` standard defines the colorspace used by HDTV in | |
110 | general. The default transfer function is ``V4L2_XFER_FUNC_709``. The | |
111 | default Y'CbCr encoding is ``V4L2_YCBCR_ENC_709``. The default Y'CbCr | |
112 | quantization is limited range. The chromaticities of the primary colors | |
113 | and the white reference are: | |
114 | ||
115 | ||
116 | ||
117 | .. flat-table:: Rec. 709 Chromaticities | |
118 | :header-rows: 1 | |
119 | :stub-columns: 0 | |
120 | :widths: 1 1 2 | |
121 | ||
122 | ||
123 | - .. row 1 | |
124 | ||
125 | - Color | |
126 | ||
127 | - x | |
128 | ||
129 | - y | |
130 | ||
131 | - .. row 2 | |
132 | ||
133 | - Red | |
134 | ||
135 | - 0.640 | |
136 | ||
137 | - 0.330 | |
138 | ||
139 | - .. row 3 | |
140 | ||
141 | - Green | |
142 | ||
143 | - 0.300 | |
144 | ||
145 | - 0.600 | |
146 | ||
147 | - .. row 4 | |
148 | ||
149 | - Blue | |
150 | ||
151 | - 0.150 | |
152 | ||
153 | - 0.060 | |
154 | ||
155 | - .. row 5 | |
156 | ||
157 | - White Reference (D65) | |
158 | ||
159 | - 0.3127 | |
160 | ||
161 | - 0.3290 | |
162 | ||
163 | ||
164 | The full name of this standard is Rec. ITU-R BT.709-5. | |
165 | ||
166 | Transfer function. Normally L is in the range [0…1], but for the | |
167 | extended gamut xvYCC encoding values outside that range are allowed. | |
168 | L' = -1.099(-L):sup:`0.45` + 0.099 for L ≤ -0.018 | |
169 | ||
170 | L' = 4.5L for -0.018 < L < 0.018 | |
171 | ||
172 | L' = 1.099L\ :sup:`0.45` - 0.099 for L ≥ 0.018 | |
173 | ||
174 | Inverse Transfer function: | |
175 | L = -((L' - 0.099) / -1.099):sup:`1/0.45` for L' ≤ -0.081 | |
176 | ||
177 | L = L' / 4.5 for -0.081 < L' < 0.081 | |
178 | ||
179 | L = ((L' + 0.099) / 1.099)\ :sup:`1/0.45` for L' ≥ 0.081 | |
180 | ||
181 | The luminance (Y') and color difference (Cb and Cr) are obtained with | |
182 | the following ``V4L2_YCBCR_ENC_709`` encoding: | |
183 | Y' = 0.2126R' + 0.7152G' + 0.0722B' | |
184 | ||
185 | Cb = -0.1146R' - 0.3854G' + 0.5B' | |
186 | ||
187 | Cr = 0.5R' - 0.4542G' - 0.0458B' | |
188 | ||
189 | Y' is clamped to the range [0…1] and Cb and Cr are clamped to the range | |
190 | [-0.5…0.5]. | |
191 | ||
192 | The default quantization is limited range, but full range is possible | |
193 | although rarely seen. | |
194 | ||
195 | The ``V4L2_YCBCR_ENC_709`` encoding described above is the default for | |
196 | this colorspace, but it can be overridden with ``V4L2_YCBCR_ENC_601``, | |
197 | in which case the BT.601 Y'CbCr encoding is used. | |
198 | ||
199 | Two additional extended gamut Y'CbCr encodings are also possible with | |
200 | this colorspace: | |
201 | ||
202 | The xvYCC 709 encoding (``V4L2_YCBCR_ENC_XV709``, :ref:`xvycc`) is | |
203 | similar to the Rec. 709 encoding, but it allows for R', G' and B' values | |
204 | that are outside the range [0…1]. The resulting Y', Cb and Cr values are | |
205 | scaled and offset: | |
206 | Y' = (219 / 256) * (0.2126R' + 0.7152G' + 0.0722B') + (16 / 256) | |
207 | ||
208 | Cb = (224 / 256) * (-0.1146R' - 0.3854G' + 0.5B') | |
209 | ||
210 | Cr = (224 / 256) * (0.5R' - 0.4542G' - 0.0458B') | |
211 | ||
212 | The xvYCC 601 encoding (``V4L2_YCBCR_ENC_XV601``, :ref:`xvycc`) is | |
213 | similar to the BT.601 encoding, but it allows for R', G' and B' values | |
214 | that are outside the range [0…1]. The resulting Y', Cb and Cr values are | |
215 | scaled and offset: | |
216 | Y' = (219 / 256) * (0.299R' + 0.587G' + 0.114B') + (16 / 256) | |
217 | ||
218 | Cb = (224 / 256) * (-0.169R' - 0.331G' + 0.5B') | |
219 | ||
220 | Cr = (224 / 256) * (0.5R' - 0.419G' - 0.081B') | |
221 | ||
222 | Y' is clamped to the range [0…1] and Cb and Cr are clamped to the range | |
223 | [-0.5…0.5]. The non-standard xvYCC 709 or xvYCC 601 encodings can be | |
224 | used by selecting ``V4L2_YCBCR_ENC_XV709`` or ``V4L2_YCBCR_ENC_XV601``. | |
225 | The xvYCC encodings always use full range quantization. | |
226 | ||
227 | ||
228 | .. _col-srgb: | |
229 | ||
230 | Colorspace sRGB (V4L2_COLORSPACE_SRGB) | |
231 | ====================================== | |
232 | ||
233 | The :ref:`srgb` standard defines the colorspace used by most webcams | |
234 | and computer graphics. The default transfer function is | |
235 | ``V4L2_XFER_FUNC_SRGB``. The default Y'CbCr encoding is | |
236 | ``V4L2_YCBCR_ENC_SYCC``. The default Y'CbCr quantization is full range. | |
237 | The chromaticities of the primary colors and the white reference are: | |
238 | ||
239 | ||
240 | ||
241 | .. flat-table:: sRGB Chromaticities | |
242 | :header-rows: 1 | |
243 | :stub-columns: 0 | |
244 | :widths: 1 1 2 | |
245 | ||
246 | ||
247 | - .. row 1 | |
248 | ||
249 | - Color | |
250 | ||
251 | - x | |
252 | ||
253 | - y | |
254 | ||
255 | - .. row 2 | |
256 | ||
257 | - Red | |
258 | ||
259 | - 0.640 | |
260 | ||
261 | - 0.330 | |
262 | ||
263 | - .. row 3 | |
264 | ||
265 | - Green | |
266 | ||
267 | - 0.300 | |
268 | ||
269 | - 0.600 | |
270 | ||
271 | - .. row 4 | |
272 | ||
273 | - Blue | |
274 | ||
275 | - 0.150 | |
276 | ||
277 | - 0.060 | |
278 | ||
279 | - .. row 5 | |
280 | ||
281 | - White Reference (D65) | |
282 | ||
283 | - 0.3127 | |
284 | ||
285 | - 0.3290 | |
286 | ||
287 | ||
288 | These chromaticities are identical to the Rec. 709 colorspace. | |
289 | ||
290 | Transfer function. Note that negative values for L are only used by the | |
291 | Y'CbCr conversion. | |
292 | L' = -1.055(-L):sup:`1/2.4` + 0.055 for L < -0.0031308 | |
293 | ||
294 | L' = 12.92L for -0.0031308 ≤ L ≤ 0.0031308 | |
295 | ||
296 | L' = 1.055L\ :sup:`1/2.4` - 0.055 for 0.0031308 < L ≤ 1 | |
297 | ||
298 | Inverse Transfer function: | |
299 | L = -((-L' + 0.055) / 1.055)\ :sup:`2.4` for L' < -0.04045 | |
300 | ||
301 | L = L' / 12.92 for -0.04045 ≤ L' ≤ 0.04045 | |
302 | ||
303 | L = ((L' + 0.055) / 1.055)\ :sup:`2.4` for L' > 0.04045 | |
304 | ||
305 | The luminance (Y') and color difference (Cb and Cr) are obtained with | |
306 | the following ``V4L2_YCBCR_ENC_SYCC`` encoding as defined by | |
307 | :ref:`sycc`: | |
308 | Y' = 0.2990R' + 0.5870G' + 0.1140B' | |
309 | ||
310 | Cb = -0.1687R' - 0.3313G' + 0.5B' | |
311 | ||
312 | Cr = 0.5R' - 0.4187G' - 0.0813B' | |
313 | ||
314 | Y' is clamped to the range [0…1] and Cb and Cr are clamped to the range | |
315 | [-0.5…0.5]. The ``V4L2_YCBCR_ENC_SYCC`` quantization is always full | |
316 | range. Although this Y'CbCr encoding looks very similar to the | |
317 | ``V4L2_YCBCR_ENC_XV601`` encoding, it is not. The | |
318 | ``V4L2_YCBCR_ENC_XV601`` scales and offsets the Y'CbCr values before | |
319 | quantization, but this encoding does not do that. | |
320 | ||
321 | ||
322 | .. _col-adobergb: | |
323 | ||
324 | Colorspace Adobe RGB (V4L2_COLORSPACE_ADOBERGB) | |
325 | =============================================== | |
326 | ||
327 | The :ref:`adobergb` standard defines the colorspace used by computer | |
328 | graphics that use the AdobeRGB colorspace. This is also known as the | |
329 | :ref:`oprgb` standard. The default transfer function is | |
330 | ``V4L2_XFER_FUNC_ADOBERGB``. The default Y'CbCr encoding is | |
331 | ``V4L2_YCBCR_ENC_601``. The default Y'CbCr quantization is limited | |
332 | range. The chromaticities of the primary colors and the white reference | |
333 | are: | |
334 | ||
335 | ||
336 | ||
337 | .. flat-table:: Adobe RGB Chromaticities | |
338 | :header-rows: 1 | |
339 | :stub-columns: 0 | |
340 | :widths: 1 1 2 | |
341 | ||
342 | ||
343 | - .. row 1 | |
344 | ||
345 | - Color | |
346 | ||
347 | - x | |
348 | ||
349 | - y | |
350 | ||
351 | - .. row 2 | |
352 | ||
353 | - Red | |
354 | ||
355 | - 0.6400 | |
356 | ||
357 | - 0.3300 | |
358 | ||
359 | - .. row 3 | |
360 | ||
361 | - Green | |
362 | ||
363 | - 0.2100 | |
364 | ||
365 | - 0.7100 | |
366 | ||
367 | - .. row 4 | |
368 | ||
369 | - Blue | |
370 | ||
371 | - 0.1500 | |
372 | ||
373 | - 0.0600 | |
374 | ||
375 | - .. row 5 | |
376 | ||
377 | - White Reference (D65) | |
378 | ||
379 | - 0.3127 | |
380 | ||
381 | - 0.3290 | |
382 | ||
383 | ||
384 | ||
385 | Transfer function: | |
386 | L' = L\ :sup:`1/2.19921875` | |
387 | ||
388 | Inverse Transfer function: | |
389 | L = L'\ :sup:`2.19921875` | |
390 | ||
391 | The luminance (Y') and color difference (Cb and Cr) are obtained with | |
392 | the following ``V4L2_YCBCR_ENC_601`` encoding: | |
393 | Y' = 0.299R' + 0.587G' + 0.114B' | |
394 | ||
395 | Cb = -0.169R' - 0.331G' + 0.5B' | |
396 | ||
397 | Cr = 0.5R' - 0.419G' - 0.081B' | |
398 | ||
399 | Y' is clamped to the range [0…1] and Cb and Cr are clamped to the range | |
400 | [-0.5…0.5]. This transform is identical to one defined in SMPTE | |
401 | 170M/BT.601. The Y'CbCr quantization is limited range. | |
402 | ||
403 | ||
404 | .. _col-bt2020: | |
405 | ||
406 | Colorspace BT.2020 (V4L2_COLORSPACE_BT2020) | |
407 | =========================================== | |
408 | ||
409 | The :ref:`itu2020` standard defines the colorspace used by Ultra-high | |
410 | definition television (UHDTV). The default transfer function is | |
411 | ``V4L2_XFER_FUNC_709``. The default Y'CbCr encoding is | |
412 | ``V4L2_YCBCR_ENC_BT2020``. The default R'G'B' quantization is limited | |
413 | range (!), and so is the default Y'CbCr quantization. The chromaticities | |
414 | of the primary colors and the white reference are: | |
415 | ||
416 | ||
417 | ||
418 | .. flat-table:: BT.2020 Chromaticities | |
419 | :header-rows: 1 | |
420 | :stub-columns: 0 | |
421 | :widths: 1 1 2 | |
422 | ||
423 | ||
424 | - .. row 1 | |
425 | ||
426 | - Color | |
427 | ||
428 | - x | |
429 | ||
430 | - y | |
431 | ||
432 | - .. row 2 | |
433 | ||
434 | - Red | |
435 | ||
436 | - 0.708 | |
437 | ||
438 | - 0.292 | |
439 | ||
440 | - .. row 3 | |
441 | ||
442 | - Green | |
443 | ||
444 | - 0.170 | |
445 | ||
446 | - 0.797 | |
447 | ||
448 | - .. row 4 | |
449 | ||
450 | - Blue | |
451 | ||
452 | - 0.131 | |
453 | ||
454 | - 0.046 | |
455 | ||
456 | - .. row 5 | |
457 | ||
458 | - White Reference (D65) | |
459 | ||
460 | - 0.3127 | |
461 | ||
462 | - 0.3290 | |
463 | ||
464 | ||
465 | ||
466 | Transfer function (same as Rec. 709): | |
467 | L' = 4.5L for 0 ≤ L < 0.018 | |
468 | ||
469 | L' = 1.099L\ :sup:`0.45` - 0.099 for 0.018 ≤ L ≤ 1 | |
470 | ||
471 | Inverse Transfer function: | |
472 | L = L' / 4.5 for L' < 0.081 | |
473 | ||
474 | L = ((L' + 0.099) / 1.099)\ :sup:`1/0.45` for L' ≥ 0.081 | |
475 | ||
476 | The luminance (Y') and color difference (Cb and Cr) are obtained with | |
477 | the following ``V4L2_YCBCR_ENC_BT2020`` encoding: | |
478 | Y' = 0.2627R' + 0.6780G' + 0.0593B' | |
479 | ||
480 | Cb = -0.1396R' - 0.3604G' + 0.5B' | |
481 | ||
482 | Cr = 0.5R' - 0.4598G' - 0.0402B' | |
483 | ||
484 | Y' is clamped to the range [0…1] and Cb and Cr are clamped to the range | |
485 | [-0.5…0.5]. The Y'CbCr quantization is limited range. | |
486 | ||
487 | There is also an alternate constant luminance R'G'B' to Yc'CbcCrc | |
488 | (``V4L2_YCBCR_ENC_BT2020_CONST_LUM``) encoding: | |
489 | ||
490 | Luma: | |
491 | Yc' = (0.2627R + 0.6780G + 0.0593B)' | |
492 | ||
493 | B' - Yc' ≤ 0: | |
494 | Cbc = (B' - Yc') / 1.9404 | |
495 | ||
496 | B' - Yc' > 0: | |
497 | Cbc = (B' - Yc') / 1.5816 | |
498 | ||
499 | R' - Yc' ≤ 0: | |
500 | Crc = (R' - Y') / 1.7184 | |
501 | ||
502 | R' - Yc' > 0: | |
503 | Crc = (R' - Y') / 0.9936 | |
504 | ||
505 | Yc' is clamped to the range [0…1] and Cbc and Crc are clamped to the | |
506 | range [-0.5…0.5]. The Yc'CbcCrc quantization is limited range. | |
507 | ||
508 | ||
509 | .. _col-dcip3: | |
510 | ||
511 | Colorspace DCI-P3 (V4L2_COLORSPACE_DCI_P3) | |
512 | ========================================== | |
513 | ||
514 | The :ref:`smpte431` standard defines the colorspace used by cinema | |
515 | projectors that use the DCI-P3 colorspace. The default transfer function | |
516 | is ``V4L2_XFER_FUNC_DCI_P3``. The default Y'CbCr encoding is | |
517 | ``V4L2_YCBCR_ENC_709``. Note that this colorspace does not specify a | |
518 | Y'CbCr encoding since it is not meant to be encoded to Y'CbCr. So this | |
519 | default Y'CbCr encoding was picked because it is the HDTV encoding. The | |
520 | default Y'CbCr quantization is limited range. The chromaticities of the | |
521 | primary colors and the white reference are: | |
522 | ||
523 | ||
524 | ||
525 | .. flat-table:: DCI-P3 Chromaticities | |
526 | :header-rows: 1 | |
527 | :stub-columns: 0 | |
528 | :widths: 1 1 2 | |
529 | ||
530 | ||
531 | - .. row 1 | |
532 | ||
533 | - Color | |
534 | ||
535 | - x | |
536 | ||
537 | - y | |
538 | ||
539 | - .. row 2 | |
540 | ||
541 | - Red | |
542 | ||
543 | - 0.6800 | |
544 | ||
545 | - 0.3200 | |
546 | ||
547 | - .. row 3 | |
548 | ||
549 | - Green | |
550 | ||
551 | - 0.2650 | |
552 | ||
553 | - 0.6900 | |
554 | ||
555 | - .. row 4 | |
556 | ||
557 | - Blue | |
558 | ||
559 | - 0.1500 | |
560 | ||
561 | - 0.0600 | |
562 | ||
563 | - .. row 5 | |
564 | ||
565 | - White Reference | |
566 | ||
567 | - 0.3140 | |
568 | ||
569 | - 0.3510 | |
570 | ||
571 | ||
572 | ||
573 | Transfer function: | |
574 | L' = L\ :sup:`1/2.6` | |
575 | ||
576 | Inverse Transfer function: | |
577 | L = L'\ :sup:`2.6` | |
578 | ||
579 | Y'CbCr encoding is not specified. V4L2 defaults to Rec. 709. | |
580 | ||
581 | ||
582 | .. _col-smpte-240m: | |
583 | ||
584 | Colorspace SMPTE 240M (V4L2_COLORSPACE_SMPTE240M) | |
585 | ================================================= | |
586 | ||
587 | The :ref:`smpte240m` standard was an interim standard used during the | |
588 | early days of HDTV (1988-1998). It has been superseded by Rec. 709. The | |
589 | default transfer function is ``V4L2_XFER_FUNC_SMPTE240M``. The default | |
590 | Y'CbCr encoding is ``V4L2_YCBCR_ENC_SMPTE240M``. The default Y'CbCr | |
591 | quantization is limited range. The chromaticities of the primary colors | |
592 | and the white reference are: | |
593 | ||
594 | ||
595 | ||
596 | .. flat-table:: SMPTE 240M Chromaticities | |
597 | :header-rows: 1 | |
598 | :stub-columns: 0 | |
599 | :widths: 1 1 2 | |
600 | ||
601 | ||
602 | - .. row 1 | |
603 | ||
604 | - Color | |
605 | ||
606 | - x | |
607 | ||
608 | - y | |
609 | ||
610 | - .. row 2 | |
611 | ||
612 | - Red | |
613 | ||
614 | - 0.630 | |
615 | ||
616 | - 0.340 | |
617 | ||
618 | - .. row 3 | |
619 | ||
620 | - Green | |
621 | ||
622 | - 0.310 | |
623 | ||
624 | - 0.595 | |
625 | ||
626 | - .. row 4 | |
627 | ||
628 | - Blue | |
629 | ||
630 | - 0.155 | |
631 | ||
632 | - 0.070 | |
633 | ||
634 | - .. row 5 | |
635 | ||
636 | - White Reference (D65) | |
637 | ||
638 | - 0.3127 | |
639 | ||
640 | - 0.3290 | |
641 | ||
642 | ||
643 | These chromaticities are identical to the SMPTE 170M colorspace. | |
644 | ||
645 | Transfer function: | |
646 | L' = 4L for 0 ≤ L < 0.0228 | |
647 | ||
648 | L' = 1.1115L\ :sup:`0.45` - 0.1115 for 0.0228 ≤ L ≤ 1 | |
649 | ||
650 | Inverse Transfer function: | |
651 | L = L' / 4 for 0 ≤ L' < 0.0913 | |
652 | ||
653 | L = ((L' + 0.1115) / 1.1115)\ :sup:`1/0.45` for L' ≥ 0.0913 | |
654 | ||
655 | The luminance (Y') and color difference (Cb and Cr) are obtained with | |
656 | the following ``V4L2_YCBCR_ENC_SMPTE240M`` encoding: | |
657 | Y' = 0.2122R' + 0.7013G' + 0.0865B' | |
658 | ||
659 | Cb = -0.1161R' - 0.3839G' + 0.5B' | |
660 | ||
661 | Cr = 0.5R' - 0.4451G' - 0.0549B' | |
662 | ||
663 | Yc' is clamped to the range [0…1] and Cbc and Crc are clamped to the | |
664 | range [-0.5…0.5]. The Y'CbCr quantization is limited range. | |
665 | ||
666 | ||
667 | .. _col-sysm: | |
668 | ||
669 | Colorspace NTSC 1953 (V4L2_COLORSPACE_470_SYSTEM_M) | |
670 | =================================================== | |
671 | ||
672 | This standard defines the colorspace used by NTSC in 1953. In practice | |
673 | this colorspace is obsolete and SMPTE 170M should be used instead. The | |
674 | default transfer function is ``V4L2_XFER_FUNC_709``. The default Y'CbCr | |
675 | encoding is ``V4L2_YCBCR_ENC_601``. The default Y'CbCr quantization is | |
676 | limited range. The chromaticities of the primary colors and the white | |
677 | reference are: | |
678 | ||
679 | ||
680 | ||
681 | .. flat-table:: NTSC 1953 Chromaticities | |
682 | :header-rows: 1 | |
683 | :stub-columns: 0 | |
684 | :widths: 1 1 2 | |
685 | ||
686 | ||
687 | - .. row 1 | |
688 | ||
689 | - Color | |
690 | ||
691 | - x | |
692 | ||
693 | - y | |
694 | ||
695 | - .. row 2 | |
696 | ||
697 | - Red | |
698 | ||
699 | - 0.67 | |
700 | ||
701 | - 0.33 | |
702 | ||
703 | - .. row 3 | |
704 | ||
705 | - Green | |
706 | ||
707 | - 0.21 | |
708 | ||
709 | - 0.71 | |
710 | ||
711 | - .. row 4 | |
712 | ||
713 | - Blue | |
714 | ||
715 | - 0.14 | |
716 | ||
717 | - 0.08 | |
718 | ||
719 | - .. row 5 | |
720 | ||
721 | - White Reference (C) | |
722 | ||
723 | - 0.310 | |
724 | ||
725 | - 0.316 | |
726 | ||
727 | ||
728 | Note that this colorspace uses Illuminant C instead of D65 as the white | |
729 | reference. To correctly convert an image in this colorspace to another | |
730 | that uses D65 you need to apply a chromatic adaptation algorithm such as | |
731 | the Bradford method. | |
732 | ||
733 | The transfer function was never properly defined for NTSC 1953. The Rec. | |
734 | 709 transfer function is recommended in the literature: | |
735 | L' = 4.5L for 0 ≤ L < 0.018 | |
736 | ||
737 | L' = 1.099L\ :sup:`0.45` - 0.099 for 0.018 ≤ L ≤ 1 | |
738 | ||
739 | Inverse Transfer function: | |
740 | L = L' / 4.5 for L' < 0.081 | |
741 | ||
742 | L = ((L' + 0.099) / 1.099)\ :sup:`1/0.45` for L' ≥ 0.081 | |
743 | ||
744 | The luminance (Y') and color difference (Cb and Cr) are obtained with | |
745 | the following ``V4L2_YCBCR_ENC_601`` encoding: | |
746 | Y' = 0.299R' + 0.587G' + 0.114B' | |
747 | ||
748 | Cb = -0.169R' - 0.331G' + 0.5B' | |
749 | ||
750 | Cr = 0.5R' - 0.419G' - 0.081B' | |
751 | ||
752 | Y' is clamped to the range [0…1] and Cb and Cr are clamped to the range | |
753 | [-0.5…0.5]. The Y'CbCr quantization is limited range. This transform is | |
754 | identical to one defined in SMPTE 170M/BT.601. | |
755 | ||
756 | ||
757 | .. _col-sysbg: | |
758 | ||
759 | Colorspace EBU Tech. 3213 (V4L2_COLORSPACE_470_SYSTEM_BG) | |
760 | ========================================================= | |
761 | ||
762 | The :ref:`tech3213` standard defines the colorspace used by PAL/SECAM | |
763 | in 1975. In practice this colorspace is obsolete and SMPTE 170M should | |
764 | be used instead. The default transfer function is | |
765 | ``V4L2_XFER_FUNC_709``. The default Y'CbCr encoding is | |
766 | ``V4L2_YCBCR_ENC_601``. The default Y'CbCr quantization is limited | |
767 | range. The chromaticities of the primary colors and the white reference | |
768 | are: | |
769 | ||
770 | ||
771 | ||
772 | .. flat-table:: EBU Tech. 3213 Chromaticities | |
773 | :header-rows: 1 | |
774 | :stub-columns: 0 | |
775 | :widths: 1 1 2 | |
776 | ||
777 | ||
778 | - .. row 1 | |
779 | ||
780 | - Color | |
781 | ||
782 | - x | |
783 | ||
784 | - y | |
785 | ||
786 | - .. row 2 | |
787 | ||
788 | - Red | |
789 | ||
790 | - 0.64 | |
791 | ||
792 | - 0.33 | |
793 | ||
794 | - .. row 3 | |
795 | ||
796 | - Green | |
797 | ||
798 | - 0.29 | |
799 | ||
800 | - 0.60 | |
801 | ||
802 | - .. row 4 | |
803 | ||
804 | - Blue | |
805 | ||
806 | - 0.15 | |
807 | ||
808 | - 0.06 | |
809 | ||
810 | - .. row 5 | |
811 | ||
812 | - White Reference (D65) | |
813 | ||
814 | - 0.3127 | |
815 | ||
816 | - 0.3290 | |
817 | ||
818 | ||
819 | ||
820 | The transfer function was never properly defined for this colorspace. | |
821 | The Rec. 709 transfer function is recommended in the literature: | |
822 | L' = 4.5L for 0 ≤ L < 0.018 | |
823 | ||
824 | L' = 1.099L\ :sup:`0.45` - 0.099 for 0.018 ≤ L ≤ 1 | |
825 | ||
826 | Inverse Transfer function: | |
827 | L = L' / 4.5 for L' < 0.081 | |
828 | ||
829 | L = ((L' + 0.099) / 1.099)\ :sup:`1/0.45` for L' ≥ 0.081 | |
830 | ||
831 | The luminance (Y') and color difference (Cb and Cr) are obtained with | |
832 | the following ``V4L2_YCBCR_ENC_601`` encoding: | |
833 | Y' = 0.299R' + 0.587G' + 0.114B' | |
834 | ||
835 | Cb = -0.169R' - 0.331G' + 0.5B' | |
836 | ||
837 | Cr = 0.5R' - 0.419G' - 0.081B' | |
838 | ||
839 | Y' is clamped to the range [0…1] and Cb and Cr are clamped to the range | |
840 | [-0.5…0.5]. The Y'CbCr quantization is limited range. This transform is | |
841 | identical to one defined in SMPTE 170M/BT.601. | |
842 | ||
843 | ||
844 | .. _col-jpeg: | |
845 | ||
846 | Colorspace JPEG (V4L2_COLORSPACE_JPEG) | |
847 | ====================================== | |
848 | ||
849 | This colorspace defines the colorspace used by most (Motion-)JPEG | |
850 | formats. The chromaticities of the primary colors and the white | |
851 | reference are identical to sRGB. The transfer function use is | |
852 | ``V4L2_XFER_FUNC_SRGB``. The Y'CbCr encoding is ``V4L2_YCBCR_ENC_601`` | |
853 | with full range quantization where Y' is scaled to [0…255] and Cb/Cr are | |
854 | scaled to [-128…128] and then clipped to [-128…127]. | |
855 | ||
856 | Note that the JPEG standard does not actually store colorspace | |
857 | information. So if something other than sRGB is used, then the driver | |
858 | will have to set that information explicitly. Effectively | |
859 | ``V4L2_COLORSPACE_JPEG`` can be considered to be an abbreviation for | |
860 | ``V4L2_COLORSPACE_SRGB``, ``V4L2_YCBCR_ENC_601`` and | |
861 | ``V4L2_QUANTIZATION_FULL_RANGE``. | |
862 | ||
863 | ||
864 | .. ------------------------------------------------------------------------------ | |
865 | .. This file was automatically converted from DocBook-XML with the dbxml | |
866 | .. library (https://github.com/return42/sphkerneldoc). The origin XML comes | |
867 | .. from the linux kernel, refer to: | |
868 | .. | |
869 | .. * https://github.com/torvalds/linux/tree/master/Documentation/DocBook | |
870 | .. ------------------------------------------------------------------------------ |