add utilities to turn bitmap to code
This commit is contained in:
parent
e47cb00e40
commit
b925142da1
|
@ -0,0 +1,12 @@
|
||||||
|
import sys
|
||||||
|
|
||||||
|
print "5 HGR : HCOLOR=3"
|
||||||
|
num = 10
|
||||||
|
row = 0
|
||||||
|
for line in sys.stdin:
|
||||||
|
for b in xrange(0, 40):
|
||||||
|
if line[b * 2] == '*':
|
||||||
|
print "%d HPLOT %d, %d" % (num, b, row)
|
||||||
|
num += 10
|
||||||
|
row += 1
|
||||||
|
|
|
@ -0,0 +1,29 @@
|
||||||
|
import sys
|
||||||
|
|
||||||
|
maxwidth = 0
|
||||||
|
|
||||||
|
print "unsigned char bitmap[] = {"
|
||||||
|
|
||||||
|
for line in sys.stdin:
|
||||||
|
bit = 0
|
||||||
|
width = 0
|
||||||
|
|
||||||
|
for b in xrange(0, 40):
|
||||||
|
if line[b * 2] == '*':
|
||||||
|
print "255,",
|
||||||
|
else:
|
||||||
|
print "0,",
|
||||||
|
|
||||||
|
width += 1
|
||||||
|
bit += 1
|
||||||
|
|
||||||
|
if False and bit == 7:
|
||||||
|
print "255,",
|
||||||
|
width += 1
|
||||||
|
bit = 0
|
||||||
|
|
||||||
|
maxwidth = max(width, maxwidth)
|
||||||
|
print "// %d, %d" % ( width, bit)
|
||||||
|
|
||||||
|
print "};"
|
||||||
|
print "// width = %d" % maxwidth
|
Loading…
Reference in New Issue