[Horus] GUI continued - #3159

[GVars] Refactoring continued - #3185
This commit is contained in:
Bertrand Songis
2016-01-14 07:41:30 +01:00
parent 43b84385d8
commit e8aaa67450
105 changed files with 4033 additions and 3026 deletions
-1
View File
@@ -36,7 +36,6 @@ make -j2 gtests
rm -rf *
cmake -DCMAKE_BUILD_TYPE=Debug -DPCB=HORUS -DHELI=NO -DUSB=SERIAL -DCLI=YES -DDEBUG=YES ..
make -j2 firmware.bin
cmake -DCMAKE_BUILD_TYPE=Debug -DPCB=HORUS -DHELI=NO -DUSB=SERIAL -DCLI=NO -DDEBUG=YES ..
make -j2 simu
#make gtests
#./gtests
+10 -2
View File
@@ -48,6 +48,15 @@ with open(sys.argv[2], "w") as f:
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":
colors = []
writeSize(f, width, height)
for y in range(height):
for x in range(width):
pixel = image.pixel(x, y)
val = ((Qt.qRed(pixel) >> 3) << 11) + ((Qt.qGreen(pixel) >> 2) << 5) + ((Qt.qBlue(pixel) >> 3) << 0)
f.write("%d,%d," % (val % 256, val // 256))
f.write("\n")
elif what == "5/6/5/8":
colors = []
writeSize(f, width, height)
@@ -55,8 +64,7 @@ with open(sys.argv[2], "w") as f:
for x in range(width):
pixel = image.pixel(x, y)
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("%d,%d," % (val % 256, val // 256))
f.write("%d,%d,%d," % (val % 256, val // 256, Qt.qAlpha(pixel)))
f.write("\n")
elif what == "4bits":
colors = []