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

1"""

2 ARRI Colourspaces

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

4

5 Define the *ARRI* colourspaces:

6

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

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

9

10 References

11----------

12- :cite:`ARRI2012a` : ARRI. (2012). ALEXA - Log C Curve - Usage in VFX.

13 https://drive.google.com/open?id=1t73fAG_QpV7hJxoQPYZDWvOojYkYDgvn

14- :cite:`Cooper2022` : Cooper, S., & Brendel, H. (2022). ARRI LogC4

15 Logarithmic Color Space SPECIFICATION. Retrieved October 24, 2022, from

16 https://www.arri.com/resource/blob/278790/bea879ac0d041a925bed27a096ab3ec2/\

17 2022-05-arri-logc4-specification-data.pdf

18"""

19

20 from __future__ import annotations

21

22 import typing

23

24 import numpy as np

25

26 from colour.colorimetry import CCS_ILLUMINANTS

27

28 if typing.TYPE_CHECKING:

29 from colour.hints import NDArrayFloat

30

31 from colour.models.rgb import (

32 RGB_Colourspace,

33 log_decoding_ARRILogC3,

34 log_decoding_ARRILogC4,

35 log_encoding_ARRILogC3,

36 log_encoding_ARRILogC4,

37)

38

39 __author__ = "Colour Developers"

40 __copyright__ = "Copyright 2013 Colour Developers"

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

42 __maintainer__ = "Colour Developers"

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

44 __status__ = "Production"

45

46 __all__ = [

47 "PRIMARIES_ARRI_WIDE_GAMUT_3",

48 "WHITEPOINT_NAME_ARRI_WIDE_GAMUT_3",

49 "CCS_WHITEPOINT_ARRI_WIDE_GAMUT_3",

50 "MATRIX_ARRI_WIDE_GAMUT_3_TO_XYZ",

51 "MATRIX_XYZ_TO_ARRI_WIDE_GAMUT_3",

52 "RGB_COLOURSPACE_ARRI_WIDE_GAMUT_3",

53 "PRIMARIES_ARRI_WIDE_GAMUT_4",

54 "WHITEPOINT_NAME_ARRI_WIDE_GAMUT_4",

55 "CCS_WHITEPOINT_ARRI_WIDE_GAMUT_4",

56 "MATRIX_ARRI_WIDE_GAMUT_4_TO_XYZ",

57 "MATRIX_XYZ_TO_ARRI_WIDE_GAMUT_4",

58 "RGB_COLOURSPACE_ARRI_WIDE_GAMUT_4",

59]

60

61 PRIMARIES_ARRI_WIDE_GAMUT_3: NDArrayFloat = np.array(

62 [

63 [0.6840, 0.3130],

64 [0.2210, 0.8480],

65 [0.0861, -0.1020],

66 ]

67)

68"""*ARRI Wide Gamut 3* colourspace primaries."""

69

70 WHITEPOINT_NAME_ARRI_WIDE_GAMUT_3: str = "D65"

71"""*ARRI Wide Gamut 3* colourspace whitepoint name."""

72

73 CCS_WHITEPOINT_ARRI_WIDE_GAMUT_3: NDArrayFloat = CCS_ILLUMINANTS[

74 "CIE 1931 2 Degree Standard Observer"

75][WHITEPOINT_NAME_ARRI_WIDE_GAMUT_3]

76"""*ARRI Wide Gamut 3* colourspace whitepoint chromaticity coordinates."""

77

78 MATRIX_ARRI_WIDE_GAMUT_3_TO_XYZ: NDArrayFloat = np.array(

79 [

80 [0.638008, 0.214704, 0.097744],

81 [0.291954, 0.823841, -0.115795],

82 [0.002798, -0.067034, 1.153294],

83 ]

84)

85"""*ARRI Wide Gamut 3* colourspace to *CIE XYZ* tristimulus values matrix."""

86

87 MATRIX_XYZ_TO_ARRI_WIDE_GAMUT_3: NDArrayFloat = np.array(

88 [

89 [1.789066, -0.482534, -0.200076],

90 [-0.639849, 1.396400, 0.194432],

91 [-0.041532, 0.082335, 0.878868],

92 ]

93)

94"""*CIE XYZ* tristimulus values to *ARRI Wide Gamut 3* colourspace matrix."""

95

96 RGB_COLOURSPACE_ARRI_WIDE_GAMUT_3: RGB_Colourspace = RGB_Colourspace(

97 "ARRI Wide Gamut 3",

98 PRIMARIES_ARRI_WIDE_GAMUT_3,

99 CCS_WHITEPOINT_ARRI_WIDE_GAMUT_3,

100 WHITEPOINT_NAME_ARRI_WIDE_GAMUT_3,

101 MATRIX_ARRI_WIDE_GAMUT_3_TO_XYZ,

102 MATRIX_XYZ_TO_ARRI_WIDE_GAMUT_3,

103 log_encoding_ARRILogC3,

104 log_decoding_ARRILogC3,

105)

106 RGB_COLOURSPACE_ARRI_WIDE_GAMUT_3.__doc__ = """

107*ARRI Wide Gamut 3* colourspace.

108

109 References

110----------

111:cite:`ARRI2012a`

112"""

113

114 PRIMARIES_ARRI_WIDE_GAMUT_4: NDArrayFloat = np.array(

115 [

116 [0.7347, 0.2653],

117 [0.1424, 0.8576],

118 [0.0991, -0.0308],

119 ]

120)

121"""*ARRI Wide Gamut 4* colourspace primaries."""

122

123 WHITEPOINT_NAME_ARRI_WIDE_GAMUT_4: str = "D65"

124"""*ARRI Wide Gamut 4* colourspace whitepoint name."""

125

126 CCS_WHITEPOINT_ARRI_WIDE_GAMUT_4: NDArrayFloat = CCS_ILLUMINANTS[

127 "CIE 1931 2 Degree Standard Observer"

128][WHITEPOINT_NAME_ARRI_WIDE_GAMUT_4]

129"""*ARRI Wide Gamut 4* colourspace whitepoint chromaticity coordinates."""

130

131 MATRIX_ARRI_WIDE_GAMUT_4_TO_XYZ: NDArrayFloat = np.array(

132 [

133 [0.704858320407232064, 0.129760295170463003, 0.115837311473976537],

134 [0.254524176404027025, 0.781477732712002049, -0.036001909116029039],

135 [0.000000000000000000, 0.000000000000000000, 1.089057750759878429],

136 ]

137)

138"""*ARRI Wide Gamut 4* colourspace to *CIE XYZ* tristimulus values matrix."""

139

140 MATRIX_XYZ_TO_ARRI_WIDE_GAMUT_4: NDArrayFloat = np.linalg.inv(

141 MATRIX_ARRI_WIDE_GAMUT_4_TO_XYZ

142)

143"""*CIE XYZ* tristimulus values to *ARRI Wide Gamut 4* colourspace matrix."""

144

145 RGB_COLOURSPACE_ARRI_WIDE_GAMUT_4: RGB_Colourspace = RGB_Colourspace(

146 "ARRI Wide Gamut 4",

147 PRIMARIES_ARRI_WIDE_GAMUT_4,

148 CCS_WHITEPOINT_ARRI_WIDE_GAMUT_4,

149 WHITEPOINT_NAME_ARRI_WIDE_GAMUT_4,

150 MATRIX_ARRI_WIDE_GAMUT_4_TO_XYZ,

151 MATRIX_XYZ_TO_ARRI_WIDE_GAMUT_4,

152 log_encoding_ARRILogC4,

153 log_decoding_ARRILogC4,

154)

155 RGB_COLOURSPACE_ARRI_WIDE_GAMUT_4.__doc__ = """

156*ARRI Wide Gamut 4* colourspace.

157

158 References

159----------

160:cite:`Cooper2022`

161"""