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

1"""

2 Display P3 Colourspace

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

4

5 Define the *Display P3* colourspace:

6

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

8

9 References

10----------

11- :cite:`AppleInc.2019` : Apple. (2019). Apple Inc. (2019). displayP3.

12 Retrieved December 18, 2019, from https://developer.apple.com/\

13 documentation/coregraphics/cgcolorspace/1408916-displayp3

14"""

15

16 from __future__ import annotations

17

18 import typing

19

20 import numpy as np

21

22 from colour.colorimetry import CCS_ILLUMINANTS

23

24 if typing.TYPE_CHECKING:

25 from colour.hints import NDArrayFloat

26

27 from colour.models.rgb import (

28 RGB_Colourspace,

29 eotf_inverse_sRGB,

30 eotf_sRGB,

31 normalised_primary_matrix,

32)

33 from colour.models.rgb.datasets import RGB_COLOURSPACE_DCI_P3

34

35 __author__ = "Colour Developers"

36 __copyright__ = "Copyright 2013 Colour Developers"

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

38 __maintainer__ = "Colour Developers"

39 __email__ = "colour-science@googlegroups.com"

40 __status__ = "Production"

41

42 __all__ = [

43 "PRIMARIES_DISPLAY_P3",

44 "WHITEPOINT_NAME_DISPLAY_P3",

45 "CCS_WHITEPOINT_DISPLAY_P3",

46 "MATRIX_DISPLAY_P3_TO_XYZ",

47 "MATRIX_XYZ_TO_DISPLAY_P3",

48 "RGB_COLOURSPACE_DISPLAY_P3",

49]

50

51 PRIMARIES_DISPLAY_P3: NDArrayFloat = RGB_COLOURSPACE_DCI_P3.primaries

52"""*Display P3* colourspace primaries."""

53

54 WHITEPOINT_NAME_DISPLAY_P3: str = "D65"

55"""*Display P3* colourspace whitepoint name."""

56

57 CCS_WHITEPOINT_DISPLAY_P3: NDArrayFloat = CCS_ILLUMINANTS[

58 "CIE 1931 2 Degree Standard Observer"

59][WHITEPOINT_NAME_DISPLAY_P3]

60"""*Display P3* colourspace whitepoint chromaticity coordinates."""

61

62 MATRIX_DISPLAY_P3_TO_XYZ: NDArrayFloat = normalised_primary_matrix(

63 PRIMARIES_DISPLAY_P3, CCS_WHITEPOINT_DISPLAY_P3

64)

65"""*Display P3* colourspace to *CIE XYZ* tristimulus values matrix."""

66

67 MATRIX_XYZ_TO_DISPLAY_P3: NDArrayFloat = np.linalg.inv(MATRIX_DISPLAY_P3_TO_XYZ)

68"""*CIE XYZ* tristimulus values to *Display P3* colourspace matrix."""

69

70 RGB_COLOURSPACE_DISPLAY_P3: RGB_Colourspace = RGB_Colourspace(

71 "Display P3",

72 PRIMARIES_DISPLAY_P3,

73 CCS_WHITEPOINT_DISPLAY_P3,

74 WHITEPOINT_NAME_DISPLAY_P3,

75 MATRIX_DISPLAY_P3_TO_XYZ,

76 MATRIX_XYZ_TO_DISPLAY_P3,

77 eotf_inverse_sRGB,

78 eotf_sRGB,

79)

80 RGB_COLOURSPACE_DISPLAY_P3.__doc__ = """

81*Display P3* colourspace.

82

83 References

84----------

85:cite:`AppleInc.2019`

86"""