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

1"""

2 PLASA ANSI E1.54 Colourspace

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

4

5 Define the *PLASA ANSI E1.54* colourspace:

6

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

8

9 References

10----------

11- :cite:`Wood2014` : Wood, M. (2014). Making the same color twice - A

12 proposed PLASA standard for color communication. Retrieved August 13, 2023,

13 from https://www.mikewoodconsulting.com/articles/\

14 Protocol%20Fall%202014%20-%20Color%20Communication.pdf

15- :cite:`PLASANorthAmerica2015` : PLASA North America. (2015). ANSI E1.54 -

16 2015 - PLASA Standard for Color Communication in Entertainment Lighting.

17 https://webstore.ansi.org/preview-pages/ESTA/preview_ANSI+E1.54-2015.pdf

18"""

19

20 from __future__ import annotations

21

22 import typing

23

24 import numpy as np

25

26 from colour.colorimetry import CCS_ILLUMINANTS

27

28 if typing.TYPE_CHECKING:

29 from colour.hints import NDArrayFloat

30

31 from colour.models.rgb import (

32 RGB_Colourspace,

33 linear_function,

34 normalised_primary_matrix,

35)

36 from colour.models.rgb.datasets import RGB_COLOURSPACE_RIMM_RGB

37

38 __author__ = "Colour Developers"

39 __copyright__ = "Copyright 2013 Colour Developers"

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

41 __maintainer__ = "Colour Developers"

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

43 __status__ = "Production"

44

45 __all__ = [

46 "PRIMARIES_PLASA_ANSI_E154",

47 "WHITEPOINT_NAME_PLASA_ANSI_E154",

48 "CCS_WHITEPOINT_PLASA_ANSI_E154",

49 "MATRIX_PLASA_ANSI_E154_TO_XYZ",

50 "MATRIX_XYZ_TO_PLASA_ANSI_E154",

51 "RGB_COLOURSPACE_PLASA_ANSI_E154",

52]

53

54 PRIMARIES_PLASA_ANSI_E154: NDArrayFloat = RGB_COLOURSPACE_RIMM_RGB.primaries

55"""*PLASA ANSI E1.54* colourspace primaries."""

56

57 WHITEPOINT_NAME_PLASA_ANSI_E154: str = "PLASA ANSI E1.54"

58"""*PLASA ANSI E1.54* colourspace whitepoint name."""

59

60 CCS_WHITEPOINT_PLASA_ANSI_E154: NDArrayFloat = CCS_ILLUMINANTS[

61 "CIE 1931 2 Degree Standard Observer"

62][WHITEPOINT_NAME_PLASA_ANSI_E154]

63"""*PLASA ANSI E1.54* colourspace whitepoint chromaticity coordinates."""

64

65 MATRIX_PLASA_ANSI_E154_TO_XYZ: NDArrayFloat = normalised_primary_matrix(

66 PRIMARIES_PLASA_ANSI_E154, CCS_WHITEPOINT_PLASA_ANSI_E154

67)

68"""*PLASA ANSI E1.54* colourspace to *CIE XYZ* tristimulus values matrix."""

69

70 MATRIX_XYZ_TO_PLASA_ANSI_E154: NDArrayFloat = np.linalg.inv(

71 MATRIX_PLASA_ANSI_E154_TO_XYZ

72)

73"""*CIE XYZ* tristimulus values to *PLASA ANSI E1.54* colourspace matrix."""

74

75 RGB_COLOURSPACE_PLASA_ANSI_E154: RGB_Colourspace = RGB_Colourspace(

76 "PLASA ANSI E1.54",

77 PRIMARIES_PLASA_ANSI_E154,

78 CCS_WHITEPOINT_PLASA_ANSI_E154,

79 WHITEPOINT_NAME_PLASA_ANSI_E154,

80 MATRIX_PLASA_ANSI_E154_TO_XYZ,

81 MATRIX_XYZ_TO_PLASA_ANSI_E154,

82 linear_function,

83 linear_function,

84)

85 RGB_COLOURSPACE_PLASA_ANSI_E154.__doc__ = """

86*PLASA ANSI E1.54* colourspace.

87

88 Notes

89-----

90 The `[0.4254, 0.4044]` whitepoint chromaticity coordinates are described by

91:cite:`Wood2014` to be that of a "2° Planckian source at 3,200 K". However, we

92 can show that the chromaticity coordinates should be `[0.4234, 0.3990]`::

93

94 sd = colour.sd_blackbody(3200)

95 colour.XYZ_to_xy(

96 colour.sd_to_XYZ(

97 sd, colour.MSDS_CMFS["CIE 1931 2 Degree Standard Observer"]

98 )

99 ).round(4)

100

101 References

102----------

103:cite:`PLASANorthAmerica2015`, :cite:`Wood2014`

104"""