@@ -138,16 +138,16 @@ def writeByte(n):
138138
139139 if image .bph > numLEDs : numLEDs = image .bph
140140
141- print "// Don't edit this file! It's software-generated."
142- print "// See convert.py script instead."
143- print
144- print "#define PALETTE1 0"
145- print "#define PALETTE4 1"
146- print "#define PALETTE8 2"
147- print "#define TRUECOLOR 3"
148- print
149- print "#define NUM_LEDS %d" % numLEDs
150- print
141+ print ( "// Don't edit this file! It's software-generated." )
142+ print ( "// See convert.py script instead." )
143+ print ()
144+ print ( "#define PALETTE1 0" )
145+ print ( "#define PALETTE4 1" )
146+ print ( "#define PALETTE8 2" )
147+ print ( "#define TRUECOLOR 3" )
148+ print ()
149+ print ( "#define NUM_LEDS %d" % numLEDs )
150+ print ()
151151
152152# Second pass estimates current of each column, then peak & overall average
153153
@@ -221,9 +221,9 @@ def writeByte(n):
221221 int (pow ((lut [i ][0 ]/ 255.0 ),gamma )* bR1 + 0.5 ),
222222 int (pow ((lut [i ][1 ]/ 255.0 ),gamma )* bG1 + 0.5 ),
223223 int (pow ((lut [i ][2 ]/ 255.0 ),gamma )* bB1 + 0.5 )))
224- if i < (image .numColors - 1 ): print ","
225- print " };"
226- print
224+ if i < (image .numColors - 1 ): print ( "," )
225+ print ( " };" )
226+ print ()
227227
228228 sys .stdout .write (
229229 "const uint8_t PROGMEM pixels%02d[] = {" % imgNum )
@@ -299,19 +299,19 @@ def writeByte(n):
299299 writeByte (0 )
300300 writeByte (0 )
301301
302- print " };" # end pixels[] array
303- print
302+ print ( " };" ) # end pixels[] array
303+ print ()
304304
305305# Last pass, print table of images...
306306
307- print "typedef struct {"
308- print " uint8_t type; // PALETTE[1,4,8] or TRUECOLOR"
309- print " line_t lines; // Length of image (in scanlines)"
310- print " const uint8_t *palette; // -> PROGMEM color table (NULL if truecolor)"
311- print " const uint8_t *pixels; // -> Pixel data in PROGMEM"
312- print "} image;"
313- print
314- print "const image PROGMEM images[] = {"
307+ print ( "typedef struct {" )
308+ print ( " uint8_t type; // PALETTE[1,4,8] or TRUECOLOR" )
309+ print ( " line_t lines; // Length of image (in scanlines" )
310+ print ( " const uint8_t *palette; // -> PROGMEM color table (NULL if truecolor" )
311+ print ( " const uint8_t *pixels; // -> Pixel data in PROGMEM" )
312+ print ( "} image;" )
313+ print ()
314+ print ( "const image PROGMEM images[] = {" )
315315
316316for imgNum , image in enumerate (images ): # For each image in list...
317317 sys .stdout .write (" { " )
@@ -338,6 +338,6 @@ def writeByte(n):
338338 else :
339339 print
340340
341- print "};"
342- print
343- print "#define NUM_IMAGES (sizeof(images) / sizeof(images[0]))"
341+ print ( "};" )
342+ print ()
343+ print ( "#define NUM_IMAGES (sizeof(images) / sizeof(images[0]))" )
0 commit comments