Last active
August 29, 2015 14:05
-
-
Save KelSolaar/9a1c7d7fdb698e1ec988 to your computer and use it in GitHub Desktop.
Stuff to discuss with JetBrains
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# PyCharm will complain the the parameters are missing in docstrings with | |
# Numpy style docstrings. | |
def XYZ_to_CIECAM02(XYZ, | |
XYZw, | |
LA, | |
Yb, | |
surround=CIECAM02_VIEWING_CONDITIONS.get( | |
'Average'), | |
discount_illuminant=False): | |
""" | |
Converts given *CIE XYZ* colourspace matrix to *CIECAM02* specification. | |
This is the *forward* implementation. | |
Parameters | |
---------- | |
XYZ : array_like | |
*CIE XYZ* colourspace stimulus matrix. | |
XYZw : array_like | |
*CIE XYZ* colourspace whitepoint matrix. | |
LA : float | |
Adapting field *luminance* :math:`L_A` in cd/m2. | |
Yb : float | |
Adapting field *Y* tristimulus value :math:`Y_b`. | |
surround : CIECAM02_Surround | |
Surround viewing conditions. | |
discount_illuminant : bool | |
Discount the illuminant. | |
Returns | |
------- | |
CIECAM02_Specification | |
*CIECAM02* specification. | |
Warning | |
------- | |
The input domain of that definition is non standard! | |
Notes | |
----- | |
- Input *CIE XYZ* colourspace matrix is in domain [0, 100]. | |
- Input *CIE XYZw* colourspace matrix is in domain [0, 100]. | |
Examples | |
-------- | |
>>> XYZ = np.array([19.01, 20.00, 21.78]) | |
>>> XYZw = np.array([95.05, 100.00, 108.88]) | |
>>> LA = 318.31 | |
>>> Yb = 20.0 | |
>>> colour.XYZ_to_CIECAM02(XYZ, XYZw, LA, Yb) | |
CIECAM02_Specification(J=41.731091132513917, C=0.1047077571711053, h=-140.9515673417281, Q=195.37132596607671, M=0.1088421756692261, s=2.3603053739204447, H=278.06073585662813) | |
""" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment