initial
This commit is contained in:
14
gamma.py
Executable file
14
gamma.py
Executable file
@@ -0,0 +1,14 @@
|
|||||||
|
#!/usr/bin/python3
|
||||||
|
|
||||||
|
GAMMA = 2.8 # correction factor
|
||||||
|
MAX_IN = 255 # top end of INPUT range
|
||||||
|
MAX_OUT = 255 # top end of OUTPUT range
|
||||||
|
|
||||||
|
print('{ \\')
|
||||||
|
for index in range(MAX_IN):
|
||||||
|
if index > 0:
|
||||||
|
print(',', end='')
|
||||||
|
if index & 15 == 0:
|
||||||
|
print()
|
||||||
|
print('%3d' % ((index / MAX_IN) ** GAMMA * MAX_OUT + 0.5), end='')
|
||||||
|
print('}')
|
||||||
Reference in New Issue
Block a user