Skip to content

Commit

Permalink
this probably fixes big endian byte order
Browse files Browse the repository at this point in the history
git-svn-id: https://xpra.org/svn/Xpra/trunk@9984 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Jul 20, 2015
1 parent 37d688a commit e0dd3cd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/xpra/codecs/argb/argb.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,9 @@ def unpremultiply_argb(buf):


#precalculate indexes in native endianness:
tmp = str(struct.pack("=BBBB", 0, 1, 2, 3))
tmp = str(struct.pack("=L", 0 + 1*(2**8) + 2*(2**16) + 3*(2**24)))
#little endian will give 0, 1, 2, 3
#big endian should give 3, 2, 1, 0 (untested)
cdef int B = tmp.find('\0')
cdef int G = tmp.find('\1')
cdef int R = tmp.find('\2')
Expand Down

0 comments on commit e0dd3cd

Please sign in to comment.