summaryrefslogtreecommitdiff
path: root/openpicc/application/gammatable.py
diff options
context:
space:
mode:
Diffstat (limited to 'openpicc/application/gammatable.py')
-rw-r--r--openpicc/application/gammatable.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/openpicc/application/gammatable.py b/openpicc/application/gammatable.py
new file mode 100644
index 0000000..a2e59cd
--- /dev/null
+++ b/openpicc/application/gammatable.py
@@ -0,0 +1,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