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

1"""

2 DCI-P3 & DCI-P3+ Colourspaces

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

4

5 Define the *DCI-P3* and *DCI-P3+* colourspaces:

6

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

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

9

10 References

11----------

12- :cite:`Canon2014a` : Canon. (2014). EOS C500 Firmware Update. Retrieved

13 August 27, 2016, from

14 https://www.usa.canon.com/internet/portal/us/home/explore/\

15 product-showcases/cameras-and-lenses/cinema-eos-firmware/c500

16- :cite:`DigitalCinemaInitiatives2007b` : Digital Cinema Initiatives. (2007).

17 Digital Cinema System Specification - Version 1.1.

18 http://www.dcimovies.com/archives/spec_v1_1/\

19 DCI_DCinema_System_Spec_v1_1.pdf

20- :cite:`Hewlett-PackardDevelopmentCompany2009a` : Hewlett-Packard

21 Development Company. (2009). Understanding the HP DreamColor LP2480zx

22 DCI-P3 Emulation Color Space (pp. 1-3).

23 http://www.hp.com/united-states/campaigns/workstations/pdfs/\

24 lp2480zx-dci--p3-emulation.pdf

25"""

26

27 from __future__ import annotations

28

29 import typing

30 from functools import partial

31

32 import numpy as np

33

34 from colour.colorimetry import CCS_ILLUMINANTS

35

36 if typing.TYPE_CHECKING:

37 from colour.hints import NDArrayFloat

38

39 from colour.models.rgb import RGB_Colourspace, gamma_function, normalised_primary_matrix

40

41 __author__ = "Colour Developers"

42 __copyright__ = "Copyright 2013 Colour Developers"

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

44 __maintainer__ = "Colour Developers"

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

46 __status__ = "Production"

47

48 __all__ = [

49 "PRIMARIES_DCI_P3",

50 "PRIMARIES_DCI_P3_P",

51 "WHITEPOINT_NAME_DCI_P3",

52 "CCS_WHITEPOINT_DCI_P3",

53 "MATRIX_DCI_P3_TO_XYZ",

54 "MATRIX_XYZ_TO_DCI_P3",

55 "MATRIX_DCI_P3_P_TO_XYZ",

56 "MATRIX_XYZ_TO_DCI_P3_P",

57 "RGB_COLOURSPACE_DCI_P3",

58 "RGB_COLOURSPACE_DCI_P3_P",

59]

60

61 PRIMARIES_DCI_P3: NDArrayFloat = np.array(

62 [

63 [0.6800, 0.3200],

64 [0.2650, 0.6900],

65 [0.1500, 0.0600],

66 ]

67)

68"""*DCI-P3* colourspace primaries."""

69

70 PRIMARIES_DCI_P3_P: NDArrayFloat = np.array(

71 [

72 [0.7400, 0.2700],

73 [0.2200, 0.7800],

74 [0.0900, -0.0900],

75 ]

76)

77"""*DCI-P3+* colourspace primaries."""

78

79 WHITEPOINT_NAME_DCI_P3: str = "DCI-P3"

80"""

81*DCI-P3* colourspace whitepoint name.

82

83 Warnings

84--------

85 DCI-P3 illuminant has no associated spectral distribution. DCI has no

86 official reference spectral measurement for this whitepoint. The closest

87 matching spectral distribution is Kinoton 75P projector.

88"""

89

90 CCS_WHITEPOINT_DCI_P3: NDArrayFloat = CCS_ILLUMINANTS[

91 "CIE 1931 2 Degree Standard Observer"

92][WHITEPOINT_NAME_DCI_P3]

93"""*DCI-P3* colourspace whitepoint chromaticity coordinates."""

94

95 MATRIX_DCI_P3_TO_XYZ: NDArrayFloat = normalised_primary_matrix(

96 PRIMARIES_DCI_P3, CCS_WHITEPOINT_DCI_P3

97)

98"""*DCI-P3* colourspace to *CIE XYZ* tristimulus values matrix."""

99

100 MATRIX_XYZ_TO_DCI_P3: NDArrayFloat = np.linalg.inv(MATRIX_DCI_P3_TO_XYZ)

101"""*CIE XYZ* tristimulus values to *DCI-P3* colourspace matrix."""

102

103 MATRIX_DCI_P3_P_TO_XYZ: NDArrayFloat = normalised_primary_matrix(

104 PRIMARIES_DCI_P3_P, CCS_WHITEPOINT_DCI_P3

105)

106"""*DCI-P3+* colourspace to *CIE XYZ* tristimulus values matrix."""

107

108 MATRIX_XYZ_TO_DCI_P3_P: NDArrayFloat = np.linalg.inv(MATRIX_DCI_P3_P_TO_XYZ)

109"""*CIE XYZ* tristimulus values to *DCI-P3+* colourspace matrix."""

110

111 RGB_COLOURSPACE_DCI_P3: RGB_Colourspace = RGB_Colourspace(

112 "DCI-P3",

113 PRIMARIES_DCI_P3,

114 CCS_WHITEPOINT_DCI_P3,

115 WHITEPOINT_NAME_DCI_P3,

116 MATRIX_DCI_P3_TO_XYZ,

117 MATRIX_XYZ_TO_DCI_P3,

118 partial(gamma_function, exponent=1 / 2.6),

119 partial(gamma_function, exponent=2.6),

120)

121 RGB_COLOURSPACE_DCI_P3.__doc__ = """

122*DCI-P3* colourspace.

123

124 References

125----------

126:cite:`DigitalCinemaInitiatives2007b`,

127:cite:`Hewlett-PackardDevelopmentCompany2009a`

128"""

129

130 RGB_COLOURSPACE_DCI_P3_P: RGB_Colourspace = RGB_Colourspace(

131 "DCI-P3-P",

132 PRIMARIES_DCI_P3_P,

133 CCS_WHITEPOINT_DCI_P3,

134 WHITEPOINT_NAME_DCI_P3,

135 MATRIX_DCI_P3_P_TO_XYZ,

136 MATRIX_XYZ_TO_DCI_P3_P,

137 partial(gamma_function, exponent=1 / 2.6),

138 partial(gamma_function, exponent=2.6),

139)

140 RGB_COLOURSPACE_DCI_P3_P.__doc__ = """

141*DCI-P3+* colourspace.

142

143 Notes

144-----

145- The actual *DCI-P3+* colourspace name is `DCI-P3-P` to avoid canonical key

146 collisions in the `colour.utilities.CanonicalMapping` class.

147

148 References

149----------

150:cite:`Canon2014a`

151"""