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

1"""

2 Max RGB Colourspace

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

4

5 Define the *Max RGB* colourspace:

6

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

8

9 References

10----------

11- :cite:`HutchColorf` : HutchColor. (n.d.). MaxRGB (4 K).

12 http://www.hutchcolor.com/profiles/MaxRGB.zip

13"""

14

15 from __future__ import annotations

16

17 import typing

18 from functools import partial

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 RGB_Colourspace, gamma_function, normalised_primary_matrix

28

29 __author__ = "Colour Developers"

30 __copyright__ = "Copyright 2013 Colour Developers"

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

32 __maintainer__ = "Colour Developers"

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

34 __status__ = "Production"

35

36 __all__ = [

37 "PRIMARIES_MAX_RGB",

38 "WHITEPOINT_NAME_MAX_RGB",

39 "CCS_WHITEPOINT_MAX_RGB",

40 "MATRIX_MAX_RGB_TO_XYZ",

41 "MATRIX_XYZ_TO_MAX_RGB",

42 "RGB_COLOURSPACE_MAX_RGB",

43]

44

45 PRIMARIES_MAX_RGB: NDArrayFloat = np.array(

46 [

47 [0.73413379, 0.26586621],

48 [0.10039113, 0.89960887],

49 [0.03621495, 0.00000000],

50 ]

51)

52"""*Max RGB* colourspace primaries."""

53

54 WHITEPOINT_NAME_MAX_RGB: str = "D50"

55"""*Max RGB* colourspace whitepoint name."""

56

57 CCS_WHITEPOINT_MAX_RGB: NDArrayFloat = CCS_ILLUMINANTS[

58 "CIE 1931 2 Degree Standard Observer"

59][WHITEPOINT_NAME_MAX_RGB]

60"""*Max RGB* colourspace whitepoint chromaticity coordinates."""

61

62 MATRIX_MAX_RGB_TO_XYZ: NDArrayFloat = normalised_primary_matrix(

63 PRIMARIES_MAX_RGB, CCS_WHITEPOINT_MAX_RGB

64)

65"""*Max RGB* colourspace to *CIE XYZ* tristimulus values matrix."""

66

67 MATRIX_XYZ_TO_MAX_RGB: NDArrayFloat = np.linalg.inv(MATRIX_MAX_RGB_TO_XYZ)

68"""*CIE XYZ* tristimulus values to *Max RGB* colourspace matrix."""

69

70 RGB_COLOURSPACE_MAX_RGB: RGB_Colourspace = RGB_Colourspace(

71 "Max RGB",

72 PRIMARIES_MAX_RGB,

73 CCS_WHITEPOINT_MAX_RGB,

74 WHITEPOINT_NAME_MAX_RGB,

75 MATRIX_MAX_RGB_TO_XYZ,

76 MATRIX_XYZ_TO_MAX_RGB,

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

78 partial(gamma_function, exponent=2.2),

79)

80 RGB_COLOURSPACE_MAX_RGB.__doc__ = """

81*Max RGB* colourspace.

82

83 References

84----------

85:cite:`HutchColorf`

86"""