Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions adafruit_imageload/bmp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ def load(

Returns tuple of bitmap object and palette object.

:param io.BufferedReader file: Open file handle or compatible (like `io.BytesIO`)
with the data of a BMP file.
:param object bitmap: Type to store bitmap data. Must have API similar to `displayio.Bitmap`.
Will be skipped if None
:param object palette: Type to store the palette. Must have API similar to
Expand Down
7 changes: 4 additions & 3 deletions adafruit_imageload/gif.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,12 @@ def load(

Returns tuple of bitmap object and palette object.

:param BufferedReader file: The *.gif file being loaded
:param io.BufferedReader file: Open file handle or compatible (like `io.BytesIO`)
with the data of a GIF file.
:param object bitmap: Type to store bitmap data. Must have API similar to `displayio.Bitmap`.
Will be skipped if None
:param object palette: Type to store the palette. Must have API similar to
`displayio.Palette`. Will be skipped if None"""
`displayio.Palette`. Will be skipped if None.
"""
header = file.read(6)
if header not in {b"GIF87a", b"GIF89a"}:
raise ValueError("Not a GIF file")
Expand Down
6 changes: 4 additions & 2 deletions adafruit_imageload/png.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,16 @@ def load(
) -> Tuple[Bitmap, Optional[Palette]]:
"""
Loads a PNG image from the open ``file``.
Only supports indexed color images.

Returns tuple of bitmap object and palette object.

:param file: The *.png file being loaded
:param io.BufferedReader file: Open file handle or compatible (like `io.BytesIO`)
with the data of a PNG file.
:param object bitmap: Type to store bitmap data. Must have API similar to
`displayio.Bitmap`.
:param object palette: Type to store the palette. Must have API similar to
`displayio.Palette`. Will be skipped if None
`displayio.Palette`. Will be skipped if None.
"""
# pylint: disable=too-many-locals,too-many-branches
header = file.read(8)
Expand Down
6 changes: 6 additions & 0 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,11 @@
.. automodule:: adafruit_imageload.bmp.indexed
:members:

.. automodule:: adafruit_imageload.gif
:members:

.. automodule:: adafruit_imageload.png
:members:

.. automodule:: adafruit_imageload.tilegrid_inflator
:members: