[X10] New radio supported!
This commit is contained in:
Bertrand Songis
2017-02-04 10:42:50 +01:00
committed by GitHub
parent ebee591990
commit 40ece81de2
79 changed files with 1947 additions and 1370 deletions
+20
View File
@@ -53,6 +53,16 @@ with open(sys.argv[2], "w") as f:
values.append(str(val))
f.write("const uint16_t __%s[] __ALIGNED = { %s };\n" % (constant, ",".join(values)))
f.write("const Bitmap %s(BMP_ARGB4444, %d, %d, __%s);\n" % (constant, width, height, constant))
elif what == "4/4/4/4-R":
constant = sys.argv[2].upper()[:-4]
values = []
for y in range(height):
for x in range(width):
pixel = image.pixel(width-x-1, height-y-1)
val = ((Qt.qAlpha(pixel) // 16) << 12) + ((Qt.qRed(pixel) // 16) << 8) + ((Qt.qGreen(pixel) // 16) << 4) + ((Qt.qBlue(pixel) // 16) << 0)
values.append(str(val))
f.write("const uint16_t __%s[] __ALIGNED = { %s };\n" % (constant, ",".join(values)))
f.write("const Bitmap %s(BMP_ARGB4444, %d, %d, __%s);\n" % (constant, width, height, constant))
elif what == "5/6/5":
constant = sys.argv[2].upper()[:-4]
values = []
@@ -63,6 +73,16 @@ with open(sys.argv[2], "w") as f:
values.append(str(val))
f.write("const uint16_t __%s[] __ALIGNED = { %s };\n" % (constant, ",".join(values)))
f.write("const Bitmap %s(BMP_RGB565, %d, %d, __%s);\n" % (constant, width, height, constant))
elif what == "5/6/5-R":
constant = sys.argv[2].upper()[:-4]
values = []
for y in range(height):
for x in range(width):
pixel = image.pixel(width-x-1, height-y-1)
val = ((Qt.qRed(pixel) >> 3) << 11) + ((Qt.qGreen(pixel) >> 2) << 5) + ((Qt.qBlue(pixel) >> 3) << 0)
values.append(str(val))
f.write("const uint16_t __%s[] __ALIGNED = { %s };\n" % (constant, ",".join(values)))
f.write("const Bitmap %s(BMP_RGB565, %d, %d, __%s);\n" % (constant, width, height, constant))
elif what == "5/6/5/8":
colors = []
writeSize(f, width, height)