Coverage for models/rgb/datasets/itut_h_273.py: 0%

1"""

2 Recommendation ITU-T H.273 Colour Primaries (and Colourspaces)

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

4

5 Define the *Recommendation ITU-T H.273* colourspaces that do not belong in

6 another specification or standard, or have been modified for inclusion:

7

8- :attr:`colour.models.RGB_COLOURSPACE_H273_GENERIC_FILM`.

9- :attr:`colour.models.RGB_COLOURSPACE_H273_22_UNSPECIFIED`.

10

11 References

12----------

13- :cite:`InternationalTelecommunicationUnion2021` : International

14 Telecommunication Union. (2021). Recommendation ITU-T H.273 -

15 Coding-independent code points for video signal type identification.

16 https://www.itu.int/rec/T-REC-H.273-202107-I/en

17"""

18

19 from __future__ import annotations

20

21 import typing

22

23 import numpy as np

24

25 if typing.TYPE_CHECKING:

26 from colour.hints import NDArrayFloat

27

28 from colour.models.rgb import (

29 RGB_Colourspace,

30 linear_function,

31 normalised_primary_matrix,

32)

33

34 __author__ = "Colour Developers"

35 __copyright__ = "Copyright 2013 Colour Developers"

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

37 __maintainer__ = "Colour Developers"

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

39 __status__ = "Production"

40

41 __all__ = [

42 "PRIMARIES_H273_GENERIC_FILM",

43 "WHITEPOINT_NAME_H273_GENERIC_FILM",

44 "CCS_WHITEPOINT_H273_GENERIC_FILM",

45 "MATRIX_H273_GENERIC_FILM_RGB_TO_XYZ",

46 "MATRIX_XYZ_TO_H273_GENERIC_FILM_RGB",

47 "RGB_COLOURSPACE_H273_GENERIC_FILM",

48 "PRIMARIES_H273_22_UNSPECIFIED",

49 "WHITEPOINT_NAME_H273_22_UNSPECIFIED",

50 "CCS_WHITEPOINT_H273_22_UNSPECIFIED",

51 "MATRIX_H273_22_UNSPECIFIED_RGB_TO_XYZ",

52 "MATRIX_XYZ_TO_H273_22_UNSPECIFIED_RGB",

53 "RGB_COLOURSPACE_H273_22_UNSPECIFIED",

54]

55

56 PRIMARIES_H273_GENERIC_FILM: NDArrayFloat = np.array(

57 [

58 [0.681, 0.319], # Wratten 25

59 [0.243, 0.692], # Wratten 58

60 [0.145, 0.049], # Wratten 47

61 ]

62)

63"""

64 Colourspace primaries for *Generic Film* (colour filters using Illuminant C).

65

66 References

67----------

68- :cite:`InternationalTelecommunicationUnion2021`

69"""

70

71 WHITEPOINT_NAME_H273_GENERIC_FILM: str = "C"

72"""

73 Whitepoint name for *Generic Film* (colour filters using Illuminant C).

74

75 References

76----------

77- :cite:`InternationalTelecommunicationUnion2021`

78"""

79

80 CCS_WHITEPOINT_H273_GENERIC_FILM: NDArrayFloat = np.array([0.310, 0.316])

81"""

82 Whitepoint chromaticity coordinates for *Generic Film* (colour filters using

83 Illuminant C).

84

85 Notes

86-----

87

88- *Recommendation ITU-T H.273* defines whitepoint *C* as [0.310, 0.316],

89 while *Colour* has a slightly higher precision.

90

91 References

92----------

93- :cite:`InternationalTelecommunicationUnion2021`

94"""

95

96 MATRIX_H273_GENERIC_FILM_RGB_TO_XYZ: NDArrayFloat = normalised_primary_matrix(

97 PRIMARIES_H273_GENERIC_FILM, CCS_WHITEPOINT_H273_GENERIC_FILM

98)

99"""

100*Generic Film* (colour filters using Illuminant C) colourspace to *CIE XYZ*

101 tristimulus values matrix.

102

103 References

104----------

105- :cite:`InternationalTelecommunicationUnion2021`

106"""

107

108 MATRIX_XYZ_TO_H273_GENERIC_FILM_RGB: NDArrayFloat = np.linalg.inv(

109 MATRIX_H273_GENERIC_FILM_RGB_TO_XYZ

110)

111"""

112*CIE XYZ* tristimulus values to *Generic Film* (colour filters using

113 Illuminant C) colourspace matrix.

114

115 References

116----------

117- :cite:`InternationalTelecommunicationUnion2021`

118"""

119

120 RGB_COLOURSPACE_H273_GENERIC_FILM: RGB_Colourspace = RGB_Colourspace(

121 "ITU-T H.273 - Generic Film",

122 PRIMARIES_H273_GENERIC_FILM,

123 CCS_WHITEPOINT_H273_GENERIC_FILM,

124 WHITEPOINT_NAME_H273_GENERIC_FILM,

125 MATRIX_H273_GENERIC_FILM_RGB_TO_XYZ,

126 MATRIX_XYZ_TO_H273_GENERIC_FILM_RGB,

127 linear_function,

128 linear_function,

129)

130 RGB_COLOURSPACE_H273_GENERIC_FILM.__doc__ = """

131*Recommendation ITU-T H.273* *Generic Film* (colour filters using Illuminant C)

132 colourspace.

133

134 References

135----------

136:cite:`InternationalTelecommunicationUnion2021`

137"""

138

139

140 PRIMARIES_H273_22_UNSPECIFIED: NDArrayFloat = np.array(

141 [

142 [0.630, 0.340],

143 [0.295, 0.605],

144 [0.155, 0.077],

145 ]

146)

147"""

148 Colourspace primaries for row *22* as specified in

149*Table 2 - Interpretation of colour primaries (ColourPrimaries) value*.

150

151 References

152----------

153- :cite:`InternationalTelecommunicationUnion2021`

154"""

155

156 WHITEPOINT_NAME_H273_22_UNSPECIFIED: str = "D65"

157"""

158 Whitepoint name for row *22* as specified in

159*Table 2 - Interpretation of colour primaries (ColourPrimaries) value*.

160

161 References

162----------

163- :cite:`InternationalTelecommunicationUnion2021`

164"""

165

166 CCS_WHITEPOINT_H273_22_UNSPECIFIED: NDArrayFloat = np.array([0.3127, 0.3290])

167"""

168 Whitepoint chromaticity coordinates for row *22* as specified in

169*Table 2 - Interpretation of colour primaries (ColourPrimaries) value*.

170

171 References

172----------

173- :cite:`InternationalTelecommunicationUnion2021`

174"""

175

176 MATRIX_H273_22_UNSPECIFIED_RGB_TO_XYZ: NDArrayFloat = normalised_primary_matrix(

177 PRIMARIES_H273_22_UNSPECIFIED, CCS_WHITEPOINT_H273_22_UNSPECIFIED

178)

179"""

180 Row *22* colourspace as specified in

181*Table 2 - Interpretation of colour primaries (ColourPrimaries) value* to

182*CIE XYZ* tristimulus values matrix.

183

184 References

185----------

186- :cite:`InternationalTelecommunicationUnion2021`

187"""

188

189 MATRIX_XYZ_TO_H273_22_UNSPECIFIED_RGB: NDArrayFloat = np.linalg.inv(

190 MATRIX_H273_22_UNSPECIFIED_RGB_TO_XYZ

191)

192"""

193*CIE XYZ* tristimulus values to row *22* colourspace as specified in

194*Table 2 - Interpretation of colour primaries (ColourPrimaries) value* matrix.

195

196 References

197----------

198- :cite:`InternationalTelecommunicationUnion2021`

199"""

200

201 RGB_COLOURSPACE_H273_22_UNSPECIFIED: RGB_Colourspace = RGB_Colourspace(

202 "ITU-T H.273 - 22 Unspecified",

203 PRIMARIES_H273_22_UNSPECIFIED,

204 CCS_WHITEPOINT_H273_22_UNSPECIFIED,

205 WHITEPOINT_NAME_H273_22_UNSPECIFIED,

206 MATRIX_H273_22_UNSPECIFIED_RGB_TO_XYZ,

207 MATRIX_XYZ_TO_H273_22_UNSPECIFIED_RGB,

208 linear_function,

209 linear_function,

210)

211 RGB_COLOURSPACE_H273_22_UNSPECIFIED.__doc__ = """

212*Recommendation ITU-T H.273* row *22* colourspace as specified in

213*Table 2 - Interpretation of colour primaries (ColourPrimaries) value*.

214

215 References

216----------

217:cite:`InternationalTelecommunicationUnion2021`

218"""