From f7f593cef595572b8346155ad8f83724bf78ebd9 Mon Sep 17 00:00:00 2001 From: Thomas Mansencal Date: Wed, 25 Oct 2023 21:40:06 +1300 Subject: [PATCH] Add `RGB` model to `colour.COLOURSPACE_MODELS` attribute and related. --- colour/hints/__init__.py | 1 + colour/models/common.py | 33 ++++++++++++++++++--------------- colour/plotting/models.py | 15 ++++++++------- 3 files changed, 27 insertions(+), 22 deletions(-) diff --git a/colour/hints/__init__.py b/colour/hints/__init__.py index 343a3a694..eae2066a1 100644 --- a/colour/hints/__init__.py +++ b/colour/hints/__init__.py @@ -238,6 +238,7 @@ def apply(self, RGB: ArrayLike, **kwargs: Any) -> NDArray: # noqa: D102 "Jzazbz", "OSA UCS", "Oklab", + "RGB", "YCbCr", "YCoCg", "Yrg", diff --git a/colour/models/common.py b/colour/models/common.py index da2c17d6a..485bf1d84 100644 --- a/colour/models/common.py +++ b/colour/models/common.py @@ -63,12 +63,12 @@ "CAM16LCD", "CAM16SCD", "CAM16UCS", - "CIE XYZ", - "CIE xyY", "CIE Lab", "CIE Luv", "CIE UCS", "CIE UVW", + "CIE XYZ", + "CIE xyY", "DIN99", "HCL", "HSL", @@ -78,17 +78,18 @@ "ICaCb", "ICtCp", "IHLS", - "IPT", "IPT Ragoo 2021", + "IPT", "IgPgTg", "Jzazbz", "OSA UCS", "Oklab", - "hdr-CIELAB", - "hdr-IPT", + "RGB", "YCbCr", "YCoCg", "Yrg", + "hdr-CIELAB", + "hdr-IPT", ) if is_documentation_building(): # pragma: no cover COLOURSPACE_MODELS = DocstringTuple(COLOURSPACE_MODELS) @@ -105,12 +106,12 @@ "CAM16LCD": ("$J^'$", "$a^'$", "$b^'$"), "CAM16SCD": ("$J^'$", "$a^'$", "$b^'$"), "CAM16UCS": ("$J^'$", "$a^'$", "$b^'$"), - "CIE XYZ": ("X", "Y", "Z"), - "CIE xyY": ("x", "y", "Y"), "CIE Lab": ("$L^*$", "$a^*$", "$b^*$"), "CIE Luv": ("$L^*$", "$u^'$", "$v^'$"), "CIE UCS": ("U", "V", "W"), "CIE UVW": ("U", "V", "W"), + "CIE XYZ": ("X", "Y", "Z"), + "CIE xyY": ("x", "y", "Y"), "DIN99": ("$L_{99}$", "$a_{99}$", "$b_{99}$"), "HCL": ("H", "C", "L"), "HSL": ("H", "S", "L"), @@ -120,17 +121,18 @@ "ICaCb": ("$I$", "$C_a$", "$C_b$"), "ICtCp": ("$I$", "$C_T$", "$C_P$"), "IHLS": ("H", "Y", "S"), - "IPT": ("I", "P", "T"), "IPT Ragoo 2021": ("I", "P", "T"), + "IPT": ("I", "P", "T"), "IgPgTg": ("$I_G$", "$P_G$", "$T_G$"), "Jzazbz": ("$J_z$", "$a_z$", "$b_z$"), "OSA UCS": ("L", "j", "g"), "Oklab": ("$L$", "$a$", "$b$"), - "hdr-CIELAB": ("L hdr", "a hdr", "b hdr"), - "hdr-IPT": ("I hdr", "P hdr", "T hdr"), + "RGB": ("R", "G", "B"), "YCbCr": ("Y", "$C_b$", "$C_r$"), "YCoCg": ("Y", "$C_o$", "$C_g$"), "Yrg": ("Y", "r", "g"), + "hdr-CIELAB": ("L hdr", "a hdr", "b hdr"), + "hdr-IPT": ("I hdr", "P hdr", "T hdr"), } ) """Colourspace models labels mapping.""" @@ -147,12 +149,12 @@ "CAM16LCD": np.array([100, 100, 100]), "CAM16SCD": np.array([100, 100, 100]), "CAM16UCS": np.array([100, 100, 100]), - "CIE XYZ": np.array([1, 1, 1]), - "CIE xyY": np.array([1, 1, 1]), "CIE Lab": np.array([100, 100, 100]), "CIE Luv": np.array([100, 100, 100]), "CIE UCS": np.array([1, 1, 1]), "CIE UVW": np.array([100, 100, 100]), + "CIE XYZ": np.array([1, 1, 1]), + "CIE xyY": np.array([1, 1, 1]), "DIN99": np.array([100, 100, 100]), "HCL": np.array([1, 1, 1]), "HSL": np.array([1, 1, 1]), @@ -162,17 +164,18 @@ "ICaCb": np.array([1, 1, 1]), "ICtCp": np.array([1, 1, 1]), "IHLS": np.array([1, 1, 1]), - "IPT": np.array([1, 1, 1]), "IPT Ragoo 2021": np.array([1, 1, 1]), + "IPT": np.array([1, 1, 1]), "IgPgTg": np.array([1, 1, 1]), "Jzazbz": np.array([1, 1, 1]), "OSA UCS": np.array([100, 100, 100]), "Oklab": np.array([1, 1, 1]), - "hdr-CIELAB": np.array([100, 100, 100]), - "hdr-IPT": np.array([100, 100, 100]), + "RGB": np.array([1, 1, 1]), "YCbCr": np.array([1, 1, 1]), "YCoCg": np.array([1, 1, 1]), "Yrg": np.array([1, 1, 1]), + "hdr-CIELAB": np.array([100, 100, 100]), + "hdr-IPT": np.array([100, 100, 100]), } ) """Colourspace models domain-range scale **'1'** to **'Reference'** mapping.""" diff --git a/colour/plotting/models.py b/colour/plotting/models.py index d0b9b6ee2..89632f2b2 100644 --- a/colour/plotting/models.py +++ b/colour/plotting/models.py @@ -163,14 +163,14 @@ "CAM16LCD": (1, 2, 0), "CAM16SCD": (1, 2, 0), "CAM16UCS": (1, 2, 0), - "CIE XYZ": (0, 1, 2), - "CIE xyY": (0, 1, 2), - "CIE Lab": (1, 2, 0), "CIE LCHab": (1, 2, 0), - "CIE Luv": (1, 2, 0), "CIE LCHuv": (1, 2, 0), + "CIE Lab": (1, 2, 0), + "CIE Luv": (1, 2, 0), "CIE UCS": (0, 1, 2), "CIE UVW": (1, 2, 0), + "CIE XYZ": (0, 1, 2), + "CIE xyY": (0, 1, 2), "DIN99": (1, 2, 0), "HCL": (0, 1, 2), "HSL": (0, 1, 2), @@ -180,17 +180,18 @@ "ICaCb": (1, 2, 0), "ICtCp": (1, 2, 0), "IHLS": (0, 2, 1), - "IPT": (1, 2, 0), "IPT Ragoo 2021": (1, 2, 0), + "IPT": (1, 2, 0), "IgPgTg": (1, 2, 0), "Jzazbz": (1, 2, 0), "OSA UCS": (1, 2, 0), "Oklab": (1, 2, 0), - "hdr-CIELAB": (1, 2, 0), - "hdr-IPT": (1, 2, 0), + "RGB": (0, 1, 2), "YCbCr": (1, 2, 0), "YCoCg": (1, 2, 0), "Yrg": (1, 2, 0), + "hdr-CIELAB": (1, 2, 0), + "hdr-IPT": (1, 2, 0), } ) """Colourspace models axis order."""