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

1"""

2 RIMM, ROMM and ERIMM Encodings

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

4

5 Define the *RIMM, ROMM and ERIMM* encodings:

6

7- :attr:`colour.models.RGB_COLOURSPACE_ROMM_RGB`.

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

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

10- :attr:`colour.models.RGB_COLOURSPACE_PROPHOTO_RGB`.

11

12 References

13----------

14- :cite:`ANSI2003a` : ANSI. (2003). Specification of ROMM RGB (pp. 1-2).

15 http://www.color.org/ROMMRGB.pdf

16- :cite:`Spaulding2000b` : Spaulding, K. E., Woolfe, G. J., & Giorgianni, E.

17 J. (2000). Reference Input/Output Medium Metric RGB Color Encodings

18 (RIMM/ROMM RGB) (pp. 1-8). http://www.photo-lovers.org/pdf/color/romm.pdf

19"""

20

21 from __future__ import annotations

22

23 import typing

24

25 import numpy as np

26

27 from colour.colorimetry import CCS_ILLUMINANTS

28

29 if typing.TYPE_CHECKING:

30 from colour.hints import NDArrayFloat

31

32 from colour.models.rgb import (

33 RGB_Colourspace,

34 cctf_decoding_RIMMRGB,

35 cctf_decoding_ROMMRGB,

36 cctf_encoding_RIMMRGB,

37 cctf_encoding_ROMMRGB,

38 log_decoding_ERIMMRGB,

39 log_encoding_ERIMMRGB,

40)

41

42 __author__ = "Colour Developers"

43 __copyright__ = "Copyright 2013 Colour Developers"

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

45 __maintainer__ = "Colour Developers"

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

47 __status__ = "Production"

48

49 __all__ = [

50 "PRIMARIES_ROMM_RGB",

51 "WHITEPOINT_NAME_ROMM_RGB",

52 "CCS_WHITEPOINT_ROMM_RGB",

53 "MATRIX_ROMM_RGB_TO_XYZ",

54 "MATRIX_XYZ_TO_ROMM_RGB",

55 "RGB_COLOURSPACE_ROMM_RGB",

56 "PRIMARIES_RIMM_RGB",

57 "WHITEPOINT_NAME_RIMM_RGB",

58 "CCS_WHITEPOINT_RIMM_RGB",

59 "MATRIX_RIMM_RGB_TO_XYZ",

60 "MATRIX_XYZ_TO_RIMM_RGB",

61 "RGB_COLOURSPACE_RIMM_RGB",

62 "PRIMARIES_ERIMM_RGB",

63 "WHITEPOINT_NAME_ERIMM_RGB",

64 "CCS_WHITEPOINT_ERIMM_RGB",

65 "MATRIX_ERIMM_RGB_TO_XYZ",

66 "MATRIX_XYZ_TO_ERIMM_RGB",

67 "RGB_COLOURSPACE_ERIMM_RGB",

68 "PRIMARIES_PROPHOTO_RGB",

69 "WHITEPOINT_NAME_PROPHOTO_RGB",

70 "CCS_WHITEPOINT_PROPHOTO_RGB",

71 "MATRIX_PROPHOTO_RGB_TO_XYZ",

72 "MATRIX_XYZ_TO_PROPHOTO_RGB",

73 "RGB_COLOURSPACE_PROPHOTO_RGB",

74]

75

76 PRIMARIES_ROMM_RGB: NDArrayFloat = np.array(

77 [

78 [0.7347, 0.2653],

79 [0.1596, 0.8404],

80 [0.0366, 0.0001],

81 ]

82)

83"""*ROMM RGB* colourspace primaries."""

84

85 WHITEPOINT_NAME_ROMM_RGB: str = "D50"

86"""*ROMM RGB* colourspace whitepoint name."""

87

88 CCS_WHITEPOINT_ROMM_RGB: NDArrayFloat = CCS_ILLUMINANTS[

89 "CIE 1931 2 Degree Standard Observer"

90][WHITEPOINT_NAME_ROMM_RGB]

91"""*ROMM RGB* colourspace whitepoint chromaticity coordinates."""

92

93 MATRIX_ROMM_RGB_TO_XYZ: NDArrayFloat = np.array(

94 [

95 [0.7977, 0.1352, 0.0313],

96 [0.2880, 0.7119, 0.0001],

97 [0.0000, 0.0000, 0.8249],

98 ]

99)

100"""*ROMM RGB* colourspace to *CIE XYZ* tristimulus values matrix."""

101

102 MATRIX_XYZ_TO_ROMM_RGB: NDArrayFloat = np.array(

103 [

104 [1.3460, -0.2556, -0.0511],

105 [-0.5446, 1.5082, 0.0205],

106 [0.0000, 0.0000, 1.2123],

107 ]

108)

109"""*CIE XYZ* tristimulus values to *ROMM RGB* colourspace matrix."""

110

111 RGB_COLOURSPACE_ROMM_RGB: RGB_Colourspace = RGB_Colourspace(

112 "ROMM RGB",

113 PRIMARIES_ROMM_RGB,

114 CCS_WHITEPOINT_ROMM_RGB,

115 WHITEPOINT_NAME_ROMM_RGB,

116 MATRIX_ROMM_RGB_TO_XYZ,

117 MATRIX_XYZ_TO_ROMM_RGB,

118 cctf_encoding_ROMMRGB,

119 cctf_decoding_ROMMRGB,

120)

121 RGB_COLOURSPACE_ROMM_RGB.__doc__ = """

122*ROMM RGB* colourspace.

123

124 References

125----------

126:cite:`ANSI2003a`, :cite:`Spaulding2000b`

127"""

128

129 PRIMARIES_RIMM_RGB: NDArrayFloat = PRIMARIES_ROMM_RGB

130"""*RIMM RGB* colourspace primaries."""

131

132 WHITEPOINT_NAME_RIMM_RGB: str = WHITEPOINT_NAME_ROMM_RGB

133"""*RIMM RGB* colourspace whitepoint name."""

134

135 CCS_WHITEPOINT_RIMM_RGB: NDArrayFloat = CCS_WHITEPOINT_ROMM_RGB

136"""*RIMM RGB* colourspace whitepoint chromaticity coordinates."""

137

138 MATRIX_RIMM_RGB_TO_XYZ: NDArrayFloat = MATRIX_ROMM_RGB_TO_XYZ

139"""*RIMM RGB* colourspace to *CIE XYZ* tristimulus values matrix."""

140

141 MATRIX_XYZ_TO_RIMM_RGB: NDArrayFloat = MATRIX_XYZ_TO_ROMM_RGB

142"""*CIE XYZ* tristimulus values to *RIMM RGB* colourspace matrix."""

143

144 RGB_COLOURSPACE_RIMM_RGB: RGB_Colourspace = RGB_Colourspace(

145 "RIMM RGB",

146 PRIMARIES_RIMM_RGB,

147 CCS_WHITEPOINT_RIMM_RGB,

148 WHITEPOINT_NAME_RIMM_RGB,

149 MATRIX_RIMM_RGB_TO_XYZ,

150 MATRIX_XYZ_TO_RIMM_RGB,

151 cctf_encoding_RIMMRGB,

152 cctf_decoding_RIMMRGB,

153)

154 RGB_COLOURSPACE_RIMM_RGB.__doc__ = """

155*RIMM RGB* colourspace. In cases in which it is necessary to identify a

156 specific precision level, the notation *RIMM8 RGB*, *RIMM12 RGB* and

157*RIMM16 RGB* is used.

158

159 References

160----------

161:cite:`Spaulding2000b`

162"""

163

164 PRIMARIES_ERIMM_RGB: NDArrayFloat = PRIMARIES_ROMM_RGB

165"""*ERIMM RGB* colourspace primaries."""

166

167 WHITEPOINT_NAME_ERIMM_RGB: str = WHITEPOINT_NAME_ROMM_RGB

168"""*ERIMM RGB* colourspace whitepoint name."""

169

170 CCS_WHITEPOINT_ERIMM_RGB: NDArrayFloat = CCS_WHITEPOINT_ROMM_RGB

171"""*ERIMM RGB* colourspace whitepoint chromaticity coordinates."""

172

173 MATRIX_ERIMM_RGB_TO_XYZ: NDArrayFloat = MATRIX_ROMM_RGB_TO_XYZ

174"""*ERIMM RGB* colourspace to *CIE XYZ* tristimulus values matrix."""

175

176 MATRIX_XYZ_TO_ERIMM_RGB: NDArrayFloat = MATRIX_XYZ_TO_ROMM_RGB

177"""*CIE XYZ* tristimulus values to *ERIMM RGB* colourspace matrix."""

178

179 RGB_COLOURSPACE_ERIMM_RGB: RGB_Colourspace = RGB_Colourspace(

180 "ERIMM RGB",

181 PRIMARIES_ERIMM_RGB,

182 CCS_WHITEPOINT_ERIMM_RGB,

183 WHITEPOINT_NAME_ERIMM_RGB,

184 MATRIX_ERIMM_RGB_TO_XYZ,

185 MATRIX_XYZ_TO_ERIMM_RGB,

186 log_encoding_ERIMMRGB,

187 log_decoding_ERIMMRGB,

188)

189 RGB_COLOURSPACE_ERIMM_RGB.__doc__ = """

190*ERIMM RGB* colourspace.

191

192 References

193----------

194:cite:`Spaulding2000b`

195"""

196

197 PRIMARIES_PROPHOTO_RGB: NDArrayFloat = PRIMARIES_ROMM_RGB

198"""*ProPhoto RGB* colourspace primaries."""

199

200 WHITEPOINT_NAME_PROPHOTO_RGB: str = WHITEPOINT_NAME_ROMM_RGB

201"""*ProPhoto RGB* colourspace whitepoint name."""

202

203 CCS_WHITEPOINT_PROPHOTO_RGB: NDArrayFloat = CCS_WHITEPOINT_ROMM_RGB

204"""*ProPhoto RGB* colourspace whitepoint chromaticity coordinates."""

205

206 MATRIX_PROPHOTO_RGB_TO_XYZ: NDArrayFloat = MATRIX_ROMM_RGB_TO_XYZ

207"""*ProPhoto RGB* colourspace to *CIE XYZ* tristimulus values matrix."""

208

209 MATRIX_XYZ_TO_PROPHOTO_RGB: NDArrayFloat = MATRIX_XYZ_TO_ROMM_RGB

210"""*CIE XYZ* tristimulus values to *ProPhoto RGB* colourspace matrix."""

211

212 RGB_COLOURSPACE_PROPHOTO_RGB: RGB_Colourspace = RGB_Colourspace(

213 "ProPhoto RGB",

214 PRIMARIES_PROPHOTO_RGB,

215 CCS_WHITEPOINT_PROPHOTO_RGB,

216 WHITEPOINT_NAME_PROPHOTO_RGB,

217 MATRIX_PROPHOTO_RGB_TO_XYZ,

218 MATRIX_XYZ_TO_PROPHOTO_RGB,

219 # NOTE: The "colour.models.cctf_encoding_ProPhotoRGB" and

220 # "colour.models.cctf_decoding_ProPhotoRGB" definitions cannot be pickled

221 # properly within that class.

222 cctf_encoding_ROMMRGB,

223 cctf_decoding_ROMMRGB,

224)

225 RGB_COLOURSPACE_PROPHOTO_RGB.__doc__ = """

226*ProPhoto RGB* colourspace, an alias colourspace for *ROMM RGB*.

227

228 References

229----------

230:cite:`ANSI2003a`, :cite:`Spaulding2000b`

231"""