Skip to content

Commit

Permalink
Rename "colour.models.RGB_COLOURSPACE_ALEXA_WIDE_GAMUT" attribute to …
Browse files Browse the repository at this point in the history
…"RGB_COLOURSPACE_ARRI_WIDE_GAMUT_3".
  • Loading branch information
KelSolaar committed Nov 7, 2022
1 parent aa28736 commit 964b51a
Show file tree
Hide file tree
Showing 10 changed files with 128 additions and 107 deletions.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1010,7 +1010,7 @@ RGB Colourspaces
'ACEScct',
'ACEScg',
'ACESproxy',
'ALEXA Wide Gamut',
'ARRI Wide Gamut 3',
'Adobe RGB (1998)',
'Adobe Wide Gamut RGB',
'Apple RGB',
Expand Down
8 changes: 6 additions & 2 deletions colour/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@
RGB_COLOURSPACE_ACESCG,
RGB_COLOURSPACE_ADOBE_RGB1998,
RGB_COLOURSPACE_ADOBE_WIDE_GAMUT_RGB,
RGB_COLOURSPACE_ALEXA_WIDE_GAMUT,
RGB_COLOURSPACE_ARRI_WIDE_GAMUT_3,
RGB_COLOURSPACE_APPLE_RGB,
RGB_COLOURSPACE_BEST_RGB,
RGB_COLOURSPACE_BETA_RGB,
Expand Down Expand Up @@ -668,7 +668,7 @@
"RGB_COLOURSPACE_ACESCG",
"RGB_COLOURSPACE_ADOBE_RGB1998",
"RGB_COLOURSPACE_ADOBE_WIDE_GAMUT_RGB",
"RGB_COLOURSPACE_ALEXA_WIDE_GAMUT",
"RGB_COLOURSPACE_ARRI_WIDE_GAMUT_3",
"RGB_COLOURSPACE_APPLE_RGB",
"RGB_COLOURSPACE_BEST_RGB",
"RGB_COLOURSPACE_BETA_RGB",
Expand Down Expand Up @@ -804,6 +804,10 @@ def __getattr__(self, attribute) -> Any:
# v0.4.2
API_CHANGES["ObjectRenamed"].extend(
[
[
"colour.models.RGB_COLOURSPACE_ALEXA_WIDE_GAMUT",
"colour.models.RGB_COLOURSPACE_ARRI_WIDE_GAMUT_3",
],
[
"colour.models.eotf_inverse_BT2020",
"colour.models.oetf_BT2020",
Expand Down
4 changes: 2 additions & 2 deletions colour/models/rgb/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@
RGB_COLOURSPACE_ACESCG,
RGB_COLOURSPACE_ADOBE_RGB1998,
RGB_COLOURSPACE_ADOBE_WIDE_GAMUT_RGB,
RGB_COLOURSPACE_ALEXA_WIDE_GAMUT,
RGB_COLOURSPACE_ARRI_WIDE_GAMUT_3,
RGB_COLOURSPACE_APPLE_RGB,
RGB_COLOURSPACE_BEST_RGB,
RGB_COLOURSPACE_BETA_RGB,
Expand Down Expand Up @@ -430,7 +430,7 @@
"RGB_COLOURSPACE_ACESCG",
"RGB_COLOURSPACE_ADOBE_RGB1998",
"RGB_COLOURSPACE_ADOBE_WIDE_GAMUT_RGB",
"RGB_COLOURSPACE_ALEXA_WIDE_GAMUT",
"RGB_COLOURSPACE_ARRI_WIDE_GAMUT_3",
"RGB_COLOURSPACE_APPLE_RGB",
"RGB_COLOURSPACE_BEST_RGB",
"RGB_COLOURSPACE_BETA_RGB",
Expand Down
25 changes: 21 additions & 4 deletions colour/models/rgb/datasets/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import annotations

from colour.utilities import CanonicalMapping
from colour.utilities import LazyCanonicalMapping, usage_warning
from .aces import (
RGB_COLOURSPACE_ACES2065_1,
RGB_COLOURSPACE_ACESCC,
Expand All @@ -11,7 +11,7 @@
from .adobe_rgb_1998 import RGB_COLOURSPACE_ADOBE_RGB1998
from .adobe_wide_gamut_rgb import RGB_COLOURSPACE_ADOBE_WIDE_GAMUT_RGB
from .apple_rgb import RGB_COLOURSPACE_APPLE_RGB
from .arri_alexa_wide_gamut import RGB_COLOURSPACE_ALEXA_WIDE_GAMUT
from .arri import RGB_COLOURSPACE_ARRI_WIDE_GAMUT_3
from .best_rgb import RGB_COLOURSPACE_BEST_RGB
from .beta_rgb import RGB_COLOURSPACE_BETA_RGB
from .blackmagic_design import RGB_COLOURSPACE_BLACKMAGIC_WIDE_GAMUT
Expand Down Expand Up @@ -74,7 +74,7 @@

from colour.models.rgb import RGB_Colourspace

RGB_COLOURSPACES: CanonicalMapping = CanonicalMapping(
RGB_COLOURSPACES: LazyCanonicalMapping = LazyCanonicalMapping(
dict(
sorted(
(colourspace.name, colourspace)
Expand Down Expand Up @@ -112,7 +112,7 @@
"RGB_COLOURSPACE_ACESCG",
"RGB_COLOURSPACE_ADOBE_RGB1998",
"RGB_COLOURSPACE_ADOBE_WIDE_GAMUT_RGB",
"RGB_COLOURSPACE_ALEXA_WIDE_GAMUT",
"RGB_COLOURSPACE_ARRI_WIDE_GAMUT_3",
"RGB_COLOURSPACE_APPLE_RGB",
"RGB_COLOURSPACE_BEST_RGB",
"RGB_COLOURSPACE_BETA_RGB",
Expand Down Expand Up @@ -169,3 +169,20 @@
"RGB_COLOURSPACE_XTREME_RGB",
"RGB_COLOURSPACE_F_GAMUT",
]


# ----------------------------------------------------------------------------#
# --- API Changes and Deprecation Management ---#
# ----------------------------------------------------------------------------#
# v0.4.2
def _alexa_wide_gamut():
usage_warning(
'The "ALEXA Wide Gamut" RGB colourspace has been renamed to '
'"ARRI Wide Gamut 3" for consistency with "ARRI" new naming '
"convention."
)

return RGB_COLOURSPACE_ARRI_WIDE_GAMUT_3


RGB_COLOURSPACES["ALEXA Wide Gamut"] = _alexa_wide_gamut
94 changes: 94 additions & 0 deletions colour/models/rgb/datasets/arri.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
"""
ARRI Colourspaces
=================
Defines the *ARRI* colourspaces:
- :attr:`colour.models.RGB_COLOURSPACE_ARRI_WIDE_GAMUT_3`.
References
----------
- :cite:`ARRI2012a` : ARRI. (2012). ALEXA - Log C Curve - Usage in VFX.
https://drive.google.com/open?id=1t73fAG_QpV7hJxoQPYZDWvOojYkYDgvn
"""

from __future__ import annotations

import numpy as np

from colour.colorimetry import CCS_ILLUMINANTS
from colour.hints import NDArray
from colour.models.rgb import (
RGB_Colourspace,
log_encoding_ALEXALogC,
log_decoding_ALEXALogC,
)

__author__ = "Colour Developers"
__copyright__ = "Copyright 2013 Colour Developers"
__license__ = "New BSD License - https://opensource.org/licenses/BSD-3-Clause"
__maintainer__ = "Colour Developers"
__email__ = "[email protected]"
__status__ = "Production"

__all__ = [
"PRIMARIES_ARRI_WIDE_GAMUT_3",
"WHITEPOINT_NAME_ARRI_WIDE_GAMUT_3",
"CCS_WHITEPOINT_ARRI_WIDE_GAMUT_3",
"MATRIX_ARRI_WIDE_GAMUT_3_TO_XYZ",
"MATRIX_XYZ_TO_ARRI_WIDE_GAMUT_3",
"RGB_COLOURSPACE_ARRI_WIDE_GAMUT_3",
]

PRIMARIES_ARRI_WIDE_GAMUT_3: NDArray = np.array(
[
[0.6840, 0.3130],
[0.2210, 0.8480],
[0.0861, -0.1020],
]
)
"""*ARRI Wide Gamut 3* colourspace primaries."""

WHITEPOINT_NAME_ARRI_WIDE_GAMUT_3: str = "D65"
"""*ARRI Wide Gamut 3* colourspace whitepoint name."""

CCS_WHITEPOINT_ARRI_WIDE_GAMUT_3: NDArray = CCS_ILLUMINANTS[
"CIE 1931 2 Degree Standard Observer"
][WHITEPOINT_NAME_ARRI_WIDE_GAMUT_3]
"""*ARRI Wide Gamut 3* colourspace whitepoint chromaticity coordinates."""

MATRIX_ARRI_WIDE_GAMUT_3_TO_XYZ: NDArray = np.array(
[
[0.638008, 0.214704, 0.097744],
[0.291954, 0.823841, -0.115795],
[0.002798, -0.067034, 1.153294],
]
)
"""*ARRI Wide Gamut 3* colourspace to *CIE XYZ* tristimulus values matrix."""

MATRIX_XYZ_TO_ARRI_WIDE_GAMUT_3: NDArray = np.array(
[
[1.789066, -0.482534, -0.200076],
[-0.639849, 1.396400, 0.194432],
[-0.041532, 0.082335, 0.878868],
]
)
"""*CIE XYZ* tristimulus values to *ARRI Wide Gamut 3* colourspace matrix."""

RGB_COLOURSPACE_ARRI_WIDE_GAMUT_3: RGB_Colourspace = RGB_Colourspace(
"ARRI Wide Gamut 3",
PRIMARIES_ARRI_WIDE_GAMUT_3,
CCS_WHITEPOINT_ARRI_WIDE_GAMUT_3,
WHITEPOINT_NAME_ARRI_WIDE_GAMUT_3,
MATRIX_ARRI_WIDE_GAMUT_3_TO_XYZ,
MATRIX_XYZ_TO_ARRI_WIDE_GAMUT_3,
log_encoding_ALEXALogC,
log_decoding_ALEXALogC,
)
RGB_COLOURSPACE_ARRI_WIDE_GAMUT_3.__doc__ = """
*ARRI Wide Gamut 3* colourspace.
References
----------
:cite:`ARRI2012a`
"""
94 changes: 0 additions & 94 deletions colour/models/rgb/datasets/arri_alexa_wide_gamut.py

This file was deleted.

2 changes: 1 addition & 1 deletion colour/models/rgb/datasets/tests/test__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def test_transformation_matrices(self):

tolerances = {
"Adobe RGB (1998)": 1e-5,
"ALEXA Wide Gamut": 1e-6,
"ARRI Wide Gamut 3": 1e-6,
"DJI D-Gamut": 1e-4,
"ERIMM RGB": 1e-3,
"ProPhoto RGB": 1e-3,
Expand Down
2 changes: 1 addition & 1 deletion docs/basics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Similarly, all the RGB colourspaces can be individually accessed from the
RGB_COLOURSPACE_ACES2065_1 RGB_COLOURSPACE_ACESPROXY RGB_COLOURSPACE_APPLE_RGB RGB_COLOURSPACE_BT470_525
RGB_COLOURSPACE_ACESCC RGB_COLOURSPACE_ADOBE_RGB1998 RGB_COLOURSPACE_BEST_RGB RGB_COLOURSPACE_BT470_625
RGB_COLOURSPACE_ACESCCT RGB_COLOURSPACE_ADOBE_WIDE_GAMUT_RGB RGB_COLOURSPACE_BETA_RGB RGB_COLOURSPACE_BT709 >
RGB_COLOURSPACE_ACESCG RGB_COLOURSPACE_ALEXA_WIDE_GAMUT RGB_COLOURSPACE_BT2020 RGB_COLOURSPACE_CIE_RGB
RGB_COLOURSPACE_ACESCG RGB_COLOURSPACE_ARRI_WIDE_GAMUT_3 RGB_COLOURSPACE_BT2020 RGB_COLOURSPACE_CIE_RGB
Abbreviations
-------------
Expand Down
2 changes: 1 addition & 1 deletion docs/colour.models.rst
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ RGB Colourspaces
RGB_COLOURSPACE_ACESCG
RGB_COLOURSPACE_ADOBE_RGB1998
RGB_COLOURSPACE_ADOBE_WIDE_GAMUT_RGB
RGB_COLOURSPACE_ALEXA_WIDE_GAMUT
RGB_COLOURSPACE_ARRI_WIDE_GAMUT_3
RGB_COLOURSPACE_APPLE_RGB
RGB_COLOURSPACE_BEST_RGB
RGB_COLOURSPACE_BETA_RGB
Expand Down
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -791,7 +791,7 @@ RGB Colourspaces
'ACEScct',
'ACEScg',
'ACESproxy',
'ALEXA Wide Gamut',
'ARRI Wide Gamut 3',
'Adobe RGB (1998)',
'Adobe Wide Gamut RGB',
'Apple RGB',
Expand Down

0 comments on commit 964b51a

Please sign in to comment.