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

1"""

2 P3-D65 Colourspace

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

4

5 Define the *P3-D65* colourspace:

6

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

8"""

9

10 from __future__ import annotations

11

12 import typing

13 from functools import partial

14

15 import numpy as np

16

17 from colour.colorimetry import CCS_ILLUMINANTS

18

19 if typing.TYPE_CHECKING:

20 from colour.hints import NDArrayFloat

21

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

23

24 __author__ = "Colour Developers"

25 __copyright__ = "Copyright 2013 Colour Developers"

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

27 __maintainer__ = "Colour Developers"

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

29 __status__ = "Production"

30

31 __all__ = [

32 "PRIMARIES_P3_D65",

33 "WHITEPOINT_NAME_P3_D65",

34 "CCS_WHITEPOINT_P3_D65",

35 "MATRIX_P3_D65_TO_XYZ",

36 "MATRIX_XYZ_TO_P3_D65",

37 "RGB_COLOURSPACE_P3_D65",

38]

39

40 PRIMARIES_P3_D65: NDArrayFloat = np.array(

41 [

42 [0.6800, 0.3200],

43 [0.2650, 0.6900],

44 [0.1500, 0.0600],

45 ]

46)

47"""*P3-D65* colourspace primaries."""

48

49 WHITEPOINT_NAME_P3_D65: str = "D65"

50"""*P3-D65* colourspace whitepoint name."""

51

52 CCS_WHITEPOINT_P3_D65: NDArrayFloat = CCS_ILLUMINANTS[

53 "CIE 1931 2 Degree Standard Observer"

54][WHITEPOINT_NAME_P3_D65]

55"""*P3-D65* colourspace whitepoint chromaticity coordinates."""

56

57 MATRIX_P3_D65_TO_XYZ: NDArrayFloat = normalised_primary_matrix(

58 PRIMARIES_P3_D65, CCS_WHITEPOINT_P3_D65

59)

60"""*P3-D65* colourspace to *CIE XYZ* tristimulus values matrix."""

61

62 MATRIX_XYZ_TO_P3_D65: NDArrayFloat = np.linalg.inv(MATRIX_P3_D65_TO_XYZ)

63"""*CIE XYZ* tristimulus values to *P3-D65* colourspace matrix."""

64

65 RGB_COLOURSPACE_P3_D65: RGB_Colourspace = RGB_Colourspace(

66 "P3-D65",

67 PRIMARIES_P3_D65,

68 CCS_WHITEPOINT_P3_D65,

69 WHITEPOINT_NAME_P3_D65,

70 MATRIX_P3_D65_TO_XYZ,

71 MATRIX_XYZ_TO_P3_D65,

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

73 partial(gamma_function, exponent=2.6),

74)

75 RGB_COLOURSPACE_P3_D65.__doc__ = """

76*P3-D65* colourspace.

77"""