X-Git-Url: http://users.mur.at/ms/git/gitweb/?p=OpenColorIO-Configs.git;a=blobdiff_plain;f=aces_1.0.0%2Fpython%2Faces_ocio%2Fcreate_red_colorspaces.py;h=2bdea9157a69c44066f0f69914f4029918d94512;hp=5443f16591431c850dd769d2540fd48732c97b35;hb=89360f70a6c71121580324ed3c125a83c3973887;hpb=1c4efc5c67e2313dfadf4a0786baaabd8d6489a6 diff --git a/aces_1.0.0/python/aces_ocio/create_red_colorspaces.py b/aces_1.0.0/python/aces_ocio/create_red_colorspaces.py index 5443f16..2bdea91 100644 --- a/aces_1.0.0/python/aces_ocio/create_red_colorspaces.py +++ b/aces_1.0.0/python/aces_ocio/create_red_colorspaces.py @@ -5,6 +5,8 @@ Implements support for *RED* colorspaces conversions and transfer functions. """ +from __future__ import division + import array import os @@ -59,29 +61,29 @@ def create_RED_log_film(gamut, def cineon_to_linear(code_value): n_gamma = 0.6 - black_point = 95.0 - white_point = 685.0 + black_point = 95 + white_point = 685 code_value_to_density = 0.002 - black_linear = pow(10.0, (black_point - white_point) * ( + black_linear = pow(10, (black_point - white_point) * ( code_value_to_density / n_gamma)) - code_linear = pow(10.0, (code_value - white_point) * ( + code_linear = pow(10, (code_value - white_point) * ( code_value_to_density / n_gamma)) - return (code_linear - black_linear) / (1.0 - black_linear) + return (code_linear - black_linear) / (1 - black_linear) cs.to_reference_transforms = [] if transfer_function == 'REDlogFilm': data = array.array('f', '\0' * lut_resolution_1d * 4) for c in range(lut_resolution_1d): - data[c] = cineon_to_linear(1023.0 * c / (lut_resolution_1d - 1)) + data[c] = cineon_to_linear(1023 * c / (lut_resolution_1d - 1)) lut = 'CineonLog_to_linear.spi1d' genlut.write_SPI_1d( os.path.join(lut_directory, lut), - 0.0, - 1.0, + 0, + 1, data, lut_resolution_1d, 1)