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

1"""

2 SRGB Colourspace

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

4

5 Define the *sRGB* colourspace:

6

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

8

9 References

10----------

11- :cite:`InternationalElectrotechnicalCommission1999a` : International

12 Electrotechnical Commission. (1999). IEC 61966-2-1:1999 - Multimedia

13 systems and equipment - Colour measurement and management - Part 2-1:

14 Colour management - Default RGB colour space - sRGB (p. 51).

15 https://webstore.iec.ch/publication/6169

16- :cite:`InternationalTelecommunicationUnion2015i` : International

17 Telecommunication Union. (2015). Recommendation ITU-R BT.709-6 - Parameter

18 values for the HDTV standards for production and international programme

19 exchange BT Series Broadcasting service (pp. 1-32).

20 https://www.itu.int/dms_pubrec/itu-r/rec/bt/\

21 R-REC-BT.709-6-201506-I!!PDF-E.pdf

22"""

23

24 from __future__ import annotations

25

26 import typing

27

28 import numpy as np

29

30 from colour.colorimetry import CCS_ILLUMINANTS

31

32 if typing.TYPE_CHECKING:

33 from colour.hints import NDArrayFloat

34

35 from colour.models.rgb import RGB_Colourspace, eotf_inverse_sRGB, eotf_sRGB

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_sRGB",

46 "WHITEPOINT_NAME_sRGB",

47 "CCS_WHITEPOINT_sRGB",

48 "MATRIX_sRGB_TO_XYZ",

49 "MATRIX_XYZ_TO_sRGB",

50 "RGB_COLOURSPACE_sRGB",

51]

52

53 PRIMARIES_sRGB: NDArrayFloat = np.array(

54 [

55 [0.6400, 0.3300],

56 [0.3000, 0.6000],

57 [0.1500, 0.0600],

58 ]

59)

60"""*sRGB* colourspace primaries."""

61

62 WHITEPOINT_NAME_sRGB: str = "D65"

63"""*sRGB* colourspace whitepoint name."""

64

65 CCS_WHITEPOINT_sRGB: NDArrayFloat = CCS_ILLUMINANTS[

66 "CIE 1931 2 Degree Standard Observer"

67][WHITEPOINT_NAME_sRGB]

68"""*sRGB* colourspace whitepoint chromaticity coordinates."""

69

70 MATRIX_sRGB_TO_XYZ: NDArrayFloat = np.array(

71 [

72 [0.4124, 0.3576, 0.1805],

73 [0.2126, 0.7152, 0.0722],

74 [0.0193, 0.1192, 0.9505],

75 ]

76)

77"""*sRGB* colourspace to *CIE XYZ* tristimulus values matrix."""

78

79 MATRIX_XYZ_TO_sRGB: NDArrayFloat = np.array(

80 [

81 [3.2406, -1.5372, -0.4986],

82 [-0.9689, 1.8758, 0.0415],

83 [0.0557, -0.2040, 1.0570],

84 ]

85)

86"""*CIE XYZ* tristimulus values to *sRGB* colourspace matrix."""

87

88 RGB_COLOURSPACE_sRGB: RGB_Colourspace = RGB_Colourspace(

89 "sRGB",

90 PRIMARIES_sRGB,

91 CCS_WHITEPOINT_sRGB,

92 WHITEPOINT_NAME_sRGB,

93 MATRIX_sRGB_TO_XYZ,

94 MATRIX_XYZ_TO_sRGB,

95 eotf_inverse_sRGB,

96 eotf_sRGB,

97)

98 RGB_COLOURSPACE_sRGB.__doc__ = """

99*sRGB* colourspace.

100

101 References

102----------

103:cite:`InternationalElectrotechnicalCommission1999a`,

104:cite:`InternationalTelecommunicationUnion2015i`

105"""