7 // ARRI ALEXA IDT for ALEXA logC files
8 // with camera EI set to 800
9 // Written by v3_IDT_maker.py v0.06 on Thursday 01 March 2012 by alex
12 normalizedLogCToRelativeExposure(float x) {
14 return (pow(10,(x - 0.385537) / 0.247189) - 0.052272) / 5.555556;
16 return (x - 0.092809) / 5.367650;
23 return (math.pow(10.0,(x - 0.385537) / 0.247189) - 0.052272) / 5.555556
25 return (x - 0.092809) / 5.367650
27 def WriteSPI1D(filename, fromMin, fromMax, data):
28 f = file(filename,'w')
29 f.write("Version 1\n")
30 f.write("From %s %s\n" % (fromMin, fromMax))
31 f.write("Length %d\n" % len(data))
32 f.write("Components 1\n")
35 f.write(" %s\n" % value)
39 def Fit(value, fromMin, fromMax, toMin, toMax):
40 if fromMin == fromMax:
41 raise ValueError("fromMin == fromMax")
42 return (value - fromMin) / (fromMax - fromMin) * (toMax - toMin) + toMin
45 RANGE = (-0.125, 1.125)
47 for i in xrange(NUM_SAMPLES):
48 x = i/(NUM_SAMPLES-1.0)
49 x = Fit(x, 0.0, 1.0, RANGE[0], RANGE[1])
50 data.append(logCToLinear(x))
51 WriteSPI1D('logc800.spi1d', RANGE[0], RANGE[1], data)