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

1"""

2 FilmLight Colourspaces

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

4

5 Define the *FilmLight* colourspaces:

6

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

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

9

10 References

11----------

12- :cite:`Siragusano2018a` : Siragusano, D. (2018). Private Discussion with

13 Shaw, Nick.

14- :cite:`Siragusano2025` : Siragusano, D. (2025). Private discussion on

15 colour-science Discord server. https://discord.com/channels/\

16 1269935627386884106/1269935628808622102/1325770472058523668

17"""

18

19 from __future__ import annotations

20

21 import typing

22

23 import numpy as np

24

25 from colour.colorimetry import CCS_ILLUMINANTS

26

27 if typing.TYPE_CHECKING:

28 from colour.hints import NDArrayFloat

29

30 from colour.models.rgb import (

31 RGB_Colourspace,

32 log_decoding_FilmLightTLog,

33 log_encoding_FilmLightTLog,

34 normalised_primary_matrix,

35)

36

37 __author__ = "Colour Developers"

38 __copyright__ = "Copyright 2013 Colour Developers"

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

40 __maintainer__ = "Colour Developers"

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

42 __status__ = "Production"

43

44 __all__ = [

45 "PRIMARIES_FILMLIGHT_E_GAMUT",

46 "WHITEPOINT_NAME_FILMLIGHT_E_GAMUT",

47 "CCS_WHITEPOINT_FILMLIGHT_E_GAMUT",

48 "MATRIX_FILMLIGHT_E_GAMUT_TO_XYZ",

49 "MATRIX_XYZ_TO_FILMLIGHT_E_GAMUT",

50 "RGB_COLOURSPACE_FILMLIGHT_E_GAMUT",

51 "PRIMARIES_FILMLIGHT_E_GAMUT_2",

52 "MATRIX_FILMLIGHT_E_GAMUT_2_TO_XYZ",

53 "MATRIX_XYZ_TO_FILMLIGHT_E_GAMUT_2",

54 "RGB_COLOURSPACE_FILMLIGHT_E_GAMUT_2",

55]

56

57 PRIMARIES_FILMLIGHT_E_GAMUT: NDArrayFloat = np.array(

58 [

59 [0.8000, 0.3177],

60 [0.1800, 0.9000],

61 [0.0650, -0.0805],

62 ]

63)

64"""*FilmLight E-Gamut* colourspace primaries."""

65

66 WHITEPOINT_NAME_FILMLIGHT_E_GAMUT: str = "D65"

67"""*FilmLight E-Gamut* colourspace whitepoint name."""

68

69 CCS_WHITEPOINT_FILMLIGHT_E_GAMUT: NDArrayFloat = CCS_ILLUMINANTS[

70 "CIE 1931 2 Degree Standard Observer"

71][WHITEPOINT_NAME_FILMLIGHT_E_GAMUT]

72"""*FilmLight E-Gamut* colourspace whitepoint chromaticity coordinates."""

73

74 MATRIX_FILMLIGHT_E_GAMUT_TO_XYZ: NDArrayFloat = normalised_primary_matrix(

75 PRIMARIES_FILMLIGHT_E_GAMUT, CCS_WHITEPOINT_FILMLIGHT_E_GAMUT

76)

77"""*FilmLight E-Gamut* colourspace to *CIE XYZ* tristimulus values matrix."""

78

79 MATRIX_XYZ_TO_FILMLIGHT_E_GAMUT: NDArrayFloat = np.linalg.inv(

80 MATRIX_FILMLIGHT_E_GAMUT_TO_XYZ

81)

82"""*CIE XYZ* tristimulus values to *FilmLight E-Gamut* colourspace matrix."""

83

84 RGB_COLOURSPACE_FILMLIGHT_E_GAMUT: RGB_Colourspace = RGB_Colourspace(

85 "FilmLight E-Gamut",

86 PRIMARIES_FILMLIGHT_E_GAMUT,

87 CCS_WHITEPOINT_FILMLIGHT_E_GAMUT,

88 WHITEPOINT_NAME_FILMLIGHT_E_GAMUT,

89 MATRIX_FILMLIGHT_E_GAMUT_TO_XYZ,

90 MATRIX_XYZ_TO_FILMLIGHT_E_GAMUT,

91 log_encoding_FilmLightTLog,

92 log_decoding_FilmLightTLog,

93)

94 RGB_COLOURSPACE_FILMLIGHT_E_GAMUT.__doc__ = """

95*FilmLight E-Gamut* colourspace.

96

97 References

98----------

99:cite:`Siragusano2018a`

100"""

101

102 PRIMARIES_FILMLIGHT_E_GAMUT_2: NDArrayFloat = np.array(

103 [

104 [0.8300, 0.3100],

105 [0.1500, 0.9500],

106 [0.0650, -0.0805],

107 ]

108)

109"""*FilmLight E-Gamut 2* colourspace primaries."""

110

111 MATRIX_FILMLIGHT_E_GAMUT_2_TO_XYZ: NDArrayFloat = np.array(

112 [

113 [0.736478, 0.130740, 0.083239],

114 [0.275070, 0.828018, -0.103088],

115 [-0.124225, -0.087160, 1.300443],

116 ]

117)

118"""*FilmLight E-Gamut 2* colourspace to *CIE XYZ* tristimulus values matrix."""

119

120 MATRIX_XYZ_TO_FILMLIGHT_E_GAMUT_2: NDArrayFloat = np.linalg.inv(

121 MATRIX_FILMLIGHT_E_GAMUT_2_TO_XYZ

122)

123"""*CIE XYZ* tristimulus values to *FilmLight E-Gamut 2* colourspace matrix."""

124

125 RGB_COLOURSPACE_FILMLIGHT_E_GAMUT_2: RGB_Colourspace = RGB_Colourspace(

126 "FilmLight E-Gamut 2",

127 PRIMARIES_FILMLIGHT_E_GAMUT_2,

128 CCS_WHITEPOINT_FILMLIGHT_E_GAMUT,

129 WHITEPOINT_NAME_FILMLIGHT_E_GAMUT,

130 MATRIX_FILMLIGHT_E_GAMUT_2_TO_XYZ,

131 MATRIX_XYZ_TO_FILMLIGHT_E_GAMUT_2,

132 log_encoding_FilmLightTLog,

133 log_decoding_FilmLightTLog,

134)

135 RGB_COLOURSPACE_FILMLIGHT_E_GAMUT_2.__doc__ = """

136*FilmLight E-Gamut 2* colourspace.

137

138 References

139----------

140:cite:`Siragusano2025`

141"""