Skip to content

Commit e164c68

Browse files
authored
Merge pull request #10 from lesamouraipourpre/ondiskbitmap-changes
Update the pixel_shader usage of OnDiskBitmap
2 parents edc7713 + 11db8c8 commit e164c68

File tree

3 files changed

+18
-5
lines changed

3 files changed

+18
-5
lines changed

README.rst

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ This is easily achieved by downloading
2828

2929
Installing from PyPI
3030
=====================
31-
.. note:: This library is not available on PyPI yet. Install documentation is included
32-
as a standard element. Stay tuned for PyPI availability!
3331

3432
On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally `from
3533
PyPI <https://pypi.org/project/adafruit-circuitpython-ssd1675/>`_. To install for current user:
@@ -86,7 +84,12 @@ Usage Example
8684
f = open("/display-ruler.bmp", "rb")
8785
8886
pic = displayio.OnDiskBitmap(f)
89-
t = displayio.TileGrid(pic, pixel_shader=displayio.ColorConverter())
87+
# CircuitPython 6 & 7 compatible
88+
t = displayio.TileGrid(
89+
pic, pixel_shader=getattr(pic, "pixel_shader", displayio.ColorConverter())
90+
)
91+
# CircuitPython 7 compatible only
92+
# t = displayio.TileGrid(pic, pixel_shader=pic.pixel_shader)
9093
g.append(t)
9194
9295
display.show(g)

examples/ssd1675_2.13_monochrome.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,12 @@
3535

3636
with open("/display-ruler.bmp", "rb") as f:
3737
pic = displayio.OnDiskBitmap(f)
38-
t = displayio.TileGrid(pic, pixel_shader=displayio.ColorConverter())
38+
# CircuitPython 6 & 7 compatible
39+
t = displayio.TileGrid(
40+
pic, pixel_shader=getattr(pic, "pixel_shader", displayio.ColorConverter())
41+
)
42+
# CircuitPython 7 compatible only
43+
# t = displayio.TileGrid(pic, pixel_shader=pic.pixel_shader)
3944
g.append(t)
4045

4146
display.show(g)

examples/ssd1675_simpletest.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,12 @@
2929

3030
with open("/display-ruler.bmp", "rb") as f:
3131
pic = displayio.OnDiskBitmap(f)
32-
t = displayio.TileGrid(pic, pixel_shader=displayio.ColorConverter())
32+
# CircuitPython 6 & 7 compatible
33+
t = displayio.TileGrid(
34+
pic, pixel_shader=getattr(pic, "pixel_shader", displayio.ColorConverter())
35+
)
36+
# CircuitPython 7 compatible only
37+
# t = displayio.TileGrid(pic, pixel_shader=pic.pixel_shader)
3338
g.append(t)
3439

3540
display.show(g)

0 commit comments

Comments
 (0)