Coverage for models/rgb/datasets/plasa_ansi_e154.py: 0%
25 statements
« prev ^ index » next coverage.py v7.11.0, created at 2025-11-16 22:49 +1300
« prev ^ index » next coverage.py v7.11.0, created at 2025-11-16 22:49 +1300
1"""
2PLASA ANSI E1.54 Colourspace
3============================
5Define the *PLASA ANSI E1.54* colourspace:
7- :attr:`colour.models.RGB_COLOURSPACE_PLASA_ANSI_E154`.
9References
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/\
14Protocol%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"""
20from __future__ import annotations
22import typing
24import numpy as np
26from colour.colorimetry import CCS_ILLUMINANTS
28if typing.TYPE_CHECKING:
29 from colour.hints import NDArrayFloat
31from colour.models.rgb import (
32 RGB_Colourspace,
33 linear_function,
34 normalised_primary_matrix,
35)
36from colour.models.rgb.datasets import RGB_COLOURSPACE_RIMM_RGB
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"
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]
54PRIMARIES_PLASA_ANSI_E154: NDArrayFloat = RGB_COLOURSPACE_RIMM_RGB.primaries
55"""*PLASA ANSI E1.54* colourspace primaries."""
57WHITEPOINT_NAME_PLASA_ANSI_E154: str = "PLASA ANSI E1.54"
58"""*PLASA ANSI E1.54* colourspace whitepoint name."""
60CCS_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."""
65MATRIX_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."""
70MATRIX_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."""
75RGB_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)
85RGB_COLOURSPACE_PLASA_ANSI_E154.__doc__ = """
86*PLASA ANSI E1.54* colourspace.
88Notes
89-----
90The `[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
92can show that the chromaticity coordinates should be `[0.4234, 0.3990]`::
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)
101References
102----------
103:cite:`PLASANorthAmerica2015`, :cite:`Wood2014`
104"""