Coverage for colour/models/rgb/transfer_functions/itur_bt_709.py: 100%

14 statements  

« prev     ^ index     » next       coverage.py v7.11.0, created at 2025-11-15 19:01 +1300

1""" 

2Recommendation ITU-R BT.709-6 

3============================= 

4 

5Define the *Recommendation ITU-R BT.709-6* opto-electrical transfer function 

6(OETF) and its inverse. 

7 

8- :func:`colour.models.oetf_BT709` 

9- :func:`colour.models.oetf_inverse_BT709` 

10 

11References 

12---------- 

13- :cite:`InternationalTelecommunicationUnion2015i` : International 

14 Telecommunication Union. (2015). Recommendation ITU-R BT.709-6 - Parameter 

15 values for the HDTV standards for production and international programme 

16 exchange BT Series Broadcasting service (pp. 1-32). 

17 https://www.itu.int/dms_pubrec/itu-r/rec/bt/\ 

18R-REC-BT.709-6-201506-I!!PDF-E.pdf 

19""" 

20 

21from __future__ import annotations 

22 

23from colour.hints import ( # noqa: TC001 

24 ArrayLike, 

25 Domain1, 

26 Range1, 

27) 

28from colour.models.rgb.transfer_functions import oetf_BT601, oetf_inverse_BT601 

29 

30__author__ = "Colour Developers" 

31__copyright__ = "Copyright 2013 Colour Developers" 

32__license__ = "BSD-3-Clause - https://opensource.org/licenses/BSD-3-Clause" 

33__maintainer__ = "Colour Developers" 

34__email__ = "colour-developers@colour-science.org" 

35__status__ = "Production" 

36 

37__all__ = [ 

38 "oetf_BT709", 

39 "oetf_inverse_BT709", 

40] 

41 

42 

43def oetf_BT709(L: Domain1) -> Range1: 

44 """ 

45 Apply the *Recommendation ITU-R BT.709-6* opto-electronic transfer 

46 function (OETF). 

47 

48 Parameters 

49 ---------- 

50 L 

51 *Luminance* :math:`L` of the image. 

52 

53 Returns 

54 ------- 

55 :class:`numpy.ndarray` 

56 Electrical signal :math:`V`. 

57 

58 Notes 

59 ----- 

60 +------------+-----------------------+---------------+ 

61 | **Domain** | **Scale - Reference** | **Scale - 1** | 

62 +============+=======================+===============+ 

63 | ``L`` | 1 | 1 | 

64 +------------+-----------------------+---------------+ 

65 

66 +------------+-----------------------+---------------+ 

67 | **Range** | **Scale - Reference** | **Scale - 1** | 

68 +============+=======================+===============+ 

69 | ``V`` | 1 | 1 | 

70 +------------+-----------------------+---------------+ 

71 

72 References 

73 ---------- 

74 :cite:`InternationalTelecommunicationUnion2015i` 

75 

76 Examples 

77 -------- 

78 >>> oetf_BT709(0.18) # doctest: +ELLIPSIS 

79 0.4090077... 

80 """ 

81 

82 return oetf_BT601(L) 

83 

84 

85def oetf_inverse_BT709(V: ArrayLike) -> Range1: 

86 """ 

87 Apply the *Recommendation ITU-R BT.709-6* inverse opto-electronic 

88 transfer function (OETF). 

89 

90 Parameters 

91 ---------- 

92 V 

93 Electrical signal :math:`V`. 

94 

95 Returns 

96 ------- 

97 :class:`numpy.ndarray` 

98 *Luminance* :math:`L` of the image. 

99 

100 Notes 

101 ----- 

102 +------------+-----------------------+---------------+ 

103 | **Domain** | **Scale - Reference** | **Scale - 1** | 

104 +============+=======================+===============+ 

105 | ``V`` | 1 | 1 | 

106 +------------+-----------------------+---------------+ 

107 

108 +------------+-----------------------+---------------+ 

109 | **Range** | **Scale - Reference** | **Scale - 1** | 

110 +============+=======================+===============+ 

111 | ``L`` | 1 | 1 | 

112 +------------+-----------------------+---------------+ 

113 

114 References 

115 ---------- 

116 :cite:`InternationalTelecommunicationUnion2015i` 

117 

118 Examples 

119 -------- 

120 >>> oetf_inverse_BT709(0.409007728864150) # doctest: +ELLIPSIS 

121 0.1... 

122 """ 

123 

124 return oetf_inverse_BT601(V)