Skip to content

Commit

Permalink
Revert "Uniquely define common gamma functions using partial."
Browse files Browse the repository at this point in the history
This reverts commit d889366.
  • Loading branch information
KelSolaar committed Jun 27, 2024
1 parent d889366 commit 661c144
Show file tree
Hide file tree
Showing 20 changed files with 132 additions and 169 deletions.
3 changes: 0 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1495,12 +1495,9 @@ CCTFs Encoding / Decoding
'F-Log',
'F-Log2',
'Filmic Pro 6',
'Gamma 1.8',
'Gamma 2.199',
'Gamma 2.2',
'Gamma 2.4',
'Gamma 2.6',
'Gamma 2.8',
'ITU-R BT.1886',
'ITU-R BT.2020',
'ITU-R BT.2100 HLG',
Expand Down
12 changes: 5 additions & 7 deletions colour/models/rgb/datasets/adobe_rgb_1998.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,13 @@

from __future__ import annotations

from functools import partial

import numpy as np

from colour.colorimetry import CCS_ILLUMINANTS
from colour.hints import NDArrayFloat
from colour.models.rgb import RGB_Colourspace
from colour.models.rgb.transfer_functions.gamma import (
decoding_gamma_function_2_199,
encoding_gamma_function_2_199,
)
from colour.models.rgb import RGB_Colourspace, gamma_function

__author__ = "Colour Developers"
__copyright__ = "Copyright 2013 Colour Developers"
Expand Down Expand Up @@ -82,8 +80,8 @@
WHITEPOINT_NAME_ADOBE_RGB1998,
MATRIX_ADOBE_RGB1998_TO_XYZ,
MATRIX_XYZ_TO_ADOBE_RGB1998,
encoding_gamma_function_2_199,
decoding_gamma_function_2_199,
partial(gamma_function, exponent=1 / (563 / 256)),
partial(gamma_function, exponent=563 / 256),
)
RGB_COLOURSPACE_ADOBE_RGB1998.__doc__ = """
*Adobe RGB (1998)* colourspace.
Expand Down
14 changes: 8 additions & 6 deletions colour/models/rgb/datasets/adobe_wide_gamut_rgb.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,16 @@

from __future__ import annotations

from functools import partial

import numpy as np

from colour.colorimetry import CCS_ILLUMINANTS
from colour.hints import NDArrayFloat
from colour.models.rgb import RGB_Colourspace, normalised_primary_matrix
from colour.models.rgb.transfer_functions.gamma import (
decoding_gamma_function_2_199,
encoding_gamma_function_2_199,
from colour.models.rgb import (
RGB_Colourspace,
gamma_function,
normalised_primary_matrix,
)

__author__ = "Colour Developers"
Expand Down Expand Up @@ -75,8 +77,8 @@
WHITEPOINT_NAME_ADOBE_WIDE_GAMUT_RGB,
MATRIX_ADOBE_WIDE_GAMUT_RGB_TO_XYZ,
MATRIX_XYZ_TO_ADOBE_WIDE_GAMUT_RGB,
encoding_gamma_function_2_199,
decoding_gamma_function_2_199,
partial(gamma_function, exponent=1 / (563 / 256)),
partial(gamma_function, exponent=563 / 256),
)
RGB_COLOURSPACE_ADOBE_WIDE_GAMUT_RGB.__doc__ = """
*Adobe Wide Gamut RGB* colourspace.
Expand Down
11 changes: 5 additions & 6 deletions colour/models/rgb/datasets/apple_rgb.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,17 @@

from __future__ import annotations

from functools import partial

import numpy as np

from colour.colorimetry import CCS_ILLUMINANTS
from colour.hints import NDArrayFloat
from colour.models.rgb import (
RGB_Colourspace,
gamma_function,
normalised_primary_matrix,
)
from colour.models.rgb.transfer_functions.gamma import (
decoding_gamma_function_1_8,
encoding_gamma_function_1_8,
)

__author__ = "Colour Developers"
__copyright__ = "Copyright 2013 Colour Developers"
Expand Down Expand Up @@ -75,8 +74,8 @@
WHITEPOINT_NAME_APPLE_RGB,
MATRIX_APPLE_RGB_TO_XYZ,
MATRIX_XYZ_TO_APPLE_RGB,
encoding_gamma_function_1_8,
decoding_gamma_function_1_8,
partial(gamma_function, exponent=1 / 1.8),
partial(gamma_function, exponent=1.8),
)
RGB_COLOURSPACE_APPLE_RGB.__doc__ = """
*Apple RGB* colourspace.
Expand Down
14 changes: 8 additions & 6 deletions colour/models/rgb/datasets/best_rgb.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,16 @@

from __future__ import annotations

from functools import partial

import numpy as np

from colour.colorimetry import CCS_ILLUMINANTS
from colour.hints import NDArrayFloat
from colour.models.rgb import RGB_Colourspace, normalised_primary_matrix
from colour.models.rgb.transfer_functions.gamma import (
decoding_gamma_function_2_2,
encoding_gamma_function_2_2,
from colour.models.rgb import (
RGB_Colourspace,
gamma_function,
normalised_primary_matrix,
)

__author__ = "Colour Developers"
Expand Down Expand Up @@ -72,8 +74,8 @@
WHITEPOINT_NAME_BEST_RGB,
MATRIX_BEST_RGB_TO_XYZ,
MATRIX_XYZ_TO_BEST_RGB,
encoding_gamma_function_2_2,
decoding_gamma_function_2_2,
partial(gamma_function, exponent=1 / 2.2),
partial(gamma_function, exponent=2.2),
)
RGB_COLOURSPACE_BEST_RGB.__doc__ = """
*Best RGB* colourspace.
Expand Down
14 changes: 8 additions & 6 deletions colour/models/rgb/datasets/beta_rgb.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,16 @@

from __future__ import annotations

from functools import partial

import numpy as np

from colour.colorimetry import CCS_ILLUMINANTS
from colour.hints import NDArrayFloat
from colour.models.rgb import RGB_Colourspace, normalised_primary_matrix
from colour.models.rgb.transfer_functions.gamma import (
decoding_gamma_function_2_2,
encoding_gamma_function_2_2,
from colour.models.rgb import (
RGB_Colourspace,
gamma_function,
normalised_primary_matrix,
)

__author__ = "Colour Developers"
Expand Down Expand Up @@ -73,8 +75,8 @@
WHITEPOINT_NAME_BETA_RGB,
MATRIX_BETA_RGB_TO_XYZ,
MATRIX_XYZ_TO_BETA_RGB,
encoding_gamma_function_2_2,
decoding_gamma_function_2_2,
partial(gamma_function, exponent=1 / 2.2),
partial(gamma_function, exponent=2.2),
)
RGB_COLOURSPACE_BETA_RGB.__doc__ = """
*Beta RGB* colourspace.
Expand Down
12 changes: 5 additions & 7 deletions colour/models/rgb/datasets/cie_rgb.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,13 @@

from __future__ import annotations

from functools import partial

import numpy as np

from colour.colorimetry import CCS_ILLUMINANTS
from colour.hints import NDArrayFloat
from colour.models.rgb import RGB_Colourspace
from colour.models.rgb.transfer_functions.gamma import (
decoding_gamma_function_2_2,
encoding_gamma_function_2_2,
)
from colour.models.rgb import RGB_Colourspace, gamma_function

__author__ = "Colour Developers"
__copyright__ = "Copyright 2013 Colour Developers"
Expand Down Expand Up @@ -86,8 +84,8 @@
WHITEPOINT_NAME_CIE_RGB,
MATRIX_CIE_RGB_TO_XYZ,
MATRIX_XYZ_TO_CIE_RGB,
encoding_gamma_function_2_2,
decoding_gamma_function_2_2,
partial(gamma_function, exponent=1 / 2.2),
partial(gamma_function, exponent=2.2),
)
RGB_COLOURSPACE_CIE_RGB.__doc__ = """
*CIE RGB* colourspace.
Expand Down
14 changes: 8 additions & 6 deletions colour/models/rgb/datasets/color_match_rgb.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,16 @@

from __future__ import annotations

from functools import partial

import numpy as np

from colour.colorimetry import CCS_ILLUMINANTS
from colour.hints import NDArrayFloat
from colour.models.rgb import RGB_Colourspace, normalised_primary_matrix
from colour.models.rgb.transfer_functions.gamma import (
decoding_gamma_function_1_8,
encoding_gamma_function_1_8,
from colour.models.rgb import (
RGB_Colourspace,
gamma_function,
normalised_primary_matrix,
)

__author__ = "Colour Developers"
Expand Down Expand Up @@ -75,8 +77,8 @@
WHITEPOINT_NAME_COLOR_MATCH_RGB,
MATRIX_COLOR_MATCH_RGB_TO_XYZ,
MATRIX_XYZ_TO_COLOR_MATCH_RGB,
encoding_gamma_function_1_8,
decoding_gamma_function_1_8,
partial(gamma_function, exponent=1 / 1.8),
partial(gamma_function, exponent=1.8),
)
RGB_COLOURSPACE_COLOR_MATCH_RGB.__doc__ = """
*ColorMatch RGB* colourspace.
Expand Down
18 changes: 10 additions & 8 deletions colour/models/rgb/datasets/dci_p3.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,16 @@

from __future__ import annotations

from functools import partial

import numpy as np

from colour.colorimetry import CCS_ILLUMINANTS
from colour.hints import NDArrayFloat
from colour.models.rgb import RGB_Colourspace, normalised_primary_matrix
from colour.models.rgb.transfer_functions.gamma import (
decoding_gamma_function_2_6,
encoding_gamma_function_2_6,
from colour.models.rgb import (
RGB_Colourspace,
gamma_function,
normalised_primary_matrix,
)

__author__ = "Colour Developers"
Expand Down Expand Up @@ -113,8 +115,8 @@
WHITEPOINT_NAME_DCI_P3,
MATRIX_DCI_P3_TO_XYZ,
MATRIX_XYZ_TO_DCI_P3,
encoding_gamma_function_2_6,
decoding_gamma_function_2_6,
partial(gamma_function, exponent=1 / 2.6),
partial(gamma_function, exponent=2.6),
)
RGB_COLOURSPACE_DCI_P3.__doc__ = """
*DCI-P3* colourspace.
Expand All @@ -132,8 +134,8 @@
WHITEPOINT_NAME_DCI_P3,
MATRIX_DCI_P3_P_TO_XYZ,
MATRIX_XYZ_TO_DCI_P3_P,
encoding_gamma_function_2_6,
decoding_gamma_function_2_6,
partial(gamma_function, exponent=1 / 2.6),
partial(gamma_function, exponent=2.6),
)
RGB_COLOURSPACE_DCI_P3_P.__doc__ = """
*DCI-P3+* colourspace.
Expand Down
14 changes: 8 additions & 6 deletions colour/models/rgb/datasets/don_rgb_4.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,16 @@

from __future__ import annotations

from functools import partial

import numpy as np

from colour.colorimetry import CCS_ILLUMINANTS
from colour.hints import NDArrayFloat
from colour.models.rgb import RGB_Colourspace, normalised_primary_matrix
from colour.models.rgb.transfer_functions.gamma import (
decoding_gamma_function_2_2,
encoding_gamma_function_2_2,
from colour.models.rgb import (
RGB_Colourspace,
gamma_function,
normalised_primary_matrix,
)

__author__ = "Colour Developers"
Expand Down Expand Up @@ -72,8 +74,8 @@
WHITEPOINT_NAME_DON_RGB_4,
MATRIX_DON_RGB_4_TO_XYZ,
MATRIX_XYZ_TO_DON_RGB_4,
encoding_gamma_function_2_2,
decoding_gamma_function_2_2,
partial(gamma_function, exponent=1 / 2.2),
partial(gamma_function, exponent=2.2),
)
RGB_COLOURSPACE_DON_RGB_4.__doc__ = """
*Don RGB 4* colourspace.
Expand Down
14 changes: 8 additions & 6 deletions colour/models/rgb/datasets/ekta_space_ps5.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,16 @@

from __future__ import annotations

from functools import partial

import numpy as np

from colour.colorimetry import CCS_ILLUMINANTS
from colour.hints import NDArrayFloat
from colour.models.rgb import RGB_Colourspace, normalised_primary_matrix
from colour.models.rgb.transfer_functions.gamma import (
decoding_gamma_function_2_2,
encoding_gamma_function_2_2,
from colour.models.rgb import (
RGB_Colourspace,
gamma_function,
normalised_primary_matrix,
)

__author__ = "Colour Developers"
Expand Down Expand Up @@ -74,8 +76,8 @@
WHITEPOINT_NAME_EKTA_SPACE_PS_5_V,
MATRIX_EKTA_SPACE_PS_5_TO_XYZ,
MATRIX_XYZ_TO_EKTA_SPACE_PS_5,
encoding_gamma_function_2_2,
decoding_gamma_function_2_2,
partial(gamma_function, exponent=1 / 2.2),
partial(gamma_function, exponent=2.2),
)
RGB_COLOURSPACE_EKTA_SPACE_PS_5.__doc__ = """
*Ekta Space PS 5* colourspace.
Expand Down
18 changes: 10 additions & 8 deletions colour/models/rgb/datasets/itur_bt_470.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,16 @@

from __future__ import annotations

from functools import partial

import numpy as np

from colour.colorimetry import CCS_ILLUMINANTS
from colour.hints import NDArrayFloat
from colour.models.rgb import RGB_Colourspace, normalised_primary_matrix
from colour.models.rgb.transfer_functions.gamma import (
decoding_gamma_function_2_8,
encoding_gamma_function_2_8,
from colour.models.rgb import (
RGB_Colourspace,
gamma_function,
normalised_primary_matrix,
)

__author__ = "Colour Developers"
Expand Down Expand Up @@ -91,8 +93,8 @@
WHITEPOINT_NAME_BT470_525,
MATRIX_BT470_525_TO_XYZ,
MATRIX_XYZ_TO_BT470_525,
encoding_gamma_function_2_8,
decoding_gamma_function_2_8,
partial(gamma_function, exponent=1 / 2.8),
partial(gamma_function, exponent=2.8),
)
RGB_COLOURSPACE_BT470_525.__doc__ = """
*Recommendation ITU-R BT.470 - 525* colourspace.
Expand Down Expand Up @@ -143,8 +145,8 @@
WHITEPOINT_NAME_BT470_625,
MATRIX_BT470_625_TO_XYZ,
MATRIX_XYZ_TO_BT470_625,
encoding_gamma_function_2_8,
decoding_gamma_function_2_8,
partial(gamma_function, exponent=1 / 2.8),
partial(gamma_function, exponent=2.8),
)
RGB_COLOURSPACE_BT470_625.__doc__ = """
*Recommendation ITU-R BT.470 - 625* colourspace.
Expand Down
Loading

0 comments on commit 661c144

Please sign in to comment.