@@ -216,6 +216,7 @@ def process(self, input_filename, output_filename, rows,
216216 # Operation performed later requires a list, not a bytearray.
217217 # Make a copy, keeping the same values.
218218# dotstar_list = list(dotstar_buffer)
219+ #reorder = [0] * dotstar_row_size
219220
220221 # Output rows are held in RAM and periodically written,
221222 # marginally faster than writing each row separately.
@@ -250,6 +251,7 @@ def process(self, input_filename, output_filename, rows,
250251 # Constrain bytes-to-read to pixel strip length
251252 clipped_width = min (self .bmp_specs .width , self .num_pixels )
252253 row_bytes = 3 * clipped_width
254+ # Compute reorder list here (needs row bytes to work)
253255
254256 # Each output row is interpolated from two BMP rows,
255257 # we'll call them 'a' and 'b' here.
@@ -263,6 +265,7 @@ def process(self, input_filename, output_filename, rows,
263265 # I'm sure there's better ways but have a headache.
264266 # This is ONLY needed if using the first of two
265267 # benchmarked methods later (or something similar to it).
268+ # There's really only six possible orders, I could make a list
266269# if self.blue_index is 0: # BXX DotStar
267270# offset_0 = 0 # DotStar byte 0 is BMP byte 0 (B)
268271# if self.green_index is 1: # BGR
@@ -424,6 +427,17 @@ def process(self, input_filename, output_filename, rows,
424427 # has a negative effect on ulab performance, maybe
425428 # memory-management related?
426429
430+ # And a third, using a reordering table...
431+ # This doesn't actually work yet because the
432+ # reorder table hasn't been computed.
433+ # Two extra items (0 and 255) are appended for
434+ # use by headers/footers/etc. Can't directly append
435+ # to ndarray, so we bytearray-ify it first.
436+ #got = bytearray(got) + bytearray([0, 255])
437+ #output_buffer[output_position:output_position +
438+ # dotstar_row_size] = bytearray(
439+ # got[i] for i in reorder)
440+
427441 time3 += (monotonic () - row_start_time )
428442
429443 # Add converted data to output buffer.
0 commit comments