From 6bdfb02bd851bd2e64268a2efa054f0301b91bd5 Mon Sep 17 00:00:00 2001 From: sandr0 Date: Sun, 12 Jan 2025 22:08:00 +0100 Subject: [PATCH] reverted some changes which were intended for local use only --- gfx/pacman.png | Bin 746 -> 0 bytes lednamebadge.py | 39 +-------------------------------------- 2 files changed, 1 insertion(+), 38 deletions(-) delete mode 100644 gfx/pacman.png diff --git a/gfx/pacman.png b/gfx/pacman.png deleted file mode 100644 index 41c2bb8c6e3731f31d46b7bf4e269047c77ef4cf..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 746 zcmV0003YX+uL$Nkc;* zaB^>EX>4Tx04R~2kg-a`P!xv0R%u1+q&SE}2G@>ea7;y0+l6 zE8C4e@AYwCDf>!OMou 127: bit_val = 1 << (7 - bit) byte_val += bit_val buf.append(byte_val) im.close() return buf, cols - @staticmethod - def bitmap_bits(rows: list[int], bits: int): - """ - Use with somethin like - [ - 0b11001100110011001100110011001100110011001100, - 0b11001100110011001100110011001100110011001100, - 0b00110011001100110011001100110011001100110011, - 0b00110011001100110011001100110011001100110011, - 0b11001100110011001100110011001100110011001100, - 0b11001100110011001100110011001100110011001100, - 0b00110011001100110011001100110011001100110011, - 0b00110011001100110011001100110011001100110011, - 0b11001100110011001100110011001100110011001100, - 0b11001100110011001100110011001100110011001100, - 0b00110011001100110011001100110011001100110011, - ] - - as an alternative to a PNG. - """ - buf = array('B') - assert len(rows) == 11 - - cols = (bits + 7) // 8 - for col in range(cols): - for row in range(11): # [0..10] - byte_val = 0 - for bit in range(8): # [0..7] - bit_val = 0 - x = 8 * col + bit - if x < bits: - pixel_color = ((rows[row] >> (bits - 1 - x)) & 1) << (7 - bit) - byte_val += pixel_color - buf.append(byte_val) - - return buf, cols - def bitmap(self, arg): """If arg is a valid and existing path name, we load it as an image. Otherwise, we take it as a string (with ":"-notation, see bitmap_text()).