Skip to content

Commit d5811bf

Browse files
authored
Merge pull request #11 from lesamouraipourpre/ondiskbitmap-changes
Update the pixel_shader usage of OnDiskBitmap
2 parents b37e709 + f941d45 commit d5811bf

File tree

3 files changed

+19
-5
lines changed

3 files changed

+19
-5
lines changed

README.rst

Lines changed: 7 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-il0398/>`_. To install for current user:
@@ -92,7 +90,13 @@ Usage Example
9290
f = open("/display-ruler.bmp", "rb")
9391
9492
pic = displayio.OnDiskBitmap(f)
95-
t = displayio.TileGrid(pic, pixel_shader=displayio.ColorConverter())
93+
# CircuitPython 6 & 7 compatible
94+
t = displayio.TileGrid(
95+
pic, pixel_shader=getattr(pic, "pixel_shader", displayio.ColorConverter())
96+
)
97+
# CircuitPython 7 compatible only
98+
# t = displayio.TileGrid(pic, pixel_shader=pic.pixel_shader)
99+
96100
g.append(t)
97101
98102
display.show(g)

examples/il0398_4.2_color.py

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

4444
with open("/display-ruler.bmp", "rb") as f:
4545
pic = displayio.OnDiskBitmap(f)
46-
t = displayio.TileGrid(pic, pixel_shader=displayio.ColorConverter())
46+
# CircuitPython 6 & 7 compatible
47+
t = displayio.TileGrid(
48+
pic, pixel_shader=getattr(pic, "pixel_shader", displayio.ColorConverter())
49+
)
50+
# CircuitPython 7 compatible only
51+
# t = displayio.TileGrid(pic, pixel_shader=pic.pixel_shader)
4752
g.append(t)
4853

4954
display.show(g)

examples/il0398_simpletest.py

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

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

4247
display.show(g)

0 commit comments

Comments
 (0)