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

1"""

2 Don RGB 4 Colourspace

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

4

5 Define the *Don RGB 4* colourspace:

6

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

8

9 References

10----------

11- :cite:`HutchColorg` : HutchColor. (n.d.). DonRGB4 (4 K).

12 http://www.hutchcolor.com/profiles/DonRGB4.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_DON_RGB_4",

38 "WHITEPOINT_NAME_DON_RGB_4",

39 "CCS_WHITEPOINT_DON_RGB_4",

40 "MATRIX_DON_RGB_4_TO_XYZ",

41 "MATRIX_XYZ_TO_DON_RGB_4",

42 "RGB_COLOURSPACE_DON_RGB_4",

43]

44

45 PRIMARIES_DON_RGB_4: NDArrayFloat = np.array(

46 [

47 [0.696120689655172, 0.299568965517241],

48 [0.214682981090100, 0.765294771968854],

49 [0.129937629937630, 0.035343035343035],

50 ]

51)

52"""*Don RGB 4* colourspace primaries."""

53

54 WHITEPOINT_NAME_DON_RGB_4: str = "D50"

55"""*Don RGB 4* colourspace whitepoint name."""

56

57 CCS_WHITEPOINT_DON_RGB_4: NDArrayFloat = CCS_ILLUMINANTS[

58 "CIE 1931 2 Degree Standard Observer"

59][WHITEPOINT_NAME_DON_RGB_4]

60"""*Don RGB 4* colourspace whitepoint chromaticity coordinates."""

61

62 MATRIX_DON_RGB_4_TO_XYZ: NDArrayFloat = normalised_primary_matrix(

63 PRIMARIES_DON_RGB_4, CCS_WHITEPOINT_DON_RGB_4

64)

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

66

67 MATRIX_XYZ_TO_DON_RGB_4: NDArrayFloat = np.linalg.inv(MATRIX_DON_RGB_4_TO_XYZ)

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

69

70 RGB_COLOURSPACE_DON_RGB_4: RGB_Colourspace = RGB_Colourspace(

71 "Don RGB 4",

72 PRIMARIES_DON_RGB_4,

73 CCS_WHITEPOINT_DON_RGB_4,

74 WHITEPOINT_NAME_DON_RGB_4,

75 MATRIX_DON_RGB_4_TO_XYZ,

76 MATRIX_XYZ_TO_DON_RGB_4,

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

78 partial(gamma_function, exponent=2.2),

79)

80 RGB_COLOURSPACE_DON_RGB_4.__doc__ = """

81*Don RGB 4* colourspace.

82

83 References

84----------

85:cite:`HutchColorg`

86"""