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