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

1"""

2 SMPTE C Colourspace

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

4

5 Define the *SMPTE C* colourspace:

6

7- :attr:`RGB_COLOURSPACE_SMPTE_C`.

8

9 References

10----------

11- :cite:`SocietyofMotionPictureandTelevisionEngineers2004a` : Society of

12 Motion Picture and Television Engineers. (2004). RP 145:2004: SMPTE C Color

13 Monitor Colorimetry. In RP 145:2004: Vol. RP 145:200. The Society of Motion

14 Picture and Television Engineers. doi:10.5594/S9781614821649

15"""

16

17 from __future__ import annotations

18

19 import typing

20 from functools import partial

21

22 import numpy as np

23

24 from colour.colorimetry import CCS_ILLUMINANTS

25

26 if typing.TYPE_CHECKING:

27 from colour.hints import NDArrayFloat

28

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

30

31 __author__ = "Colour Developers"

32 __copyright__ = "Copyright 2013 Colour Developers"

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

34 __maintainer__ = "Colour Developers"

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

36 __status__ = "Production"

37

38 __all__ = [

39 "PRIMARIES_SMPTE_C",

40 "WHITEPOINT_NAME_SMPTE_C",

41 "CCS_WHITEPOINT_SMPTE_C",

42 "MATRIX_SMPTE_C_TO_XYZ",

43 "MATRIX_XYZ_TO_SMPTE_C",

44 "RGB_COLOURSPACE_SMPTE_C",

45]

46

47 PRIMARIES_SMPTE_C: NDArrayFloat = np.array(

48 [

49 [0.630, 0.340],

50 [0.310, 0.595],

51 [0.155, 0.070],

52 ]

53)

54"""*SMPTE C* colourspace primaries."""

55

56 WHITEPOINT_NAME_SMPTE_C: str = "D65"

57"""*SMPTE C* colourspace whitepoint name."""

58

59 CCS_WHITEPOINT_SMPTE_C: NDArrayFloat = CCS_ILLUMINANTS[

60 "CIE 1931 2 Degree Standard Observer"

61][WHITEPOINT_NAME_SMPTE_C]

62"""*SMPTE C* colourspace whitepoint chromaticity coordinates."""

63

64 MATRIX_SMPTE_C_TO_XYZ: NDArrayFloat = normalised_primary_matrix(

65 PRIMARIES_SMPTE_C, CCS_WHITEPOINT_SMPTE_C

66)

67"""*SMPTE C* colourspace to *CIE XYZ* tristimulus values matrix."""

68

69 MATRIX_XYZ_TO_SMPTE_C: NDArrayFloat = np.linalg.inv(MATRIX_SMPTE_C_TO_XYZ)

70"""*CIE XYZ* tristimulus values to *SMPTE C* colourspace matrix."""

71

72 RGB_COLOURSPACE_SMPTE_C: RGB_Colourspace = RGB_Colourspace(

73 "SMPTE C",

74 PRIMARIES_SMPTE_C,

75 CCS_WHITEPOINT_SMPTE_C,

76 WHITEPOINT_NAME_SMPTE_C,

77 MATRIX_SMPTE_C_TO_XYZ,

78 MATRIX_XYZ_TO_SMPTE_C,

79 partial(gamma_function, exponent=1 / 2.2),

80 partial(gamma_function, exponent=2.2),

81)

82 RGB_COLOURSPACE_SMPTE_C.__doc__ = """

83*SMPTE C* colourspace.

84

85 References

86----------

87:cite:`SocietyofMotionPictureandTelevisionEngineers2004a`

88"""