code stringlengths 66 870k | docstring stringlengths 19 26.7k | func_name stringlengths 1 138 | language stringclasses 1
value | repo stringlengths 7 68 | path stringlengths 5 324 | url stringlengths 46 389 | license stringclasses 7
values |
|---|---|---|---|---|---|---|---|
def contrast_sensitivity_function(
method: Literal["Barten 1999"] | str = "Barten 1999", **kwargs: Any
) -> NDArrayFloat:
"""
Return the contrast sensitivity :math:`S` of the human eye according to
the contrast sensitivity function (CSF) described by specified method.
Parameters
----------
... |
Return the contrast sensitivity :math:`S` of the human eye according to
the contrast sensitivity function (CSF) described by specified method.
Parameters
----------
method
Computation method.
Other Parameters
----------------
E
{:func:`colour.contrast.contrast_sensitiv... | contrast_sensitivity_function | python | colour-science/colour | colour/contrast/__init__.py | https://github.com/colour-science/colour/blob/master/colour/contrast/__init__.py | BSD-3-Clause |
def test_n_dimensional_optical_MTF_Barten1999(self) -> None:
"""
Test :func:`colour.contrast.barten1999.optical_MTF_Barten1999`
definition n-dimensional support.
"""
u = np.array([4, 8, 12])
sigma = np.array([0.01, 0.05, 0.1])
M_opt = optical_MTF_Barten1999(u, si... |
Test :func:`colour.contrast.barten1999.optical_MTF_Barten1999`
definition n-dimensional support.
| test_n_dimensional_optical_MTF_Barten1999 | python | colour-science/colour | colour/contrast/tests/test_barten1999.py | https://github.com/colour-science/colour/blob/master/colour/contrast/tests/test_barten1999.py | BSD-3-Clause |
def test_nan_optical_MTF_Barten1999(self) -> None:
"""
Test :func:`colour.contrast.barten1999.optical_MTF_Barten1999`
definition nan support.
"""
cases = [-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]
cases = np.array(list(set(product(cases, repeat=3))))
optical_MTF_B... |
Test :func:`colour.contrast.barten1999.optical_MTF_Barten1999`
definition nan support.
| test_nan_optical_MTF_Barten1999 | python | colour-science/colour | colour/contrast/tests/test_barten1999.py | https://github.com/colour-science/colour/blob/master/colour/contrast/tests/test_barten1999.py | BSD-3-Clause |
def test_n_dimensional_pupil_diameter_Barten1999(self) -> None:
"""
Test :func:`colour.contrast.barten1999.pupil_diameter_Barten1999`
definition n-dimensional support.
"""
L = np.array([0.2, 20, 100])
X_0 = np.array([60, 120, 240])
Y_0 = np.array([60, 30, 15])
... |
Test :func:`colour.contrast.barten1999.pupil_diameter_Barten1999`
definition n-dimensional support.
| test_n_dimensional_pupil_diameter_Barten1999 | python | colour-science/colour | colour/contrast/tests/test_barten1999.py | https://github.com/colour-science/colour/blob/master/colour/contrast/tests/test_barten1999.py | BSD-3-Clause |
def test_nan_pupil_diameter_Barten1999(self) -> None:
"""
Test :func:`colour.contrast.barten1999.pupil_diameter_Barten1999`
definition nan support.
"""
cases = [-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]
cases = np.array(list(set(product(cases, repeat=3))))
pupil_d... |
Test :func:`colour.contrast.barten1999.pupil_diameter_Barten1999`
definition nan support.
| test_nan_pupil_diameter_Barten1999 | python | colour-science/colour | colour/contrast/tests/test_barten1999.py | https://github.com/colour-science/colour/blob/master/colour/contrast/tests/test_barten1999.py | BSD-3-Clause |
def test_n_dimensional_sigma_Barten1999(self) -> None:
"""
Test :func:`colour.contrast.barten1999.sigma_Barten1999` definition
n-dimensional support.
"""
sigma_0 = np.array([0.25 / 60, 0.5 / 60, 0.75 / 60])
C_ab = np.array([0.04 / 60, 0.08 / 60, 0.16 / 60])
d = n... |
Test :func:`colour.contrast.barten1999.sigma_Barten1999` definition
n-dimensional support.
| test_n_dimensional_sigma_Barten1999 | python | colour-science/colour | colour/contrast/tests/test_barten1999.py | https://github.com/colour-science/colour/blob/master/colour/contrast/tests/test_barten1999.py | BSD-3-Clause |
def test_nan_sigma_Barten1999(self) -> None:
"""
Test :func:`colour.contrast.barten1999.sigma_Barten1999`
definition nan support.
"""
cases = [-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]
cases = np.array(list(set(product(cases, repeat=3))))
sigma_Barten1999(cases, c... |
Test :func:`colour.contrast.barten1999.sigma_Barten1999`
definition nan support.
| test_nan_sigma_Barten1999 | python | colour-science/colour | colour/contrast/tests/test_barten1999.py | https://github.com/colour-science/colour/blob/master/colour/contrast/tests/test_barten1999.py | BSD-3-Clause |
def test_n_dimensional_retinal_illuminance_Barten1999(self) -> None:
"""
Test :func:`colour.contrast.barten1999.retinal_illuminance_Barten1999`
definition n-dimensional support.
"""
L = np.array([0.2, 20, 100])
d = np.array([2.1, 2.5, 5.0])
E = retinal_illuminanc... |
Test :func:`colour.contrast.barten1999.retinal_illuminance_Barten1999`
definition n-dimensional support.
| test_n_dimensional_retinal_illuminance_Barten1999 | python | colour-science/colour | colour/contrast/tests/test_barten1999.py | https://github.com/colour-science/colour/blob/master/colour/contrast/tests/test_barten1999.py | BSD-3-Clause |
def test_nan_retinal_illuminance_Barten1999(self) -> None:
"""
Test :func:`colour.contrast.barten1999.retinal_illuminance_Barten1999`
definition nan support.
"""
cases = [-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]
cases = np.array(list(set(product(cases, repeat=3))))
... |
Test :func:`colour.contrast.barten1999.retinal_illuminance_Barten1999`
definition nan support.
| test_nan_retinal_illuminance_Barten1999 | python | colour-science/colour | colour/contrast/tests/test_barten1999.py | https://github.com/colour-science/colour/blob/master/colour/contrast/tests/test_barten1999.py | BSD-3-Clause |
def test_n_dimensional_maximum_angular_size_Barten1999(self) -> None:
"""
Test :func:`colour.contrast.barten1999.\
maximum_angular_size_Barten1999` definition n-dimensional support.
"""
u = np.array([4, 8, 12])
X_0 = np.array([60, 120, 240])
X_max = np.array([12, 14, 16]... |
Test :func:`colour.contrast.barten1999.maximum_angular_size_Barten1999` definition n-dimensional support.
| test_n_dimensional_maximum_angular_size_Barten1999 | python | colour-science/colour | colour/contrast/tests/test_barten1999.py | https://github.com/colour-science/colour/blob/master/colour/contrast/tests/test_barten1999.py | BSD-3-Clause |
def test_nan_maximum_angular_size_Barten1999(self) -> None:
"""
Test :func:`colour.contrast.barten1999.\
maximum_angular_size_Barten1999` definition nan support.
"""
cases = [-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]
cases = np.array(list(set(product(cases, repeat=3))))
m... |
Test :func:`colour.contrast.barten1999.maximum_angular_size_Barten1999` definition nan support.
| test_nan_maximum_angular_size_Barten1999 | python | colour-science/colour | colour/contrast/tests/test_barten1999.py | https://github.com/colour-science/colour/blob/master/colour/contrast/tests/test_barten1999.py | BSD-3-Clause |
def test_n_dimensional_contrast_sensitivity_function_Barten1999(self) -> None:
"""
Test :func:`colour.contrast.barten1999.\
contrast_sensitivity_function_Barten1999` definition n-dimensional support.
"""
u = np.array([4, 8, 12])
sigma = np.array([0.01, 0.02, 0.04])
E = n... |
Test :func:`colour.contrast.barten1999.contrast_sensitivity_function_Barten1999` definition n-dimensional support.
| test_n_dimensional_contrast_sensitivity_function_Barten1999 | python | colour-science/colour | colour/contrast/tests/test_barten1999.py | https://github.com/colour-science/colour/blob/master/colour/contrast/tests/test_barten1999.py | BSD-3-Clause |
def test_nan_contrast_sensitivity_function_Barten1999(self) -> None:
"""
Test :func:`colour.contrast.barten1999.\
contrast_sensitivity_function_Barten1999` definition nan support.
"""
cases = [-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]
cases = np.array(list(set(product(cases, repe... |
Test :func:`colour.contrast.barten1999.contrast_sensitivity_function_Barten1999` definition nan support.
| test_nan_contrast_sensitivity_function_Barten1999 | python | colour-science/colour | colour/contrast/tests/test_barten1999.py | https://github.com/colour-science/colour/blob/master/colour/contrast/tests/test_barten1999.py | BSD-3-Clause |
def convert_experiment_results_Breneman1987(
experiment: Literal[1, 2, 3, 4, 6, 8, 9, 11, 12],
) -> CorrespondingColourDataset:
"""
Convert *Breneman (1987)* experiment results to a
:class:`colour.CorrespondingColourDataset` class instance.
Parameters
----------
experiment
*Breneman... |
Convert *Breneman (1987)* experiment results to a
:class:`colour.CorrespondingColourDataset` class instance.
Parameters
----------
experiment
*Breneman (1987)* experiment number.
Returns
-------
:class:`colour.CorrespondingColourDataset`
:class:`colour.CorrespondingCol... | convert_experiment_results_Breneman1987 | python | colour-science/colour | colour/corresponding/prediction.py | https://github.com/colour-science/colour/blob/master/colour/corresponding/prediction.py | BSD-3-Clause |
def corresponding_chromaticities_prediction_Fairchild1990(
experiment: (Literal[1, 2, 3, 4, 6, 8, 9, 11, 12] | CorrespondingColourDataset) = 1,
) -> Tuple[CorrespondingChromaticitiesPrediction, ...]:
"""
Return the corresponding chromaticities prediction for *Fairchild (1990)*
chromatic adaptation model... |
Return the corresponding chromaticities prediction for *Fairchild (1990)*
chromatic adaptation model.
Parameters
----------
experiment
*Breneman (1987)* experiment number or
:class:`colour.CorrespondingColourDataset` class instance.
Returns
-------
:class:`tuple`
... | corresponding_chromaticities_prediction_Fairchild1990 | python | colour-science/colour | colour/corresponding/prediction.py | https://github.com/colour-science/colour/blob/master/colour/corresponding/prediction.py | BSD-3-Clause |
def corresponding_chromaticities_prediction_CIE1994(
experiment: (Literal[1, 2, 3, 4, 6, 8, 9, 11, 12] | CorrespondingColourDataset) = 1,
) -> Tuple[CorrespondingChromaticitiesPrediction, ...]:
"""
Return the corresponding chromaticities prediction for *CIE 1994*
chromatic adaptation model.
Paramet... |
Return the corresponding chromaticities prediction for *CIE 1994*
chromatic adaptation model.
Parameters
----------
experiment
*Breneman (1987)* experiment number or
:class:`colour.CorrespondingColourDataset` class instance.
Returns
-------
:class:`tuple`
Corre... | corresponding_chromaticities_prediction_CIE1994 | python | colour-science/colour | colour/corresponding/prediction.py | https://github.com/colour-science/colour/blob/master/colour/corresponding/prediction.py | BSD-3-Clause |
def corresponding_chromaticities_prediction_CMCCAT2000(
experiment: (Literal[1, 2, 3, 4, 6, 8, 9, 11, 12] | CorrespondingColourDataset) = 1,
) -> Tuple[CorrespondingChromaticitiesPrediction, ...]:
"""
Return the corresponding chromaticities prediction for *CMCCAT2000*
chromatic adaptation model.
Pa... |
Return the corresponding chromaticities prediction for *CMCCAT2000*
chromatic adaptation model.
Parameters
----------
experiment
*Breneman (1987)* experiment number or
:class:`colour.CorrespondingColourDataset` class instance.
Returns
-------
:class:`tuple`
Cor... | corresponding_chromaticities_prediction_CMCCAT2000 | python | colour-science/colour | colour/corresponding/prediction.py | https://github.com/colour-science/colour/blob/master/colour/corresponding/prediction.py | BSD-3-Clause |
def corresponding_chromaticities_prediction_VonKries(
experiment: (Literal[1, 2, 3, 4, 6, 8, 9, 11, 12] | CorrespondingColourDataset) = 1,
transform: LiteralChromaticAdaptationTransform | str = "CAT02",
) -> Tuple[CorrespondingChromaticitiesPrediction, ...]:
"""
Return the corresponding chromaticities p... |
Return the corresponding chromaticities prediction for *Von Kries*
chromatic adaptation model using specified transform.
Parameters
----------
experiment
*Breneman (1987)* experiment number or
:class:`colour.CorrespondingColourDataset` class instance.
transform
Chromati... | corresponding_chromaticities_prediction_VonKries | python | colour-science/colour | colour/corresponding/prediction.py | https://github.com/colour-science/colour/blob/master/colour/corresponding/prediction.py | BSD-3-Clause |
def corresponding_chromaticities_prediction_Zhai2018(
experiment: (Literal[1, 2, 3, 4, 6, 8, 9, 11, 12] | CorrespondingColourDataset) = 1,
D_b: ArrayLike = 1,
D_d: ArrayLike = 1,
XYZ_wo: ArrayLike = (1, 1, 1),
transform: Literal["CAT02", "CAT16"] | str = "CAT02",
) -> Tuple[CorrespondingChromaticiti... |
Return the corresponding chromaticities prediction for
*Zhai and Luo (2018)* chromatic adaptation model using specified transform.
Parameters
----------
experiment
*Breneman (1987)* experiment number or
:class:`colour.CorrespondingColourDataset` class instance.
D_b
Degr... | corresponding_chromaticities_prediction_Zhai2018 | python | colour-science/colour | colour/corresponding/prediction.py | https://github.com/colour-science/colour/blob/master/colour/corresponding/prediction.py | BSD-3-Clause |
def corresponding_chromaticities_prediction(
experiment: (Literal[1, 2, 3, 4, 6, 8, 9, 11, 12] | CorrespondingColourDataset) = 1,
model: (
Literal[
"CIE 1994",
"CMCCAT2000",
"Fairchild 1990",
"Von Kries",
"Zhai 2018",
]
| str
... |
Return the corresponding chromaticities prediction for specified chromatic
adaptation model.
Parameters
----------
experiment
*Breneman (1987)* experiment number or
:class:`colour.CorrespondingColourDataset` class instance.
model
Chromatic adaptation model.
Other P... | corresponding_chromaticities_prediction | python | colour-science/colour | colour/corresponding/prediction.py | https://github.com/colour-science/colour/blob/master/colour/corresponding/prediction.py | BSD-3-Clause |
def test_convert_experiment_results_Breneman1987(self) -> None:
"""
Test :func:`colour.corresponding.prediction.\
convert_experiment_results_Breneman1987` definition.
"""
corresponding_colour_dataset = convert_experiment_results_Breneman1987(1)
np.testing.assert_allclose(
... |
Test :func:`colour.corresponding.prediction.convert_experiment_results_Breneman1987` definition.
| test_convert_experiment_results_Breneman1987 | python | colour-science/colour | colour/corresponding/tests/test_prediction.py | https://github.com/colour-science/colour/blob/master/colour/corresponding/tests/test_prediction.py | BSD-3-Clause |
def test_corresponding_chromaticities_prediction_Fairchild1990(self) -> None:
"""
Test :func:`colour.corresponding.prediction.\
corresponding_chromaticities_prediction_Fairchild1990` definition.
"""
np.testing.assert_allclose(
np.array(
[
... |
Test :func:`colour.corresponding.prediction.corresponding_chromaticities_prediction_Fairchild1990` definition.
| test_corresponding_chromaticities_prediction_Fairchild1990 | python | colour-science/colour | colour/corresponding/tests/test_prediction.py | https://github.com/colour-science/colour/blob/master/colour/corresponding/tests/test_prediction.py | BSD-3-Clause |
def test_corresponding_chromaticities_prediction_CIE1994(self) -> None:
"""
Test :func:`colour.corresponding.prediction.\
corresponding_chromaticities_prediction_CIE1994` definition.
"""
np.testing.assert_allclose(
np.array(
[
(p.uv_m, p.u... |
Test :func:`colour.corresponding.prediction.corresponding_chromaticities_prediction_CIE1994` definition.
| test_corresponding_chromaticities_prediction_CIE1994 | python | colour-science/colour | colour/corresponding/tests/test_prediction.py | https://github.com/colour-science/colour/blob/master/colour/corresponding/tests/test_prediction.py | BSD-3-Clause |
def test_corresponding_chromaticities_prediction_CMCCAT2000(self) -> None:
"""
Test :func:`colour.corresponding.prediction.\
corresponding_chromaticities_prediction_CMCCAT2000` definition.
"""
np.testing.assert_allclose(
np.array(
[
(p.uv_... |
Test :func:`colour.corresponding.prediction.corresponding_chromaticities_prediction_CMCCAT2000` definition.
| test_corresponding_chromaticities_prediction_CMCCAT2000 | python | colour-science/colour | colour/corresponding/tests/test_prediction.py | https://github.com/colour-science/colour/blob/master/colour/corresponding/tests/test_prediction.py | BSD-3-Clause |
def test_corresponding_chromaticities_prediction_VonKries(self) -> None:
"""
Test :func:`colour.corresponding.prediction.\
corresponding_chromaticities_prediction_VonKries` definition.
"""
np.testing.assert_allclose(
np.array(
[
(p.uv_m, p... |
Test :func:`colour.corresponding.prediction.corresponding_chromaticities_prediction_VonKries` definition.
| test_corresponding_chromaticities_prediction_VonKries | python | colour-science/colour | colour/corresponding/tests/test_prediction.py | https://github.com/colour-science/colour/blob/master/colour/corresponding/tests/test_prediction.py | BSD-3-Clause |
def test_corresponding_chromaticities_prediction_Zhai2018(self) -> None:
"""
Test :func:`colour.corresponding.prediction.\
corresponding_chromaticities_prediction_Zhai2018` definition.
"""
np.testing.assert_allclose(
np.array(
[
(p.uv_m, p... |
Test :func:`colour.corresponding.prediction.corresponding_chromaticities_prediction_Zhai2018` definition.
| test_corresponding_chromaticities_prediction_Zhai2018 | python | colour-science/colour | colour/corresponding/tests/test_prediction.py | https://github.com/colour-science/colour/blob/master/colour/corresponding/tests/test_prediction.py | BSD-3-Clause |
def delta_E_Luo2006(
Jpapbp_1: ArrayLike, Jpapbp_2: ArrayLike, coefficients: Coefficients_UCS_Luo2006
) -> NDArrayFloat:
"""
Return the difference :math:`\\Delta E'` between two specified
*Luo et al. (2006)* *CAM02-LCD*, *CAM02-SCD*, or *CAM02-UCS* colourspaces
:math:`J'a'b'` arrays.
Parameters... |
Return the difference :math:`\Delta E'` between two specified
*Luo et al. (2006)* *CAM02-LCD*, *CAM02-SCD*, or *CAM02-UCS* colourspaces
:math:`J'a'b'` arrays.
Parameters
----------
Jpapbp_1
Standard / reference *Luo et al. (2006)* *CAM02-LCD*, *CAM02-SCD*, or
*CAM02-UCS* colour... | delta_E_Luo2006 | python | colour-science/colour | colour/difference/cam02_ucs.py | https://github.com/colour-science/colour/blob/master/colour/difference/cam02_ucs.py | BSD-3-Clause |
def delta_E_CIE1994(
Lab_1: ArrayLike, Lab_2: ArrayLike, textiles: bool = False
) -> NDArrayFloat:
"""
Return the difference :math:`\\Delta E_{94}` between two specified
*CIE L\\*a\\*b\\** colourspace arrays using *CIE 1994* recommendation.
Parameters
----------
Lab_1
*CIE L\\*a\\*b... |
Return the difference :math:`\Delta E_{94}` between two specified
*CIE L\*a\*b\** colourspace arrays using *CIE 1994* recommendation.
Parameters
----------
Lab_1
*CIE L\*a\*b\** colourspace array 1.
Lab_2
*CIE L\*a\*b\** colourspace array 2.
textiles
Textiles applic... | delta_E_CIE1994 | python | colour-science/colour | colour/difference/delta_e.py | https://github.com/colour-science/colour/blob/master/colour/difference/delta_e.py | BSD-3-Clause |
def intermediate_attributes_CIE2000(
Lab_1: ArrayLike, Lab_2: ArrayLike
) -> Attributes_Specification_CIE2000:
"""
Return the intermediate attributes to compute the difference
:math:`\\Delta E_{00}` between two specified *CIE L\\*a\\*b\\** colourspace
arrays using *CIE 2000* recommendation.
Par... |
Return the intermediate attributes to compute the difference
:math:`\Delta E_{00}` between two specified *CIE L\*a\*b\** colourspace
arrays using *CIE 2000* recommendation.
Parameters
----------
Lab_1
*CIE L\*a\*b\** colourspace array 1.
Lab_2
*CIE L\*a\*b\** colourspace ar... | intermediate_attributes_CIE2000 | python | colour-science/colour | colour/difference/delta_e.py | https://github.com/colour-science/colour/blob/master/colour/difference/delta_e.py | BSD-3-Clause |
def delta_E_CIE2000(
Lab_1: ArrayLike, Lab_2: ArrayLike, textiles: bool = False
) -> NDArrayFloat:
"""
Return the difference :math:`\\Delta E_{00}` between two specified
*CIE L\\*a\\*b\\** colourspace arrays using *CIE 2000* recommendation.
Parameters
----------
Lab_1
*CIE L\\*a\\*b... |
Return the difference :math:`\Delta E_{00}` between two specified
*CIE L\*a\*b\** colourspace arrays using *CIE 2000* recommendation.
Parameters
----------
Lab_1
*CIE L\*a\*b\** colourspace array 1.
Lab_2
*CIE L\*a\*b\** colourspace array 2.
textiles
Textiles applic... | delta_E_CIE2000 | python | colour-science/colour | colour/difference/delta_e.py | https://github.com/colour-science/colour/blob/master/colour/difference/delta_e.py | BSD-3-Clause |
def delta_E_ITP(ICtCp_1: ArrayLike, ICtCp_2: ArrayLike) -> NDArrayFloat:
"""
Return the difference :math:`\\Delta E_{ITP}` between two specified
:math:`IC_TC_P` colour encoding arrays using
*Recommendation ITU-R BT.2124*.
Parameters
----------
ICtCp_1
:math:`IC_TC_P` colour encoding... |
Return the difference :math:`\Delta E_{ITP}` between two specified
:math:`IC_TC_P` colour encoding arrays using
*Recommendation ITU-R BT.2124*.
Parameters
----------
ICtCp_1
:math:`IC_TC_P` colour encoding array 1.
ICtCp_2
:math:`IC_TC_P` colour encoding array 2.
Retur... | delta_E_ITP | python | colour-science/colour | colour/difference/delta_e.py | https://github.com/colour-science/colour/blob/master/colour/difference/delta_e.py | BSD-3-Clause |
def delta_E_HyAB(Lab_1: ArrayLike, Lab_2: ArrayLike) -> NDArrayFloat:
"""
Return the difference between two *CIE L\\*a\\*b\\** colourspace arrays
using a combination of a Euclidean metric in hue and chroma with a
city-block metric to incorporate lightness differences.
This metric is intended for la... |
Return the difference between two *CIE L\*a\*b\** colourspace arrays
using a combination of a Euclidean metric in hue and chroma with a
city-block metric to incorporate lightness differences.
This metric is intended for large colour differences, on the order of 10
CIE L\*a\*b\** units or greater.
... | delta_E_HyAB | python | colour-science/colour | colour/difference/delta_e.py | https://github.com/colour-science/colour/blob/master/colour/difference/delta_e.py | BSD-3-Clause |
def delta_E_HyCH(
Lab_1: ArrayLike, Lab_2: ArrayLike, textiles: bool = False
) -> NDArrayFloat:
"""
Return the difference between two *CIE L\\*a\\*b\\** colourspace arrays
using a combination of a Euclidean metric in hue and chroma with a
city-block metric to incorporate lightness differences based ... |
Return the difference between two *CIE L\*a\*b\** colourspace arrays
using a combination of a Euclidean metric in hue and chroma with a
city-block metric to incorporate lightness differences based on
*CIE 2000* recommendation attributes.
This metric is intended for large colour differences, on the... | delta_E_HyCH | python | colour-science/colour | colour/difference/delta_e.py | https://github.com/colour-science/colour/blob/master/colour/difference/delta_e.py | BSD-3-Clause |
def delta_E_DIN99(
Lab_1: ArrayLike, Lab_2: ArrayLike, textiles: bool = False
) -> NDArrayFloat:
"""
Return the difference :math:`\\Delta E_{DIN99}` between two specified
*CIE L\\*a\\*b\\** colourspace arrays using *DIN99* formula.
Parameters
----------
Lab_1
*CIE L\\*a\\*b\\** colo... |
Return the difference :math:`\Delta E_{DIN99}` between two specified
*CIE L\*a\*b\** colourspace arrays using *DIN99* formula.
Parameters
----------
Lab_1
*CIE L\*a\*b\** colourspace array 1.
Lab_2
*CIE L\*a\*b\** colourspace array 2.
textiles
Textiles application s... | delta_E_DIN99 | python | colour-science/colour | colour/difference/din99.py | https://github.com/colour-science/colour/blob/master/colour/difference/din99.py | BSD-3-Clause |
def power_function_Huang2015(
d_E: ArrayLike,
coefficients: (
Literal[
"CIE 1976",
"CIE 1994",
"CIE 2000",
"CMC",
"CAM02-LCD",
"CAM02-SCD",
"CAM16-UCS",
"DIN99d",
"OSA",
"OSA-GP-Euclid... |
Improve the performance of the :math:`\Delta E` value for specified
coefficients using
*Huang, Cui, Melgosa, Sanchez-Maranon, Li, Luo and Liu (2015)*
power-function: :math:`d_E^{\prime}=a*d_{E^b}`.
Parameters
----------
d_E
Computed colour difference array :math:`\Delta E`.
coe... | power_function_Huang2015 | python | colour-science/colour | colour/difference/huang2015.py | https://github.com/colour-science/colour/blob/master/colour/difference/huang2015.py | BSD-3-Clause |
def index_stress(
d_E: ArrayLike,
d_V: ArrayLike,
method: Literal["Garcia 2007"] | str = "Garcia 2007",
) -> NDArrayFloat:
"""
Compute the
*Kruskal's Standardized Residual Sum of Squares (:math:`STRESS`)*
index according to specified method.
Parameters
----------
d_E
Com... |
Compute the
*Kruskal's Standardized Residual Sum of Squares (:math:`STRESS`)*
index according to specified method.
Parameters
----------
d_E
Computed colour difference array :math:`\Delta E`.
d_V
Computed colour difference array :math:`\Delta V`.
method
Computat... | index_stress | python | colour-science/colour | colour/difference/stress.py | https://github.com/colour-science/colour/blob/master/colour/difference/stress.py | BSD-3-Clause |
def delta_E(
a: ArrayLike,
b: ArrayLike,
method: LiteralDeltaEMethod | str = "CIE 2000",
**kwargs: Any,
) -> NDArrayFloat:
"""
Return the difference :math:`\\Delta E_{ab}` between two specified
*CIE L\\*a\\*b\\**, :math:`IC_TC_P`, or :math:`J'a'b'` colourspace arrays
using specified meth... |
Return the difference :math:`\Delta E_{ab}` between two specified
*CIE L\*a\*b\**, :math:`IC_TC_P`, or :math:`J'a'b'` colourspace arrays
using specified method.
Parameters
----------
a
*CIE L\*a\*b\**, :math:`IC_TC_P`, or :math:`J'a'b'` colourspace
array :math:`a`.
b
... | delta_E | python | colour-science/colour | colour/difference/__init__.py | https://github.com/colour-science/colour/blob/master/colour/difference/__init__.py | BSD-3-Clause |
def test_n_dimensional_delta_E_Luo2006(self) -> None:
"""
Test :func:`colour.difference.cam02_ucs.delta_E_Luo2006` definition
n-dimensional arrays support.
"""
Jpapbp_1 = np.array([54.90433134, -0.08450395, -0.06854831])
Jpapbp_2 = np.array([54.80352754, -3.96940084, -13... |
Test :func:`colour.difference.cam02_ucs.delta_E_Luo2006` definition
n-dimensional arrays support.
| test_n_dimensional_delta_E_Luo2006 | python | colour-science/colour | colour/difference/tests/test_cam02_ucs.py | https://github.com/colour-science/colour/blob/master/colour/difference/tests/test_cam02_ucs.py | BSD-3-Clause |
def test_nan_delta_E_Luo2006(self) -> None:
"""
Test :func:`colour.difference.cam02_ucs.delta_E_Luo2006`
definition nan support.
"""
cases = [-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]
cases = np.array(list(set(product(cases, repeat=3))))
delta_E_Luo2006(cases, cas... |
Test :func:`colour.difference.cam02_ucs.delta_E_Luo2006`
definition nan support.
| test_nan_delta_E_Luo2006 | python | colour-science/colour | colour/difference/tests/test_cam02_ucs.py | https://github.com/colour-science/colour/blob/master/colour/difference/tests/test_cam02_ucs.py | BSD-3-Clause |
def test_n_dimensional_delta_E_CIE1976(self) -> None:
"""
Test :func:`colour.difference.delta_e.delta_E_CIE1976` definition
n-dimensional arrays support.
""" |
Test :func:`colour.difference.delta_e.delta_E_CIE1976` definition
n-dimensional arrays support.
| test_n_dimensional_delta_E_CIE1976 | python | colour-science/colour | colour/difference/tests/test_delta_e.py | https://github.com/colour-science/colour/blob/master/colour/difference/tests/test_delta_e.py | BSD-3-Clause |
def test_domain_range_scale_delta_E_CIE1976(self) -> None:
"""
Test :func:`colour.difference.delta_e.delta_E_CIE1976` definition
domain and range scale support.
"""
Lab_1 = np.array([48.99183622, -0.10561667, 400.65619925])
Lab_2 = np.array([50.65907324, -0.11671910, 402... |
Test :func:`colour.difference.delta_e.delta_E_CIE1976` definition
domain and range scale support.
| test_domain_range_scale_delta_E_CIE1976 | python | colour-science/colour | colour/difference/tests/test_delta_e.py | https://github.com/colour-science/colour/blob/master/colour/difference/tests/test_delta_e.py | BSD-3-Clause |
def test_nan_delta_E_CIE1976(self) -> None:
"""
Test :func:`colour.difference.delta_e.delta_E_CIE1976` definition nan
support.
""" |
Test :func:`colour.difference.delta_e.delta_E_CIE1976` definition nan
support.
| test_nan_delta_E_CIE1976 | python | colour-science/colour | colour/difference/tests/test_delta_e.py | https://github.com/colour-science/colour/blob/master/colour/difference/tests/test_delta_e.py | BSD-3-Clause |
def test_n_dimensional_delta_E_CIE1994(self) -> None:
"""
Test :func:`colour.difference.delta_e.delta_E_CIE1994` definition
n-dimensional arrays support.
"""
Lab_1 = np.array([48.99183622, -0.10561667, 400.65619925])
Lab_2 = np.array([50.65907324, -0.11671910, 402.822357... |
Test :func:`colour.difference.delta_e.delta_E_CIE1994` definition
n-dimensional arrays support.
| test_n_dimensional_delta_E_CIE1994 | python | colour-science/colour | colour/difference/tests/test_delta_e.py | https://github.com/colour-science/colour/blob/master/colour/difference/tests/test_delta_e.py | BSD-3-Clause |
def test_domain_range_scale_delta_E_CIE1994(self) -> None:
"""
Test :func:`colour.difference.delta_e.delta_E_CIE1994` definition
domain and range scale support.
"""
Lab_1 = np.array([48.99183622, -0.10561667, 400.65619925])
Lab_2 = np.array([50.65907324, -0.11671910, 402... |
Test :func:`colour.difference.delta_e.delta_E_CIE1994` definition
domain and range scale support.
| test_domain_range_scale_delta_E_CIE1994 | python | colour-science/colour | colour/difference/tests/test_delta_e.py | https://github.com/colour-science/colour/blob/master/colour/difference/tests/test_delta_e.py | BSD-3-Clause |
def test_nan_delta_E_CIE1994(self) -> None:
"""
Test :func:`colour.difference.delta_e.delta_E_CIE1994` definition nan
support.
"""
cases = [-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]
cases = np.array(list(set(product(cases, repeat=3))))
delta_E_CIE1994(cases, cases... |
Test :func:`colour.difference.delta_e.delta_E_CIE1994` definition nan
support.
| test_nan_delta_E_CIE1994 | python | colour-science/colour | colour/difference/tests/test_delta_e.py | https://github.com/colour-science/colour/blob/master/colour/difference/tests/test_delta_e.py | BSD-3-Clause |
def test_n_dimensional_delta_E_CIE2000(self) -> None:
"""
Test :func:`colour.difference.delta_e.delta_E_CIE2000` definition
n-dimensional arrays support.
"""
Lab_1 = np.array([48.99183622, -0.10561667, 400.65619925])
Lab_2 = np.array([50.65907324, -0.11671910, 402.822357... |
Test :func:`colour.difference.delta_e.delta_E_CIE2000` definition
n-dimensional arrays support.
| test_n_dimensional_delta_E_CIE2000 | python | colour-science/colour | colour/difference/tests/test_delta_e.py | https://github.com/colour-science/colour/blob/master/colour/difference/tests/test_delta_e.py | BSD-3-Clause |
def test_domain_range_scale_delta_E_CIE2000(self) -> None:
"""
Test :func:`colour.difference.delta_e.delta_E_CIE2000` definition
domain and range scale support.
"""
Lab_1 = np.array([48.99183622, -0.10561667, 400.65619925])
Lab_2 = np.array([50.65907324, -0.11671910, 402... |
Test :func:`colour.difference.delta_e.delta_E_CIE2000` definition
domain and range scale support.
| test_domain_range_scale_delta_E_CIE2000 | python | colour-science/colour | colour/difference/tests/test_delta_e.py | https://github.com/colour-science/colour/blob/master/colour/difference/tests/test_delta_e.py | BSD-3-Clause |
def test_nan_delta_E_CIE2000(self) -> None:
"""
Test :func:`colour.difference.delta_e.delta_E_CIE2000` definition nan
support.
"""
cases = [-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]
cases = np.array(list(set(product(cases, repeat=3))))
delta_E_CIE2000(cases, cases... |
Test :func:`colour.difference.delta_e.delta_E_CIE2000` definition nan
support.
| test_nan_delta_E_CIE2000 | python | colour-science/colour | colour/difference/tests/test_delta_e.py | https://github.com/colour-science/colour/blob/master/colour/difference/tests/test_delta_e.py | BSD-3-Clause |
def test_delta_E_CIE2000_Sharma2004(self) -> None:
"""
Test :func:`colour.difference.delta_e.delta_E_CIE2000` definition
using Sharma (2004) dataset.
References
----------
:cite:`Sharma2005b`
"""
# NOTE: The 14th test case is excluded as "Numpy" 1.24.0 i... |
Test :func:`colour.difference.delta_e.delta_E_CIE2000` definition
using Sharma (2004) dataset.
References
----------
:cite:`Sharma2005b`
| test_delta_E_CIE2000_Sharma2004 | python | colour-science/colour | colour/difference/tests/test_delta_e.py | https://github.com/colour-science/colour/blob/master/colour/difference/tests/test_delta_e.py | BSD-3-Clause |
def test_n_dimensional_delta_E_CMC(self) -> None:
"""
Test :func:`colour.difference.delta_e.delta_E_CMC` definition
n-dimensional arrays support.
"""
Lab_1 = np.array([48.99183622, -0.10561667, 400.65619925])
Lab_2 = np.array([50.65907324, -0.11671910, 402.82235718])
... |
Test :func:`colour.difference.delta_e.delta_E_CMC` definition
n-dimensional arrays support.
| test_n_dimensional_delta_E_CMC | python | colour-science/colour | colour/difference/tests/test_delta_e.py | https://github.com/colour-science/colour/blob/master/colour/difference/tests/test_delta_e.py | BSD-3-Clause |
def test_domain_range_scale_delta_E_CMC(self) -> None:
"""
Test :func:`colour.difference.delta_e.delta_E_CMC` definition
domain and range scale support.
"""
Lab_1 = np.array([48.99183622, -0.10561667, 400.65619925])
Lab_2 = np.array([50.65907324, -0.11671910, 402.8223571... |
Test :func:`colour.difference.delta_e.delta_E_CMC` definition
domain and range scale support.
| test_domain_range_scale_delta_E_CMC | python | colour-science/colour | colour/difference/tests/test_delta_e.py | https://github.com/colour-science/colour/blob/master/colour/difference/tests/test_delta_e.py | BSD-3-Clause |
def test_nan_delta_E_CMC(self) -> None:
"""
Test :func:`colour.difference.delta_e.delta_E_CMC` definition nan
support.
"""
cases = [-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]
cases = np.array(list(set(product(cases, repeat=3))))
delta_E_CMC(cases, cases) |
Test :func:`colour.difference.delta_e.delta_E_CMC` definition nan
support.
| test_nan_delta_E_CMC | python | colour-science/colour | colour/difference/tests/test_delta_e.py | https://github.com/colour-science/colour/blob/master/colour/difference/tests/test_delta_e.py | BSD-3-Clause |
def test_n_dimensional_delta_E_ITP(self) -> None:
"""
Test :func:`colour.difference.delta_e.delta_E_ITP` definition
n-dimensional arrays support.
"""
ICtCp_1 = np.array([0.4885468072, -0.04739350675, 0.07475401302])
ICtCp_2 = np.array([0.4899203231, -0.04567508203, 0.073... |
Test :func:`colour.difference.delta_e.delta_E_ITP` definition
n-dimensional arrays support.
| test_n_dimensional_delta_E_ITP | python | colour-science/colour | colour/difference/tests/test_delta_e.py | https://github.com/colour-science/colour/blob/master/colour/difference/tests/test_delta_e.py | BSD-3-Clause |
def test_domain_range_scale_delta_E_ITP(self) -> None:
"""
Test :func:`colour.difference.delta_e.delta_E_ITP` definition domain
and range scale support.
"""
ICtCp_1 = np.array([0.4885468072, -0.04739350675, 0.07475401302])
ICtCp_2 = np.array([0.4899203231, -0.04567508203... |
Test :func:`colour.difference.delta_e.delta_E_ITP` definition domain
and range scale support.
| test_domain_range_scale_delta_E_ITP | python | colour-science/colour | colour/difference/tests/test_delta_e.py | https://github.com/colour-science/colour/blob/master/colour/difference/tests/test_delta_e.py | BSD-3-Clause |
def test_nan_delta_E_ITP(self) -> None:
"""
Test :func:`colour.difference.delta_e.delta_E_ITP` definition nan
support.
"""
cases = [-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]
cases = np.array(list(set(product(cases, repeat=3))))
delta_E_ITP(cases, cases) |
Test :func:`colour.difference.delta_e.delta_E_ITP` definition nan
support.
| test_nan_delta_E_ITP | python | colour-science/colour | colour/difference/tests/test_delta_e.py | https://github.com/colour-science/colour/blob/master/colour/difference/tests/test_delta_e.py | BSD-3-Clause |
def test_n_dimensional_delta_E_HyAB(self) -> None:
"""
Test :func:`colour.difference.delta_e.delta_E_HyAB` definition
n-dimensional arrays support.
"""
Lab_1 = (np.array([39.91531343, 51.16658481, 146.12933781]),)
Lab_2 = (np.array([53.12207516, -39.92365056, 249.5483127... |
Test :func:`colour.difference.delta_e.delta_E_HyAB` definition
n-dimensional arrays support.
| test_n_dimensional_delta_E_HyAB | python | colour-science/colour | colour/difference/tests/test_delta_e.py | https://github.com/colour-science/colour/blob/master/colour/difference/tests/test_delta_e.py | BSD-3-Clause |
def test_domain_range_scale_delta_E_HyAB(self) -> None:
"""
Test :func:`colour.difference.delta_e.delta_E_HyAB` definition
domain and range scale support.
"""
Lab_1 = np.array([39.91531343, 51.16658481, 146.12933781])
Lab_2 = np.array([53.12207516, -39.92365056, 249.5483... |
Test :func:`colour.difference.delta_e.delta_E_HyAB` definition
domain and range scale support.
| test_domain_range_scale_delta_E_HyAB | python | colour-science/colour | colour/difference/tests/test_delta_e.py | https://github.com/colour-science/colour/blob/master/colour/difference/tests/test_delta_e.py | BSD-3-Clause |
def test_nan_delta_E_HyAB(self) -> None:
"""
Test :func:`colour.difference.delta_e.delta_E_HyAB` definition nan
support.
"""
cases = [-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]
cases = np.array(list(set(product(cases, repeat=3))))
delta_E_HyAB(cases, cases) |
Test :func:`colour.difference.delta_e.delta_E_HyAB` definition nan
support.
| test_nan_delta_E_HyAB | python | colour-science/colour | colour/difference/tests/test_delta_e.py | https://github.com/colour-science/colour/blob/master/colour/difference/tests/test_delta_e.py | BSD-3-Clause |
def test_n_dimensional_delta_E_HyCH(self) -> None:
"""
Test :func:`colour.difference.delta_e.delta_E_HyCH` definition
n-dimensional arrays support.
"""
Lab_1 = (np.array([39.91531343, 51.16658481, 146.12933781]),)
Lab_2 = (np.array([53.12207516, -39.92365056, 249.5483127... |
Test :func:`colour.difference.delta_e.delta_E_HyCH` definition
n-dimensional arrays support.
| test_n_dimensional_delta_E_HyCH | python | colour-science/colour | colour/difference/tests/test_delta_e.py | https://github.com/colour-science/colour/blob/master/colour/difference/tests/test_delta_e.py | BSD-3-Clause |
def test_domain_range_scale_delta_E_HyCH(self) -> None:
"""
Test :func:`colour.difference.delta_e.delta_E_HyCH` definition
domain and range scale support.
"""
Lab_1 = np.array([39.91531343, 51.16658481, 146.12933781])
Lab_2 = np.array([53.12207516, -39.92365056, 249.5483... |
Test :func:`colour.difference.delta_e.delta_E_HyCH` definition
domain and range scale support.
| test_domain_range_scale_delta_E_HyCH | python | colour-science/colour | colour/difference/tests/test_delta_e.py | https://github.com/colour-science/colour/blob/master/colour/difference/tests/test_delta_e.py | BSD-3-Clause |
def test_nan_delta_E_HyCH(self) -> None:
"""
Test :func:`colour.difference.delta_e.delta_E_HyCH` definition nan
support.
"""
cases = [-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]
cases = np.array(list(set(product(cases, repeat=3))))
delta_E_HyCH(cases, cases) |
Test :func:`colour.difference.delta_e.delta_E_HyCH` definition nan
support.
| test_nan_delta_E_HyCH | python | colour-science/colour | colour/difference/tests/test_delta_e.py | https://github.com/colour-science/colour/blob/master/colour/difference/tests/test_delta_e.py | BSD-3-Clause |
def test_n_dimensional_delta_E_DIN99(self) -> None:
"""
Test :func:`colour.difference.din99.delta_E_DIN99` definition
n-dimensional arrays support.
"""
Lab_1 = np.array([60.25740000, -34.00990000, 36.26770000])
Lab_2 = np.array([60.46260000, -34.17510000, 39.43870000])
... |
Test :func:`colour.difference.din99.delta_E_DIN99` definition
n-dimensional arrays support.
| test_n_dimensional_delta_E_DIN99 | python | colour-science/colour | colour/difference/tests/test_din99.py | https://github.com/colour-science/colour/blob/master/colour/difference/tests/test_din99.py | BSD-3-Clause |
def test_domain_range_scale_delta_E_DIN99(self) -> None:
"""
Test :func:`colour.difference.din99.delta_E_DIN99` definition
domain and range scale support.
"""
Lab_1 = np.array([60.25740000, -34.00990000, 36.26770000])
Lab_2 = np.array([60.46260000, -34.17510000, 39.43870... |
Test :func:`colour.difference.din99.delta_E_DIN99` definition
domain and range scale support.
| test_domain_range_scale_delta_E_DIN99 | python | colour-science/colour | colour/difference/tests/test_din99.py | https://github.com/colour-science/colour/blob/master/colour/difference/tests/test_din99.py | BSD-3-Clause |
def test_nan_delta_E_DIN99(self) -> None:
"""
Test :func:`colour.difference.din99.delta_E_DIN99` definition nan
support.
"""
cases = [-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]
cases = np.array(list(set(product(cases, repeat=3))))
delta_E_DIN99(cases, cases) |
Test :func:`colour.difference.din99.delta_E_DIN99` definition nan
support.
| test_nan_delta_E_DIN99 | python | colour-science/colour | colour/difference/tests/test_din99.py | https://github.com/colour-science/colour/blob/master/colour/difference/tests/test_din99.py | BSD-3-Clause |
def test_index_stress(self) -> None:
"""
Test :func:`colour.difference.stress.index_stress_Garcia2007`
definition.
"""
d_E = np.array([2.0425, 2.8615, 3.4412])
d_V = np.array([1.2644, 1.2630, 1.8731])
np.testing.assert_allclose(
index_stress(d_E, d_V... |
Test :func:`colour.difference.stress.index_stress_Garcia2007`
definition.
| test_index_stress | python | colour-science/colour | colour/difference/tests/test_stress.py | https://github.com/colour-science/colour/blob/master/colour/difference/tests/test_stress.py | BSD-3-Clause |
def test_domain_range_scale_delta_E(self) -> None:
"""
Test :func:`colour.difference.delta_E` definition domain and range
scale support.
"""
Lab_1 = np.array([48.99183622, -0.10561667, 400.65619925])
Lab_2 = np.array([50.65907324, -0.11671910, 402.82235718])
m =... |
Test :func:`colour.difference.delta_E` definition domain and range
scale support.
| test_domain_range_scale_delta_E | python | colour-science/colour | colour/difference/tests/test__init__.py | https://github.com/colour-science/colour/blob/master/colour/difference/tests/test__init__.py | BSD-3-Clause |
def maximise_spatial_frequency(L: ArrayLike) -> NDArrayFloat:
"""
Maximise the spatial frequency :math:`u` for given luminance value.
Parameters
----------
L
Luminance value at which to maximize the spatial frequency :math:`u`.
Returns
-------
:class:`np.float` or :class:`numpy... |
Maximise the spatial frequency :math:`u` for given luminance value.
Parameters
----------
L
Luminance value at which to maximize the spatial frequency :math:`u`.
Returns
-------
:class:`np.float` or :class:`numpy.ndarray`
Maximised spatial frequency :math:`u`.
| maximise_spatial_frequency | python | colour-science/colour | colour/examples/contrast/examples_contrast.py | https://github.com/colour-science/colour/blob/master/colour/examples/contrast/examples_contrast.py | BSD-3-Clause |
def ellipse_coefficients_general_form(coefficients: ArrayLike) -> NDArrayFloat:
"""
Generate the general form ellipse coefficients from specified canonical
form ellipse coefficients.
The canonical form ellipse coefficients are as follows: the center
coordinates :math:`x_c` and :math:`y_c`, semi-maj... |
Generate the general form ellipse coefficients from specified canonical
form ellipse coefficients.
The canonical form ellipse coefficients are as follows: the center
coordinates :math:`x_c` and :math:`y_c`, semi-major axis length
:math:`a_a`, semi-minor axis length :math:`a_b` and rotation angle
... | ellipse_coefficients_general_form | python | colour-science/colour | colour/geometry/ellipse.py | https://github.com/colour-science/colour/blob/master/colour/geometry/ellipse.py | BSD-3-Clause |
def ellipse_coefficients_canonical_form(
coefficients: ArrayLike,
) -> NDArrayFloat:
"""
Generate the canonical form ellipse coefficients from specified general
form ellipse coefficients.
The general form ellipse coefficients are the coefficients of the implicit
second-order polynomial/quadrati... |
Generate the canonical form ellipse coefficients from specified general
form ellipse coefficients.
The general form ellipse coefficients are the coefficients of the implicit
second-order polynomial/quadratic curve expressed as follows:
:math:`F\left(x, y\right)` = ax^2 + bxy + cy^2 + dx + ey + f ... | ellipse_coefficients_canonical_form | python | colour-science/colour | colour/geometry/ellipse.py | https://github.com/colour-science/colour/blob/master/colour/geometry/ellipse.py | BSD-3-Clause |
def point_at_angle_on_ellipse(phi: ArrayLike, coefficients: ArrayLike) -> NDArrayFloat:
"""
Generate the coordinates of the point at angle :math:`\\phi` in degrees
on the ellipse with specified canonical form coefficients.
Parameters
----------
phi
Point at angle :math:`\\phi` in degree... |
Generate the coordinates of the point at angle :math:`\phi` in degrees
on the ellipse with specified canonical form coefficients.
Parameters
----------
phi
Point at angle :math:`\phi` in degrees to retrieve the coordinates
of.
coefficients
Canonical form ellipse coeffic... | point_at_angle_on_ellipse | python | colour-science/colour | colour/geometry/ellipse.py | https://github.com/colour-science/colour/blob/master/colour/geometry/ellipse.py | BSD-3-Clause |
def ellipse_fitting_Halir1998(a: ArrayLike) -> NDArrayFloat:
"""
Generate the coefficients of the implicit second-order
polynomial/quadratic curve that fits specified point array :math:`a`
using *Halir and Flusser (1998)* method.
The implicit second-order polynomial is expressed as follows:
:m... |
Generate the coefficients of the implicit second-order
polynomial/quadratic curve that fits specified point array :math:`a`
using *Halir and Flusser (1998)* method.
The implicit second-order polynomial is expressed as follows:
:math:`F\left(x, y\right)` = ax^2 + bxy + cy^2 + dx + ey + f = 0`
... | ellipse_fitting_Halir1998 | python | colour-science/colour | colour/geometry/ellipse.py | https://github.com/colour-science/colour/blob/master/colour/geometry/ellipse.py | BSD-3-Clause |
def ellipse_fitting(
a: ArrayLike, method: Literal["Halir 1998"] | str = "Halir 1998"
) -> NDArrayFloat:
"""
Generate the coefficients of the implicit second-order
polynomial/quadratic curve that fits specified point array :math:`a`
using specified method.
The implicit second-order polynomial i... |
Generate the coefficients of the implicit second-order
polynomial/quadratic curve that fits specified point array :math:`a`
using specified method.
The implicit second-order polynomial is expressed as follows:
:math:`F\left(x, y\right)` = ax^2 + bxy + cy^2 + dx + ey + f = 0`
with an ellipse-... | ellipse_fitting | python | colour-science/colour | colour/geometry/ellipse.py | https://github.com/colour-science/colour/blob/master/colour/geometry/ellipse.py | BSD-3-Clause |
def extend_line_segment(
a: ArrayLike, b: ArrayLike, distance: float = 1
) -> NDArrayFloat:
"""
Extend the line segment defined by point arrays :math:`a` and :math:`b` by
specified distance and generate the new end point.
Parameters
----------
a
Point array :math:`a`.
b
... |
Extend the line segment defined by point arrays :math:`a` and :math:`b` by
specified distance and generate the new end point.
Parameters
----------
a
Point array :math:`a`.
b
Point array :math:`b`.
distance
Distance to extend the line segment.
Returns
-----... | extend_line_segment | python | colour-science/colour | colour/geometry/intersection.py | https://github.com/colour-science/colour/blob/master/colour/geometry/intersection.py | BSD-3-Clause |
def intersect_line_segments(
l_1: ArrayLike, l_2: ArrayLike
) -> LineSegmentsIntersections_Specification:
"""
Compute :math:`l_1` line segments intersections with :math:`l_2` line
segments.
Parameters
----------
l_1
:math:`l_1` line segments array, each row is a line segment such as... |
Compute :math:`l_1` line segments intersections with :math:`l_2` line
segments.
Parameters
----------
l_1
:math:`l_1` line segments array, each row is a line segment such as
(:math:`x_1`, :math:`y_1`, :math:`x_2`, :math:`y_2`) where
(:math:`x_1`, :math:`y_1`) and (:math:`x_... | intersect_line_segments | python | colour-science/colour | colour/geometry/intersection.py | https://github.com/colour-science/colour/blob/master/colour/geometry/intersection.py | BSD-3-Clause |
def edges_to_chord(edges: ArrayLike, index: int = 0) -> NDArrayFloat:
"""
Convert specified edges to a chord, starting at specified index.
Parameters
----------
edges
Edges to convert to a chord.
index
Index to start forming the chord at.
Returns
-------
:class:`num... |
Convert specified edges to a chord, starting at specified index.
Parameters
----------
edges
Edges to convert to a chord.
index
Index to start forming the chord at.
Returns
-------
:class:`numpy.ndarray`
Chord.
Examples
--------
>>> edges = np.arra... | edges_to_chord | python | colour-science/colour | colour/geometry/section.py | https://github.com/colour-science/colour/blob/master/colour/geometry/section.py | BSD-3-Clause |
def close_chord(vertices: ArrayLike) -> NDArrayFloat:
"""
Close the chord.
Parameters
----------
vertices
Vertices of the chord to close.
Returns
-------
:class:`numpy.ndarray`
Closed chord.
Examples
--------
>>> close_chord(np.array([[0.0, 0.5, 0.0], [0.0,... |
Close the chord.
Parameters
----------
vertices
Vertices of the chord to close.
Returns
-------
:class:`numpy.ndarray`
Closed chord.
Examples
--------
>>> close_chord(np.array([[0.0, 0.5, 0.0], [0.0, 0.0, 0.5]]))
array([[ 0. , 0.5, 0. ],
[ 0. ... | close_chord | python | colour-science/colour | colour/geometry/section.py | https://github.com/colour-science/colour/blob/master/colour/geometry/section.py | BSD-3-Clause |
def unique_vertices(
vertices: ArrayLike,
decimals: int = np.finfo(DTYPE_FLOAT_DEFAULT).precision - 1, # pyright: ignore
) -> NDArrayFloat:
"""
Generate the unique vertices from specified vertices.
Parameters
----------
vertices
Vertices to return the unique vertices from.
deci... |
Generate the unique vertices from specified vertices.
Parameters
----------
vertices
Vertices to return the unique vertices from.
decimals
Decimals used when rounding the vertices prior to comparison.
Returns
-------
:class:`numpy.ndarray`
Unique vertices.
... | unique_vertices | python | colour-science/colour | colour/geometry/section.py | https://github.com/colour-science/colour/blob/master/colour/geometry/section.py | BSD-3-Clause |
def test_ellipse_coefficients_canonical_form(self) -> None:
"""
Test :func:`colour.geometry.ellipse.\
ellipse_coefficients_canonical_form` definition.
"""
np.testing.assert_allclose(
ellipse_coefficients_canonical_form(
np.array([2.5, -3.0, 2.5, -1.0, -1.0, -... |
Test :func:`colour.geometry.ellipse.ellipse_coefficients_canonical_form` definition.
| test_ellipse_coefficients_canonical_form | python | colour-science/colour | colour/geometry/tests/test_ellipse.py | https://github.com/colour-science/colour/blob/master/colour/geometry/tests/test_ellipse.py | BSD-3-Clause |
def test_ellipse_coefficients_general_form(self) -> None:
"""
Test :func:`colour.geometry.ellipse.ellipse_coefficients_general_form`
definition.
"""
np.testing.assert_allclose(
ellipse_coefficients_general_form(np.array([0.5, 0.5, 2, 1, 45])),
np.array([2... |
Test :func:`colour.geometry.ellipse.ellipse_coefficients_general_form`
definition.
| test_ellipse_coefficients_general_form | python | colour-science/colour | colour/geometry/tests/test_ellipse.py | https://github.com/colour-science/colour/blob/master/colour/geometry/tests/test_ellipse.py | BSD-3-Clause |
def test_point_at_angle_on_ellipse(self) -> None:
"""
Test :func:`colour.geometry.ellipse.point_at_angle_on_ellipse`
definition.
"""
np.testing.assert_allclose(
point_at_angle_on_ellipse(
np.array([0, 90, 180, 270]), np.array([0.0, 0.0, 2, 1, 0])
... |
Test :func:`colour.geometry.ellipse.point_at_angle_on_ellipse`
definition.
| test_point_at_angle_on_ellipse | python | colour-science/colour | colour/geometry/tests/test_ellipse.py | https://github.com/colour-science/colour/blob/master/colour/geometry/tests/test_ellipse.py | BSD-3-Clause |
def test_ellipse_fitting_Halir1998(self) -> None:
"""
Test :func:`colour.geometry.ellipse.ellipse_fitting_Halir1998`
definition.
"""
np.testing.assert_allclose(
ellipse_fitting_Halir1998(np.array([[2, 0], [0, 1], [-2, 0], [0, -1]])),
np.array(
... |
Test :func:`colour.geometry.ellipse.ellipse_fitting_Halir1998`
definition.
| test_ellipse_fitting_Halir1998 | python | colour-science/colour | colour/geometry/tests/test_ellipse.py | https://github.com/colour-science/colour/blob/master/colour/geometry/tests/test_ellipse.py | BSD-3-Clause |
def test_extend_line_segment(self) -> None:
"""Test :func:`colour.geometry.intersection.extend_line_segment` definition."""
np.testing.assert_allclose(
extend_line_segment(
np.array([0.95694934, 0.13720932]),
np.array([0.28382835, 0.60608318]),
),... | Test :func:`colour.geometry.intersection.extend_line_segment` definition. | test_extend_line_segment | python | colour-science/colour | colour/geometry/tests/test_intersection.py | https://github.com/colour-science/colour/blob/master/colour/geometry/tests/test_intersection.py | BSD-3-Clause |
def test_intersect_line_segments(self) -> None:
"""
Test :func:`colour.geometry.intersection.intersect_line_segments`
definition.
"""
l_1 = np.array(
[
[[0.15416284, 0.7400497], [0.26331502, 0.53373939]],
[[0.01457496, 0.91874701], [0.... |
Test :func:`colour.geometry.intersection.intersect_line_segments`
definition.
| test_intersect_line_segments | python | colour-science/colour | colour/geometry/tests/test_intersection.py | https://github.com/colour-science/colour/blob/master/colour/geometry/tests/test_intersection.py | BSD-3-Clause |
def test_edges_to_chord(self) -> None:
"""Test :func:`colour.geometry.section.edges_to_chord` definition."""
edges = np.array(
[
[[0.0, -0.5, 0.0], [0.5, -0.5, 0.0]],
[[-0.5, -0.5, 0.0], [0.0, -0.5, 0.0]],
[[0.5, 0.5, 0.0], [0.0, 0.5, 0.0]],
... | Test :func:`colour.geometry.section.edges_to_chord` definition. | test_edges_to_chord | python | colour-science/colour | colour/geometry/tests/test_section.py | https://github.com/colour-science/colour/blob/master/colour/geometry/tests/test_section.py | BSD-3-Clause |
def test_close_chord(self) -> None:
"""Test :func:`colour.geometry.section.close_chord` definition."""
np.testing.assert_allclose(
close_chord(np.array([[0.0, 0.5, 0.0], [0.0, 0.0, 0.5]])),
np.array([[0.0, 0.5, 0.0], [0.0, 0.0, 0.5], [0.0, 0.5, 0.0]]),
atol=TOLERANCE... | Test :func:`colour.geometry.section.close_chord` definition. | test_close_chord | python | colour-science/colour | colour/geometry/tests/test_section.py | https://github.com/colour-science/colour/blob/master/colour/geometry/tests/test_section.py | BSD-3-Clause |
def test_unique_vertices(self) -> None:
"""Test :func:`colour.geometry.section.unique_vertices` definition."""
np.testing.assert_allclose(
unique_vertices(
np.array([[0.0, 0.5, 0.0], [0.0, 0.0, 0.5], [0.0, 0.5, 0.0]])
),
np.array([[0.0, 0.5, 0.0], [0.... | Test :func:`colour.geometry.section.unique_vertices` definition. | test_unique_vertices | python | colour-science/colour | colour/geometry/tests/test_section.py | https://github.com/colour-science/colour/blob/master/colour/geometry/tests/test_section.py | BSD-3-Clause |
def test_hull_section(self) -> None:
"""Test :func:`colour.geometry.section.hull_section` definition."""
if not is_trimesh_installed(): # pragma: no cover
return
import trimesh
vertices, faces, _outline = primitive_cube(1, 1, 1, 2, 2, 2)
hull = trimesh.Trimesh(ver... | Test :func:`colour.geometry.section.hull_section` definition. | test_hull_section | python | colour-science/colour | colour/geometry/tests/test_section.py | https://github.com/colour-science/colour/blob/master/colour/geometry/tests/test_section.py | BSD-3-Clause |
def CIECAM02_to_JMh_CIECAM02(
specification: CAM_Specification_CIECAM02,
) -> NDArrayFloat:
"""
Convert from *CIECAM02* specification to *CIECAM02* :math:`JMh`
correlates.
Parameters
----------
specification
*CIECAM02* colour appearance model specification.
Returns
-------
... |
Convert from *CIECAM02* specification to *CIECAM02* :math:`JMh`
correlates.
Parameters
----------
specification
*CIECAM02* colour appearance model specification.
Returns
-------
:class:`numpy.ndarray`
*CIECAM02* :math:`JMh` correlates.
Examples
--------
>>... | CIECAM02_to_JMh_CIECAM02 | python | colour-science/colour | colour/graph/conversion.py | https://github.com/colour-science/colour/blob/master/colour/graph/conversion.py | BSD-3-Clause |
def JMh_CIECAM02_to_CIECAM02(JMh: ArrayLike) -> CAM_Specification_CIECAM02:
"""
Convert from *CIECAM02* :math:`JMh` correlates to *CIECAM02*
specification.
Parameters
----------
JMh
*CIECAM02* :math:`JMh` correlates.
Returns
-------
:class:`colour.CAM_Specification_CIECAM0... |
Convert from *CIECAM02* :math:`JMh` correlates to *CIECAM02*
specification.
Parameters
----------
JMh
*CIECAM02* :math:`JMh` correlates.
Returns
-------
:class:`colour.CAM_Specification_CIECAM02`
*CIECAM02* colour appearance model specification.
Examples
----... | JMh_CIECAM02_to_CIECAM02 | python | colour-science/colour | colour/graph/conversion.py | https://github.com/colour-science/colour/blob/master/colour/graph/conversion.py | BSD-3-Clause |
def JMh_CAM16_to_CAM16(JMh: ArrayLike) -> CAM_Specification_CAM16:
"""
Convert from *CAM16* :math:`JMh` correlates to *CAM16* specification.
Parameters
----------
JMh
*CAM16* :math:`JMh` correlates.
Returns
-------
:class:`colour.CAM_Specification_CAM16`
*CAM16* colour... |
Convert from *CAM16* :math:`JMh` correlates to *CAM16* specification.
Parameters
----------
JMh
*CAM16* :math:`JMh` correlates.
Returns
-------
:class:`colour.CAM_Specification_CAM16`
*CAM16* colour appearance model specification.
Examples
--------
>>> import... | JMh_CAM16_to_CAM16 | python | colour-science/colour | colour/graph/conversion.py | https://github.com/colour-science/colour/blob/master/colour/graph/conversion.py | BSD-3-Clause |
def JMh_CIECAM16_to_CIECAM16(JMh: ArrayLike) -> CAM_Specification_CIECAM16:
"""
Convert from *CIECAM16* :math:`JMh` correlates to *CIECAM16* specification.
Parameters
----------
JMh
*CIECAM16* :math:`JMh` correlates.
Returns
-------
:class:`colour.CAM_Specification_CIECAM16`
... |
Convert from *CIECAM16* :math:`JMh` correlates to *CIECAM16* specification.
Parameters
----------
JMh
*CIECAM16* :math:`JMh` correlates.
Returns
-------
:class:`colour.CAM_Specification_CIECAM16`
*CIECAM16* colour appearance model specification.
Examples
--------... | JMh_CIECAM16_to_CIECAM16 | python | colour-science/colour | colour/graph/conversion.py | https://github.com/colour-science/colour/blob/master/colour/graph/conversion.py | BSD-3-Clause |
def Hellwig2022_to_JMh_Hellwig2022(
specification: CAM_Specification_Hellwig2022,
) -> NDArrayFloat:
"""
Convert from *Hellwig and Fairchild (2022)* specification to
*Hellwig and Fairchild (2022)* :math:`JMh` correlates.
Parameters
----------
specification
*Hellwig and Fairchild (20... |
Convert from *Hellwig and Fairchild (2022)* specification to
*Hellwig and Fairchild (2022)* :math:`JMh` correlates.
Parameters
----------
specification
*Hellwig and Fairchild (2022)* colour appearance model specification.
Returns
-------
:class:`numpy.ndarray`
*Hellwig... | Hellwig2022_to_JMh_Hellwig2022 | python | colour-science/colour | colour/graph/conversion.py | https://github.com/colour-science/colour/blob/master/colour/graph/conversion.py | BSD-3-Clause |
def JMh_Hellwig2022_to_Hellwig2022(
JMh: ArrayLike,
) -> CAM_Specification_Hellwig2022:
"""
Convert from *Hellwig and Fairchild (2022)* :math:`JMh` correlates to
*Hellwig and Fairchild (2022)* specification.
Parameters
----------
JMh
*Hellwig and Fairchild (2022)* :math:`JMh` corre... |
Convert from *Hellwig and Fairchild (2022)* :math:`JMh` correlates to
*Hellwig and Fairchild (2022)* specification.
Parameters
----------
JMh
*Hellwig and Fairchild (2022)* :math:`JMh` correlates.
Returns
-------
:class:`colour.CAM_Specification_Hellwig2022`
*Hellwig ... | JMh_Hellwig2022_to_Hellwig2022 | python | colour-science/colour | colour/graph/conversion.py | https://github.com/colour-science/colour/blob/master/colour/graph/conversion.py | BSD-3-Clause |
def RGB_luminance_to_RGB(Y: ArrayLike) -> NDArrayFloat:
"""
Convert from *luminance* :math:`Y` to *RGB*.
Parameters
----------
Y
*Luminance* :math:`Y`.
Returns
-------
:class:`numpy.ndarray`
*RGB*.
Examples
--------
>>> RGB_luminance_to_RGB(0.12301456238431... |
Convert from *luminance* :math:`Y` to *RGB*.
Parameters
----------
Y
*Luminance* :math:`Y`.
Returns
-------
:class:`numpy.ndarray`
*RGB*.
Examples
--------
>>> RGB_luminance_to_RGB(0.123014562384318) # doctest: +ELLIPSIS
array([ 0.1230145..., 0.1230145..... | RGB_luminance_to_RGB | python | colour-science/colour | colour/graph/conversion.py | https://github.com/colour-science/colour/blob/master/colour/graph/conversion.py | BSD-3-Clause |
def mired_to_CCT_D_uv(mired: ArrayLike) -> NDArrayFloat:
"""
Convert specified micro reciprocal degree (mired) to correlated colour
temperature :math:`T_{cp}` and :math:`\\Delta_{uv}`.
Parameters
----------
mired
Micro reciprocal degree (mired).
Returns
-------
:class:`nump... |
Convert specified micro reciprocal degree (mired) to correlated colour
temperature :math:`T_{cp}` and :math:`\Delta_{uv}`.
Parameters
----------
mired
Micro reciprocal degree (mired).
Returns
-------
:class:`numpy.ndarray`
Correlated colour temperature :math:`T_{cp}`, ... | mired_to_CCT_D_uv | python | colour-science/colour | colour/graph/conversion.py | https://github.com/colour-science/colour/blob/master/colour/graph/conversion.py | BSD-3-Clause |
def _format_node_name(name: str) -> str:
"""Format specified name by applying a series of substitutions."""
for pattern, substitution in [
("hdr_", "hdr-"),
("-CIELab", "-CIELAB"),
("_", " "),
("^Lab", "CIE Lab"),
("^LCHab", "CIE LCHab"),
("^Luv", "CIE Luv"),
... | Format specified name by applying a series of substitutions. | _format_node_name | python | colour-science/colour | colour/graph/conversion.py | https://github.com/colour-science/colour/blob/master/colour/graph/conversion.py | BSD-3-Clause |
def _build_graph() -> networkx.DiGraph: # pyright: ignore # noqa: F821
"""
Build the automatic colour conversion graph.
Returns
-------
:class:`networkx.DiGraph`
Automatic colour conversion graph.
"""
import networkx as nx
graph = nx.DiGraph()
for specification in CONV... |
Build the automatic colour conversion graph.
Returns
-------
:class:`networkx.DiGraph`
Automatic colour conversion graph.
| _build_graph | python | colour-science/colour | colour/graph/conversion.py | https://github.com/colour-science/colour/blob/master/colour/graph/conversion.py | BSD-3-Clause |
def _conversion_path(source: str, target: str) -> List[Callable]:
"""
Generate the conversion path from the source node to the target node in
the automatic colour conversion graph.
Parameters
----------
source
Source node.
target
Target node.
Returns
-------
:cl... |
Generate the conversion path from the source node to the target node in
the automatic colour conversion graph.
Parameters
----------
source
Source node.
target
Target node.
Returns
-------
:class:`list`
Conversion path from the source node to the target nod... | _conversion_path | python | colour-science/colour | colour/graph/conversion.py | https://github.com/colour-science/colour/blob/master/colour/graph/conversion.py | BSD-3-Clause |
def describe_conversion_path(
source: str,
target: str,
mode: Literal["Short", "Long", "Extended"] | str = "Short",
width: int = 79,
padding: int = 3,
print_callable: Callable = print,
**kwargs: Any,
) -> None:
"""
Describe the conversion path from source colour representation to tar... |
Describe the conversion path from source colour representation to target
colour representation using the automatic colour conversion graph.
Parameters
----------
source
Source colour representation, i.e., the source node in the automatic
colour conversion graph.
target
... | describe_conversion_path | python | colour-science/colour | colour/graph/conversion.py | https://github.com/colour-science/colour/blob/master/colour/graph/conversion.py | BSD-3-Clause |
def test_describe_conversion_path(self) -> None:
"""
Test :func:`colour.graph.conversion.describe_conversion_path`
definition.
"""
describe_conversion_path("Spectral Distribution", "sRGB")
describe_conversion_path("Spectral Distribution", "sRGB", mode="Long")
d... |
Test :func:`colour.graph.conversion.describe_conversion_path`
definition.
| test_describe_conversion_path | python | colour-science/colour | colour/graph/tests/test_conversion.py | https://github.com/colour-science/colour/blob/master/colour/graph/tests/test_conversion.py | BSD-3-Clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.