Skip to content

Commit c1df2a6

Browse files
committed
remove unused functions
1 parent 5f6acbb commit c1df2a6

File tree

1 file changed

+0
-50
lines changed

1 file changed

+0
-50
lines changed

adafruit_bitmapsaver.py

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -81,56 +81,6 @@ def _rgb565_to_bgr_tuple(color: int) -> Tuple[int, int, int]:
8181
return blue, green, red
8282

8383

84-
def rgb565_unpack(packed_rgb: int) -> tuple[int, int, int]:
85-
"""
86-
Convert an int representing a hex rgb565 color into a tuple
87-
of it's r, g, and b values.
88-
:param packed_rgb: rgb565 color value as an int
89-
:return: Tuple with r, g, and b values
90-
"""
91-
r = (packed_rgb >> 11) & 0x1F
92-
g = (packed_rgb >> 5) & 0x3F
93-
b = packed_rgb & 0x1F
94-
return (r, g, b)
95-
96-
97-
def rgb565_pack(r: int, g: int, b: int) -> int:
98-
"""
99-
Convert a tuple with r, g, and b values into an rgb565
100-
color value represented as an integer
101-
:param r: red value
102-
:param g: green value
103-
:param b: blue value
104-
:return int: rgb565 value
105-
"""
106-
return ((r & 0x1F) << 11) | ((g & 0x3F) << 5) | (b & 0x1F)
107-
108-
109-
def rgb888_unpack(packed_rgb: int) -> Tuple[int, int, int]:
110-
"""
111-
Convert an int representing an rgb888 color value into a
112-
tuple containing it's r, g, and b values.
113-
:param packed_rgb: rgb888 integer color value
114-
:return: Tuple containing r, g, and b values
115-
"""
116-
r = (packed_rgb >> 16) & 0xFF
117-
g = (packed_rgb >> 8) & 0xFF
118-
b = packed_rgb & 0xFF
119-
return (r, g, b)
120-
121-
122-
def rgb888_pack(r, g, b):
123-
"""
124-
Convert a tuple with r, g, and b values into an rgb888
125-
color value represented as an integer
126-
:param r: red value
127-
:param g: green value
128-
:param b: blue value
129-
:return int: rgb888 value
130-
"""
131-
return ((r & 0xFF) << 16) | ((g & 0xFF) << 8) | (b & 0xFF)
132-
133-
13484
def rgb565_to_rgb888(rgb565):
13585
"""
13686
Convert from an integer representing rgb565 color into an integer

0 commit comments

Comments
 (0)