summaryrefslogtreecommitdiff
path: root/openpicc/application/gammatable.py
blob: a2e59cd5d6e676efd55d1ea97b00b55a75eb48f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/usr/bin/env python

a = range(1001)

#b = [ (pow(10, (float(e)/500))) * 202  - 202 for e in a]
b = [ 65534 * (pow((float(e)/1000), 2)) for e in a]
maximum = max(b)+1

print "/* Autogenerated from gammatable.py */"
print "const u_int16_t gammatable[] = {" + ", ".join( [str(int(round(int(e)))) for e in b]  ) + "};"
print "#define GAMMA_MAX %i" % maximum
print "#define GAMMA_LEN %i" % len(b)

personal git repositories of Harald Welte. Your mileage may vary