diff options
Diffstat (limited to 'src/bicubic_table.py')
-rwxr-xr-x | src/bicubic_table.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/bicubic_table.py b/src/bicubic_table.py index 69cd402e..3657cbc9 100755 --- a/src/bicubic_table.py +++ b/src/bicubic_table.py @@ -1,5 +1,7 @@ #!/usr/bin/python +import struct + def texgen(pix): tex = [] @@ -24,14 +26,14 @@ def texgen(pix): def printrow(l, offset): - seq = [ str(i) for i in l[offset:offset+4] ] + seq = [ hex(struct.unpack('<I',struct.pack('f',i))[0]) for i in l[offset:offset+4] ] return "\t" + ", ".join(seq) + "," def maketable(pix): l = texgen(pix) - print "static const float bicubic_tex_" + str(pix) + "[] = {" + print "static const uint32_t bicubic_tex_" + str(pix) + "[] = {" for i in range(0, pix, 4): @@ -40,4 +42,4 @@ def maketable(pix): print "\t0 };\n" maketable(512) -maketable(2048)
\ No newline at end of file +maketable(2048) |