X-Git-Url: http://users.mur.at/ms/git/gitweb/?p=OpenColorIO-Configs.git;a=blobdiff_plain;f=aces_0.1.1%2Fluts%2Farri%2Flogc800.py;fp=aces_0.1.1%2Fluts%2Farri%2Flogc800.py;h=fd5bf01662be77e0c8422705f9f0cdb9bf221bf2;hp=0000000000000000000000000000000000000000;hb=9ce48d45f92a12b20b39eddd527b3c392b6a87cd;hpb=2335988b9d3ecc6b0d4f6f76938e1eaae449cac2 diff --git a/aces_0.1.1/luts/arri/logc800.py b/aces_0.1.1/luts/arri/logc800.py new file mode 100755 index 0000000..fd5bf01 --- /dev/null +++ b/aces_0.1.1/luts/arri/logc800.py @@ -0,0 +1,51 @@ +#!/usr/bin/env python + +import math + +""" + +// ARRI ALEXA IDT for ALEXA logC files +// with camera EI set to 800 +// Written by v3_IDT_maker.py v0.06 on Thursday 01 March 2012 by alex + +float +normalizedLogCToRelativeExposure(float x) { + if (x > 0.149659) + return (pow(10,(x - 0.385537) / 0.247189) - 0.052272) / 5.555556; + else + return (x - 0.092809) / 5.367650; +} + +""" + +def logCToLinear(x): + if (x > 0.149659): + return (math.pow(10.0,(x - 0.385537) / 0.247189) - 0.052272) / 5.555556 + else: + return (x - 0.092809) / 5.367650 + +def WriteSPI1D(filename, fromMin, fromMax, data): + f = file(filename,'w') + f.write("Version 1\n") + f.write("From %s %s\n" % (fromMin, fromMax)) + f.write("Length %d\n" % len(data)) + f.write("Components 1\n") + f.write("{\n") + for value in data: + f.write(" %s\n" % value) + f.write("}\n") + f.close() + +def Fit(value, fromMin, fromMax, toMin, toMax): + if fromMin == fromMax: + raise ValueError("fromMin == fromMax") + return (value - fromMin) / (fromMax - fromMin) * (toMax - toMin) + toMin + +NUM_SAMPLES = 2**14 +RANGE = (-0.125, 1.125) +data = [] +for i in xrange(NUM_SAMPLES): + x = i/(NUM_SAMPLES-1.0) + x = Fit(x, 0.0, 1.0, RANGE[0], RANGE[1]) + data.append(logCToLinear(x)) +WriteSPI1D('logc800.spi1d', RANGE[0], RANGE[1], data)