INNER CODE UNIT · Python

dropLastNumber

Hykudoru/Pescado-Engine-Embedded-ESP32S3 · lib/TFT_eSPI-2.5.34/Tools/bmp2array4bit/bmp2array4bit.py:203

dropLastNumber = True #(width % 4) == 2 or (width % 4) == 1
paddedWidth = int(math.ceil(bitsPerPixel * width / 32.0) * 4)
debugOut("array range is {} {} len(contents) is {} paddedWidth is {} width is {}".format(offset[0], fileSize[0], len(contents), paddedWidth, width))

r = 0
width = int(width / 2)
#for i in range(offset[0], fileSize[0]):                 # close but image is upside down.  Each row is correct but need to swap columns.
#for i in range(fileSize[0], offset[0], -1):

for col in range(height-1, -1, -1):
    i = 0
    for row in range(width):
        colorCode1 = contents[row + col*paddedWidth + offset[0]]  

        if r > 0 and r % width == 0:
            i = 0
            outputString += '\n\n'
        elif (i + 1) % 12 == 0 :

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…