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

1"""

2 ColorMatch RGB Colourspace

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

4

5 Define the *ColorMatch RGB* colourspace:

6

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

8

9 References

10----------

11- :cite:`Lindbloom2014a` : Lindbloom, B. (2014). RGB Working Space

12 Information. Retrieved April 11, 2014, from

13 http://www.brucelindbloom.com/WorkingSpaceInfo.html

14"""

15

16 from __future__ import annotations

17

18 import typing

19 from functools import partial

20

21 import numpy as np

22

23 from colour.colorimetry import CCS_ILLUMINANTS

24

25 if typing.TYPE_CHECKING:

26 from colour.hints import NDArrayFloat

27

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

29

30 __author__ = "Colour Developers"

31 __copyright__ = "Copyright 2013 Colour Developers"

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

33 __maintainer__ = "Colour Developers"

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

35 __status__ = "Production"

36

37 __all__ = [

38 "PRIMARIES_COLOR_MATCH_RGB",

39 "WHITEPOINT_NAME_COLOR_MATCH_RGB",

40 "CCS_WHITEPOINT_COLOR_MATCH_RGB",

41 "MATRIX_COLOR_MATCH_RGB_TO_XYZ",

42 "MATRIX_XYZ_TO_COLOR_MATCH_RGB",

43 "RGB_COLOURSPACE_COLOR_MATCH_RGB",

44]

45

46 PRIMARIES_COLOR_MATCH_RGB: NDArrayFloat = np.array(

47 [

48 [0.6300, 0.3400],

49 [0.2950, 0.6050],

50 [0.1500, 0.0750],

51 ]

52)

53"""*ColorMatch RGB* colourspace primaries."""

54

55 WHITEPOINT_NAME_COLOR_MATCH_RGB: str = "D50"

56"""*ColorMatch RGB* colourspace whitepoint name."""

57

58 CCS_WHITEPOINT_COLOR_MATCH_RGB: NDArrayFloat = CCS_ILLUMINANTS[

59 "CIE 1931 2 Degree Standard Observer"

60][WHITEPOINT_NAME_COLOR_MATCH_RGB]

61"""*ColorMatch RGB* colourspace whitepoint chromaticity coordinates."""

62

63 MATRIX_COLOR_MATCH_RGB_TO_XYZ: NDArrayFloat = normalised_primary_matrix(

64 PRIMARIES_COLOR_MATCH_RGB, CCS_WHITEPOINT_COLOR_MATCH_RGB

65)

66"""*ColorMatch RGB* colourspace to *CIE XYZ* tristimulus values matrix."""

67

68 MATRIX_XYZ_TO_COLOR_MATCH_RGB: NDArrayFloat = np.linalg.inv(

69 MATRIX_COLOR_MATCH_RGB_TO_XYZ

70)

71"""*CIE XYZ* tristimulus values to *ColorMatch RGB* colourspace matrix."""

72

73 RGB_COLOURSPACE_COLOR_MATCH_RGB: RGB_Colourspace = RGB_Colourspace(

74 "ColorMatch RGB",

75 PRIMARIES_COLOR_MATCH_RGB,

76 CCS_WHITEPOINT_COLOR_MATCH_RGB,

77 WHITEPOINT_NAME_COLOR_MATCH_RGB,

78 MATRIX_COLOR_MATCH_RGB_TO_XYZ,

79 MATRIX_XYZ_TO_COLOR_MATCH_RGB,

80 partial(gamma_function, exponent=1 / 1.8),

81 partial(gamma_function, exponent=1.8),

82)

83 RGB_COLOURSPACE_COLOR_MATCH_RGB.__doc__ = """

84*ColorMatch RGB* colourspace.

85

86 References

87----------

88:cite:`Lindbloom2014a`

89"""