Skip to content

Commit

Permalink
[wistful sigh]
Browse files Browse the repository at this point in the history
  • Loading branch information
Charlie Loyd committed Jan 29, 2013
1 parent e08a732 commit b94987b
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions pxpack.py
@@ -1,6 +1,10 @@
#!/usr/bin/env python

from numpy import uint32 #, binary_repr
'''
Pack a pixel into 32 bits with its quality in the high bits.
'''

from numpy import uint32
from qp import qp

x8 = uint32(8)
Expand All @@ -26,14 +30,3 @@ def unpack(i):
g = (i >> x8) & xff
b = i & xff
return (r, g, b)

'''
for i in range(1000000):
t = (i%256, (i+23)%256, (i+199)%256)
p = pack(t)
#print bin(int(p))
#print binary_repr(p, width=32)
u = unpack(p)
if t != u:
print t, u
'''

0 comments on commit b94987b

Please sign in to comment.