summaryrefslogtreecommitdiff
path: root/src/bicubic_table.py
diff options
context:
space:
mode:
authorCorbin Simpson <MostAwesomeDude@gmail.com>2008-07-30 19:45:15 -0700
committerAlex Deucher <alexdeucher@gmail.com>2008-08-25 06:23:36 -0400
commit5e85d5a5d0c50b29086ec0c219c8b52d25dbc2e9 (patch)
tree829340a600b8f811ab21b4bc4824a18540419d40 /src/bicubic_table.py
parent17e5e9573e59c3d82d51c261b9c5005f6aec7d43 (diff)
Update bicubic tables.
Now including the 2048x1 texture as well.
Diffstat (limited to 'src/bicubic_table.py')
-rwxr-xr-xsrc/bicubic_table.py21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/bicubic_table.py b/src/bicubic_table.py
index d9b3c46b..53c5c3bc 100755
--- a/src/bicubic_table.py
+++ b/src/bicubic_table.py
@@ -1,12 +1,12 @@
#!/usr/bin/python
-def texgen():
+def texgen(pix):
tex = []
- for i in range(0,512,4):
+ for i in range(0,pix,4):
- a = i / 512.0
+ a = i / float(pix)
a2 = a ** 2
a3 = a ** 3
@@ -27,12 +27,17 @@ def printrow(l, offset):
seq = [ str(i) for i in l[offset:offset+4] ]
return "\t" + ", ".join(seq) + ","
-l = texgen()
+def maketable(pix):
-print "static const float bicubic_tex_128[] = {"
+ l = texgen(pix)
-for i in range(0, 512, 4):
+ print "static const float bicubic_tex_" + str(pix) + "[] = {"
- print printrow(l, i)
+ for i in range(0, pix, 4):
-print "\t0 };"
+ print printrow(l, i)
+
+ print "\t0 };\n"
+
+maketable(512)
+maketable(2048) \ No newline at end of file