Skip to content

Commit

Permalink
Merge branch 'feature/v0.3.1' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
KelSolaar committed Sep 2, 2014
2 parents 3ee967e + 53f4a5b commit 9dc60b4
Show file tree
Hide file tree
Showing 33 changed files with 284 additions and 93 deletions.
6 changes: 4 additions & 2 deletions colour/algebra/interpolation.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,8 @@ class SpragueInterpolator(object):
.. [1] `CIE 167:2005 Recommended Practice for Tabulating Spectral Data for
Use in Colour Computations: 9.2.4 Method of interpolation for
uniformly spaced independent variable
<http://div1.cie.co.at/?i_ca_id=551&pubid=47>`_
<http://div1.cie.co.at/?i_ca_id=551&pubid=47>`_,
ISBN-13: 978-3-901-90641-1
.. [2] **Stephen Westland, Caterina Ripamonti, Vien Cheung**,
*Computational Colour Science Using MATLAB, 2nd Edition*,
The Wiley-IS&T Series in Imaging Science and Technology,
Expand Down Expand Up @@ -315,7 +316,8 @@ class SpragueInterpolator(object):
References
----------
.. [3] `CIE 167:2005 Recommended Practice for Tabulating Spectral Data for Use in Colour Computations: Table V <http://div1.cie.co.at/?i_ca_id=551&pubid=47>`_ # noqa
.. [3] `CIE 167:2005 Recommended Practice for Tabulating Spectral Data for Use in Colour Computations: Table V <http://div1.cie.co.at/?i_ca_id=551&pubid=47>`_, # noqa
ISBN-13: 978-3-901-90641-1
"""

def __init__(self, x=None, y=None):
Expand Down
3 changes: 2 additions & 1 deletion colour/appearance/atd95.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
*Further applications of the ATD model for color vision*,
*IS&T/SPIE's Symposium on Electronic Imaging: Science & Technology*,
*International Society for Optics and Photonics*,
pages 12-26.
pages 12-26,
DOI: http://dx.doi.org/10.1117/12.206546
"""

from __future__ import division, unicode_literals
Expand Down
3 changes: 2 additions & 1 deletion colour/appearance/llab.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
.. [3] **Luo, M. R., Lo, M. C., & Kuo, W. G.**,
*The LLAB (l:c) colour model*,
*Color Research & Application, Volume 21, Issue 6, pages 412–429,
December 1996*
December 1996*,
DOI: http://dx.doi.org/10.1002/(SICI)1520-6378(199612)21:6<412::AID-COL4>3.0.CO;2-Z # noqa
"""

from __future__ import division, unicode_literals
Expand Down
3 changes: 2 additions & 1 deletion colour/appearance/nayatani95.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
*Lightness dependency of chroma scales of a nonlinear color-appearance
model and its latest formulation*,
*Color Research & Application, Volume 20, Issue 3, pages 156–167,
June 1995*
June 1995*,
DOI: http://dx.doi.org/10.1002/col.5080200305
"""

from __future__ import division, unicode_literals
Expand Down
1 change: 1 addition & 0 deletions colour/appearance/rlab.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
*Refinement of the RLAB color space*,
*Color Research & Application, Volume 21, Issue 5, pages 338–346,
October 1996*,
DOI: http://dx.doi.org/10.1002/(SICI)1520-6378(199610)21:5<338::AID-COL3>3.0.CO;2-Z # noqa
https://ritdml.rit.edu/bitstream/handle/1850/7857/MFairchildArticle12-06-1998.pdf # noqa
(Last accessed 16 August 2014)
.. [2] **Mark D. Fairchild**, *Color Appearance Models, 3nd Edition*,
Expand Down
4 changes: 2 additions & 2 deletions colour/characterisation/dataset/colour_checkers/spds.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
References
----------
.. [1] **N. Ohta**, *The Basis of Color Reproduction Engineering (Japanese)*,
Corona-sha Co of Japan, published 1997.
(Last accessed 24 February 2014)
Corona-sha Co of Japan, published 1997,
DOI: http://dx.doi.org/10.1002/(SICI)1520-6378(199610)21:5<338::AID-COL3>3.0.CO;2-Z # noqa
.. [2] http://www.rit-mcsl.org/UsefulData/MacbethColorChecker.xls
(Last accessed 9 June 2014)
.. [3] http://www.babelcolor.com/download/ColorChecker_RGB_and_spectra.xls
Expand Down
3 changes: 2 additions & 1 deletion colour/colorimetry/blackbody.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ def planck_law(wavelength, temperature, c1=C1, c2=C2, n=N):
----------
.. [1] `CIE 015:2004 Colorimetry, 3rd edition: Appendix E.
Information on the Use of Planck"s Equation for Standard Air.
<https://law.resource.org/pub/us/cfr/ibr/003/cie.15.2004.pdf>`_
<https://law.resource.org/pub/us/cfr/ibr/003/cie.15.2004.pdf>`_,
ISBN-13: 978-3-901-90633-6
Parameters
----------
Expand Down
1 change: 0 additions & 1 deletion colour/colorimetry/dataset/illuminants/spds.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
.. [1] http://files.cie.co.at/204.xls (Last accessed 24 February 2014)
.. [2] https://law.resource.org/pub/us/cfr/ibr/003/cie.15.2004.tables.xls
(Last accessed 24 February 2014)
.. [3] http://onlinelibrary.wiley.com/store/10.1002/9781119975595.app5/asset/app5.pdf?v=1&t=hwc899dh&s=01d1e0b27764970185be52b69b4480f3305ddb6c # noqa
"""

from __future__ import division, unicode_literals
Expand Down
4 changes: 2 additions & 2 deletions colour/colorimetry/lightness.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def lightness_wyszecki1964(Y, **kwargs):
References
----------
.. [1] http://en.wikipedia.org/wiki/Lightness
.. [2] http://en.wikipedia.org/wiki/Lightness
(Last accessed 13 April 2014)
Examples
Expand Down Expand Up @@ -149,7 +149,7 @@ def lightness_1976(Y, Yn=100):
References
----------
.. [2] http://www.poynton.com/PDFs/GammaFAQ.pdf
.. [3] http://www.poynton.com/PDFs/GammaFAQ.pdf
(Last accessed 12 April 2014)
Examples
Expand Down
24 changes: 16 additions & 8 deletions colour/colorimetry/spectrum.py
Original file line number Diff line number Diff line change
Expand Up @@ -1292,12 +1292,15 @@ def extrapolate(self,
References
----------
.. [2] `CIE 015:2004 Colorimetry, 3rd edition: 7.2.2.1 Extrapolation
<https://law.resource.org/pub/us/cfr/ibr/003/cie.15.2004.pdf>`_
<https://law.resource.org/pub/us/cfr/ibr/003/cie.15.2004.pdf>`_, # noqa
ISBN-13: 978-3-901-90633-6
.. [3] `CIE 167:2005 Recommended Practice for Tabulating Spectral Data
for Use in Colour Computations: 10. EXTRAPOLATION
<http://div1.cie.co.at/?i_ca_id=551&pubid=47>`_
<http://div1.cie.co.at/?i_ca_id=551&pubid=47>`_,
ISBN-13: 978-3-901-90641-1
Examples
--------
>>> data = {510: 49.67, 520: 69.59, 530: 81.73, 540: 88.19}
Expand Down Expand Up @@ -1388,7 +1391,8 @@ def interpolate(self, shape=SpectralShape(), method=None):
----------
.. [4] `CIE 167:2005 Recommended Practice for Tabulating Spectral Data
for Use in Colour Computations: 9. INTERPOLATION
<http://div1.cie.co.at/?i_ca_id=551&pubid=47>`_
<http://div1.cie.co.at/?i_ca_id=551&pubid=47>`_,
ISBN-13: 978-3-901-90641-1
Examples
--------
Expand Down Expand Up @@ -2842,10 +2846,13 @@ def extrapolate(self,
----------
.. [6] `CIE 015:2004 Colorimetry, 3rd edition: 7.2.2.1 Extrapolation
<https://law.resource.org/pub/us/cfr/ibr/003/cie.15.2004.pdf>`_
<https://law.resource.org/pub/us/cfr/ibr/003/cie.15.2004.pdf>`_, # noqa
ISBN-13: 978-3-901-90633-6
.. [7] `CIE 167:2005 Recommended Practice for Tabulating Spectral Data
for Use in Colour Computations: 10. EXTRAPOLATION
<http://div1.cie.co.at/?i_ca_id=551&pubid=47>`_
<http://div1.cie.co.at/?i_ca_id=551&pubid=47>`_,
ISBN-13: 978-3-901-90641-1
Examples
--------
>>> x_bar = {510: 49.67, 520: 69.59, 530: 81.73, 540: 88.19}
Expand Down Expand Up @@ -2904,9 +2911,10 @@ def interpolate(self, shape=SpectralShape(), method=None):
References
----------
.. [4] `CIE 167:2005 Recommended Practice for Tabulating Spectral Data
.. [8] `CIE 167:2005 Recommended Practice for Tabulating Spectral Data
for Use in Colour Computations: 9. INTERPOLATION
<http://div1.cie.co.at/?i_ca_id=551&pubid=47>`_
<http://div1.cie.co.at/?i_ca_id=551&pubid=47>`_,
ISBN-13: 978-3-901-90641-1
Examples
--------
Expand Down
3 changes: 2 additions & 1 deletion colour/colorimetry/transformations.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,8 @@ def RGB_10_degree_cmfs_to_LMS_10_degree_cmfs(wavelength):
References
----------
.. [3] `CIE 170-1:2006 Fundamental Chromaticity Diagram with Physiological
Axes - Part 1 <http://div1.cie.co.at/?i_ca_id=551&pubid=48>`_
Axes - Part 1 <http://div1.cie.co.at/?i_ca_id=551&pubid=48>`_,
ISBN-13: 978-3-901-90646-6
Examples
--------
Expand Down
3 changes: 2 additions & 1 deletion colour/models/aces_rgb_idt.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
----------
.. [1] http://www.oscars.org/science-technology/council/projects/aces.html
(Last accessed 24 February 2014)
.. [2] http://www.dropbox.com/sh/iwd09buudm3lfod/gyjDF-k7oC/ACES_v1.0.1.pdf
.. [2] `Academy Color Encoding Specification (ACES)
<https://www.dropbox.com/sh/nt9z9m6utzvkc5m/AACBum5OdkLPCZ3d6trfVeU8a/ACES_v1.0.1.pdf>`_ # noqa
(Last accessed 24 February 2014)
"""

Expand Down
8 changes: 5 additions & 3 deletions colour/models/dataset/aces_rgb.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
----------
.. [1] http://www.oscars.org/science-technology/council/projects/aces.html
(Last accessed 24 February 2014)
.. [2] http://www.dropbox.com/sh/iwd09buudm3lfod/gyjDF-k7oC/ACES_v1.0.1.pdf
.. [2] `Academy Color Encoding Specification (ACES)
<https://www.dropbox.com/sh/nt9z9m6utzvkc5m/AACBum5OdkLPCZ3d6trfVeU8a/ACES_v1.0.1.pdf>`_ # noqa
(Last accessed 24 February 2014)
"""

Expand Down Expand Up @@ -74,7 +75,8 @@
References
----------
.. [3] http://www.dropbox.com/sh/iwd09buudm3lfod/gyjDF-k7oC/ACES_v1.0.1.pdf:
.. [3] `Academy Color Encoding Specification (ACES)
<https://www.dropbox.com/sh/nt9z9m6utzvkc5m/AACBum5OdkLPCZ3d6trfVeU8a/ACES_v1.0.1.pdf>`_ # noqa
4.1.2 Color space chromaticities (Last accessed 24 February 2014)
"""

Expand Down Expand Up @@ -396,7 +398,7 @@ def _aces_rgb_proxy_inverse_transfer_function(value, bit_depth='10 Bit'):
References
----------
.. [6] `ACESproxy, an Integer Log Encoding of ACES Image Data
.. [7] `ACESproxy, an Integer Log Encoding of ACES Image Data
<http://www.dropbox.com/sh/iwd09buudm3lfod/AAAsl8WskbNNAJXh1r0dPlp2a/ACESproxy_v1.1.pdf>`_ # noqa
(Last accessed 17 May 2014)
"""
3 changes: 2 additions & 1 deletion colour/models/dataset/aces_rgb_idt.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
----------
.. [1] http://www.oscars.org/science-technology/council/projects/aces.html
(Last accessed 24 February 2014)
.. [2] http://www.dropbox.com/sh/iwd09buudm3lfod/gyjDF-k7oC/ACES_v1.0.1.pdf
.. [2] `Academy Color Encoding Specification (ACES)
<https://www.dropbox.com/sh/nt9z9m6utzvkc5m/AACBum5OdkLPCZ3d6trfVeU8a/ACES_v1.0.1.pdf>`_ # noqa
(Last accessed 24 February 2014)
"""

Expand Down
6 changes: 4 additions & 2 deletions colour/models/dataset/adobe_rgb_1998.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
References
----------
.. [1] http://www.adobe.com/digitalimag/pdfs/AdobeRGB1998.pdf
.. [1] `Adobe RGB (1998) Color Image Encoding
<http://www.adobe.com/digitalimag/pdfs/AdobeRGB1998.pdf>`_
(Last accessed 24 February 2014)
"""

Expand Down Expand Up @@ -71,7 +72,8 @@
References
----------
.. [2] http://www.adobe.com/digitalimag/pdfs/AdobeRGB1998.pdf:
.. [2] `Adobe RGB (1998) Color Image Encoding
<http://www.adobe.com/digitalimag/pdfs/AdobeRGB1998.pdf>`_
4.3.5.3 Converting RGB to normalised XYZ values
"""

Expand Down
3 changes: 2 additions & 1 deletion colour/models/dataset/c_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
References
----------
.. [1] http://downloads.canon.com/CDLC/Canon-Log_Transfer_Characteristic_6-20-2012.pdf # noqa
.. [1] `Canon-Log_Transfer_Characteristic
<http://downloads.canon.com/CDLC/Canon-Log_Transfer_Characteristic_6-20-2012.pdf>`_ # noqa
(Last accessed 18 April 2014)
"""

Expand Down
3 changes: 2 additions & 1 deletion colour/models/dataset/dci_p3.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
References
----------
.. [1] http://www.hp.com/united-states/campaigns/workstations/pdfs/lp2480zx-dci--p3-emulation.pdf # noqa
.. [1] `Understanding the HP DreamColor LP2480zx DCI-P3 Emulation Color Space
<http://www.hp.com/united-states/campaigns/workstations/pdfs/lp2480zx-dci--p3-emulation.pdf>`_ # noqa
(Last accessed 24 February 2014)
"""

Expand Down
3 changes: 2 additions & 1 deletion colour/models/dataset/ntsc_rgb.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
References
----------
.. [1] http://www.itu.int/dms_pubrec/itu-r/rec/bt/R-REC-BT.470-6-199811-S!!PDF-E.pdf # noqa
.. [1] `Recommendation ITU-R BT.470-6 - Conventional Television Systems
<http://www.itu.int/dms_pubrec/itu-r/rec/bt/R-REC-BT.470-6-199811-S!!PDF-E.pdf>`_ # noqa
(Last accessed 13 April 2014)
"""

Expand Down
3 changes: 2 additions & 1 deletion colour/models/dataset/pal_secam_rgb.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
References
----------
.. [1] http://www.itu.int/dms_pubrec/itu-r/rec/bt/R-REC-BT.470-6-199811-S!!PDF-E.pdf # noqa
.. [1] `Recommendation ITU-R BT.470-6 - Conventional Television Systems
<http://www.itu.int/dms_pubrec/itu-r/rec/bt/R-REC-BT.470-6-199811-S!!PDF-E.pdf>`_ # noqa
(Last accessed 13 April 2014)
"""

Expand Down
2 changes: 1 addition & 1 deletion colour/models/dataset/prophoto_rgb.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
References
----------
.. [1] http://www.color.org/ROMMRGB.pdf
.. [1] `Specification of ROMM RGB <http://www.color.org/ROMMRGB.pdf>`_
(Last accessed 24 February 2014)
"""

Expand Down
38 changes: 23 additions & 15 deletions colour/models/dataset/rec_2020.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,11 @@
References
----------
.. [1] http://www.itu.int/dms_pubrec/itu-r/rec/bt/R-REC-BT.2020-0-201208-I!!PDF-E.pdf # noqa
(Last accessed 13 April 2014)
.. [1] `Recommendation ITU-R BT.2020 - Parameter values for ultra-high
definition television systems for production and international
programme exchange
<http://www.itu.int/dms_pubrec/itu-r/rec/bt/R-REC-BT.2020-1-201406-I!!PDF-E.pdf>`_ # noqa
(Last accessed 2 September 2014)
"""

from __future__ import division, unicode_literals
Expand Down Expand Up @@ -104,16 +107,18 @@ def _rec_2020_transfer_function(value, is_10_bits_system=True):
References
----------
.. [2] `Recommendation ITU-R BT.2020: Signal Format
<http://www.itu.int/dms_pubrec/itu-r/rec/bt/R-REC-BT.2020-0-201208-I!!PDF-E.pdf>`_ # noqa
(Last accessed 13 April 2014)
.. [2] `Recommendation ITU-R BT.2020 - Parameter values for ultra-high
definition television systems for production and international
programme exchange
<http://www.itu.int/dms_pubrec/itu-r/rec/bt/R-REC-BT.2020-1-201406-I!!PDF-E.pdf>`_ # noqa
(Last accessed 2 September 2014)
"""

a = REC_2020_CONSTANTS.alpha(is_10_bits_system)
b = REC_2020_CONSTANTS.beta(is_10_bits_system)
return (value * 4.5
if value < REC_2020_CONSTANTS.beta(is_10_bits_system) else
REC_2020_CONSTANTS.alpha(is_10_bits_system) *
(value ** 0.45) -
(REC_2020_CONSTANTS.alpha(is_10_bits_system) - 1))
if value < b else
a * (value ** 0.45) - (a - 1))


def _rec_2020_inverse_transfer_function(value, is_10_bits_system=True):
Expand All @@ -134,15 +139,18 @@ def _rec_2020_inverse_transfer_function(value, is_10_bits_system=True):
References
----------
.. [3] `Recommendation ITU-R BT.2020: Signal Format
<http://www.itu.int/dms_pubrec/itu-r/rec/bt/R-REC-BT.2020-0-201208-I!!PDF-E.pdf>`_ # noqa
(Last accessed 13 April 2014)
.. [3] `Recommendation ITU-R BT.2020 - Parameter values for ultra-high
definition television systems for production and international
programme exchange
<http://www.itu.int/dms_pubrec/itu-r/rec/bt/R-REC-BT.2020-1-201406-I!!PDF-E.pdf>`_ # noqa
(Last accessed 2 September 2014)
"""

a = REC_2020_CONSTANTS.alpha(is_10_bits_system)
b = REC_2020_CONSTANTS.beta(is_10_bits_system)
return (value / 4.5
if value < REC_2020_CONSTANTS.beta(is_10_bits_system) else
((value + (REC_2020_CONSTANTS.alpha(is_10_bits_system) - 1)) /
REC_2020_CONSTANTS.alpha(is_10_bits_system)) ** (1 / 0.45))
if value < b else
((value + (a - 1)) / a) ** (1 / 0.45))


REC_2020_TRANSFER_FUNCTION = _rec_2020_transfer_function
Expand Down
4 changes: 3 additions & 1 deletion colour/models/dataset/rec_709.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
References
----------
.. [1] http://www.itu.int/dms_pubrec/itu-r/rec/bt/R-REC-BT.709-5-200204-I!!PDF-E.pdf # noqa
.. [1] `Recommendation ITU-R BT.709-5 - Parameter values for the HDTV
standards for production and international programme exchange
<http://www.itu.int/dms_pubrec/itu-r/rec/bt/R-REC-BT.709-5-200204-I!!PDF-E.pdf>`_ # noqa
(Last accessed 24 February 2014)
"""

Expand Down
4 changes: 3 additions & 1 deletion colour/models/dataset/s_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
References
----------
.. [1] http://pro.sony.com/bbsccms/assets/files/mkt/cinema/solutions/slog_manual.pdf # noqa
.. [1] `S-Log: A new LUT for digital production mastering and interchange
applications
<http://pro.sony.com/bbsccms/assets/files/mkt/cinema/solutions/slog_manual.pdf>`_ # noqa
(Last accessed 13 April 2014)
"""

Expand Down
3 changes: 2 additions & 1 deletion colour/models/dataset/smptec_rgb.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
References
----------
.. [1] http://standards.smpte.org/content/978-1-61482-164-9/rp-145-2004/SEC1.body.pdf # noqa
.. [1] `SMPTE C Color Monitor Colorimetry
<http://standards.smpte.org/content/978-1-61482-164-9/rp-145-2004/SEC1.body.pdf>`_ # noqa
(Last accessed 13 April 2014)
"""

Expand Down
4 changes: 3 additions & 1 deletion colour/models/dataset/srgb.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
References
----------
.. [1] http://www.itu.int/dms_pubrec/itu-r/rec/bt/R-REC-BT.709-5-200204-I!!PDF-E.pdf # noqa
.. [1] `Recommendation ITU-R BT.709-5 - Parameter values for the HDTV
standards for production and international programme exchange
<http://www.itu.int/dms_pubrec/itu-r/rec/bt/R-REC-BT.709-5-200204-I!!PDF-E.pdf>`_ # noqa
(Last accessed 24 February 2014)
"""

Expand Down
Loading

0 comments on commit 9dc60b4

Please sign in to comment.