Coverage for models/rgb/datasets/gopro.py: 0%
24 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"""
2GoPro Colourspaces
3==================
5Define the *GoPro* colourspaces:
7- :attr:`colour.models.RGB_COLOURSPACE_PROTUNE_NATIVE`.
9Notes
10-----
11- The *Protune Native* colourspace primaries were derived using the method
12 outlined in :cite:`Mansencal2015d` followed with a chromatic adaptation
13 step to *CIE Standard Illuminant D Series D65* using
14 :func:`colour.chromatically_adapted_primaries` definition.
16References
17----------
18- :cite:`GoPro2016a` : GoPro, Duiker, H.-P., & Mansencal, T. (2016).
19 gopro.py. Retrieved April 12, 2017, from
20 https://github.com/hpd/OpenColorIO-Configs/blob/master/aces_1.0.3/python/\
21aces_ocio/colorspaces/gopro.py
22- :cite:`Mansencal2015d` : Mansencal, T. (2015). RED Colourspaces Derivation.
23 Retrieved May 20, 2015, from
24 https://www.colour-science.org/posts/red-colourspaces-derivation
25"""
27from __future__ import annotations
29import typing
31import numpy as np
33from colour.colorimetry import CCS_ILLUMINANTS
35if typing.TYPE_CHECKING:
36 from colour.hints import NDArrayFloat
38from colour.models.rgb import (
39 RGB_Colourspace,
40 log_decoding_Protune,
41 log_encoding_Protune,
42 normalised_primary_matrix,
43)
45__author__ = "Colour Developers"
46__copyright__ = "Copyright 2013 Colour Developers"
47__license__ = "BSD-3-Clause - https://opensource.org/licenses/BSD-3-Clause"
48__maintainer__ = "Colour Developers"
49__email__ = "colour-developers@colour-science.org"
50__status__ = "Production"
52__all__ = [
53 "PRIMARIES_PROTUNE_NATIVE",
54 "WHITEPOINT_NAME_PROTUNE_NATIVE",
55 "CCS_WHITEPOINT_PROTUNE_NATIVE",
56 "MATRIX_PROTUNE_NATIVE_TO_XYZ",
57 "MATRIX_XYZ_TO_PROTUNE_NATIVE",
58 "RGB_COLOURSPACE_PROTUNE_NATIVE",
59]
61PRIMARIES_PROTUNE_NATIVE: NDArrayFloat = np.array(
62 [
63 [0.698480461493841, 0.193026445370121],
64 [0.329555378387345, 1.024596624134644],
65 [0.108442631407675, -0.034678569754016],
66 ]
67)
68"""*Protune Native* colourspace primaries."""
70WHITEPOINT_NAME_PROTUNE_NATIVE: str = "D65"
71"""*Protune Native* colourspace whitepoint name."""
73CCS_WHITEPOINT_PROTUNE_NATIVE: NDArrayFloat = CCS_ILLUMINANTS[
74 "CIE 1931 2 Degree Standard Observer"
75][WHITEPOINT_NAME_PROTUNE_NATIVE]
76"""*Protune Native* colourspace whitepoint chromaticity coordinates."""
78MATRIX_PROTUNE_NATIVE_TO_XYZ: NDArrayFloat = normalised_primary_matrix(
79 PRIMARIES_PROTUNE_NATIVE, CCS_WHITEPOINT_PROTUNE_NATIVE
80)
81"""*Protune Native* colourspace to *CIE XYZ* tristimulus values matrix."""
83MATRIX_XYZ_TO_PROTUNE_NATIVE: NDArrayFloat = np.linalg.inv(MATRIX_PROTUNE_NATIVE_TO_XYZ)
84"""*CIE XYZ* tristimulus values to *Protune Native* colourspace matrix."""
86RGB_COLOURSPACE_PROTUNE_NATIVE: RGB_Colourspace = RGB_Colourspace(
87 "Protune Native",
88 PRIMARIES_PROTUNE_NATIVE,
89 CCS_WHITEPOINT_PROTUNE_NATIVE,
90 WHITEPOINT_NAME_PROTUNE_NATIVE,
91 MATRIX_PROTUNE_NATIVE_TO_XYZ,
92 MATRIX_XYZ_TO_PROTUNE_NATIVE,
93 log_encoding_Protune,
94 log_decoding_Protune,
95)
96RGB_COLOURSPACE_PROTUNE_NATIVE.__doc__ = """
97*Protune Native* colourspace.
99References
100----------
101:cite:`GoPro2016a`, :cite:`Mansencal2015d`
102"""