mirror of
https://github.com/eried/portapack-mayhem.git
synced 2024-12-23 14:29:23 -05:00
Update generate_world_map.bin.py (#640)
Use bytes instead of strings to write ADSB map binary for python3
This commit is contained in:
parent
de1570d8af
commit
6c5f8a38e0
@ -36,7 +36,7 @@ outfile.write(struct.pack('H', im.size[1]))
|
||||
print("Generating: \t" + outfile.name + "\n from\t\t" + im.filename + "\n please wait...");
|
||||
|
||||
for y in range (0, im.size[1]):
|
||||
line = ''
|
||||
line = b''
|
||||
for x in range (0, im.size[0]):
|
||||
# RRRRRGGGGGGBBBBB
|
||||
pixel_lcd = (pix[x, y][0] >> 3) << 11
|
||||
@ -47,8 +47,8 @@ for y in range (0, im.size[1]):
|
||||
# pixel_lcd = (pix[x, y][0] >> 5) << 5
|
||||
# pixel_lcd |= (pix[x, y][1] >> 5) << 2
|
||||
# pixel_lcd |= (pix[x, y][2] >> 6)
|
||||
line += str(struct.pack('H', pixel_lcd))
|
||||
outfile.write(line.encode('utf-8'))
|
||||
line += struct.pack('H', pixel_lcd)
|
||||
outfile.write(line)
|
||||
print(str(y) + '/' + str(im.size[1]) + '\r', end="")
|
||||
|
||||
print("Ready.");
|
||||
|
Loading…
Reference in New Issue
Block a user