[Horus] Next round of screen changes + refactoring
This commit is contained in:
@@ -44,13 +44,14 @@ elif what == "4/4/4/4":
|
||||
pixel = image.pixel(x, y)
|
||||
f.write("0x%1x%1x%1x%1x," % (Qt.qAlpha(pixel)/16, Qt.qRed(pixel)/16, Qt.qGreen(pixel)/16, Qt.qBlue(pixel)/16))
|
||||
f.write("\n")
|
||||
elif what == "5/6/5":
|
||||
elif what == "5/6/5/8":
|
||||
colors = []
|
||||
f.write("%d,%d,\n" % (width, height))
|
||||
writeSize(f, width, height)
|
||||
for y in range(height):
|
||||
for x in range(width):
|
||||
pixel = image.pixel(x, y)
|
||||
f.write("0x%04x," % (((Qt.qRed(pixel) >> 3) << 11) + ((Qt.qGreen(pixel) >> 2) << 5) + ((Qt.qBlue(pixel) >> 3) << 0)))
|
||||
val = ((Qt.qRed(pixel) >> 3) << 11) + ((Qt.qGreen(pixel) >> 2) << 5) + ((Qt.qBlue(pixel) >> 3) << 0)
|
||||
f.write("%d,%d,%d," % (val%256, val/256, Qt.qAlpha(pixel) >> 4))
|
||||
f.write("\n")
|
||||
elif what == "4bits":
|
||||
colors = []
|
||||
|
||||
Reference in New Issue
Block a user