-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add some more docstrings and pyi files.
- Loading branch information
1 parent
b7788d8
commit 7272f38
Showing
3 changed files
with
73 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
|
||
from array import array | ||
from collections.abc import Sequence, Iterable | ||
import framebuf | ||
from typing import Any | ||
|
||
from .shapes import ColoredGeometry, Shape, BLIT_KEY_RGB565, point, rectangle | ||
|
||
|
||
class Bitmaps(Shape): | ||
"""Draw framebuffer bitmaps at points""" | ||
|
||
def __init__( | ||
self, | ||
geometry: Iterable[point], | ||
buffers: Iterable[framebuf.FrameBuffer], | ||
*, | ||
key: int | None = None, | ||
palette: Sequence[int] | None = None, | ||
surface: "tempe.surface.Surface | None" = None, | ||
clip: rectangle | None = None, | ||
): ... | ||
|
||
def update( | ||
self, | ||
geometry: Iterable[point] | None = None, | ||
buffers: Iterable[framebuf.FrameBuffer] | None = None, | ||
**kwargs: Any, | ||
): ... | ||
|
||
def __iter__(self) -> tuple[point, framebuf.FrameBuffer]: ... | ||
|
||
|
||
class ColoredBitmaps(ColoredGeometry[point]): | ||
"""Draw 1-bit framebuffers bitmaps at points in given colors.""" | ||
|
||
def __init__( | ||
self, | ||
geometry: Iterable[point], | ||
colors: Iterable[int], | ||
buffers: Iterable[framebuf.FrameBuffer], | ||
*, | ||
surface: "tempe.surface.Surface | None" = None, | ||
clip: rectangle | None = None, | ||
): ... | ||
|
||
def update( | ||
self, | ||
geometry: Iterable[point] | None = None, | ||
colors: Iterable[int] | None = None, | ||
buffers: Iterable[framebuf.FrameBuffer] | None = None, | ||
**kwargs: Any, | ||
): ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
# SPDX-FileCopyrightText: 2024-present Unital Software <[email protected]> | ||
# | ||
# SPDX-License-Identifier: MIT | ||
|
||
|
||
class Display: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,16 @@ | ||
# SPDX-FileCopyrightText: 2024-present Unital Software <[email protected]> | ||
# | ||
# SPDX-License-Identifier: MIT | ||
|
||
"""Base Display class and FileDisplay class. | ||
This module defines the Display abstract base class as well as a concrete | ||
implementation that renders to a binary file. | ||
Users of specific hardware may need to define their own subclasses that | ||
can send updates to the underlying device. | ||
""" | ||
|
||
from array import array | ||
from typing import Self | ||
|
||
|
@@ -10,6 +23,10 @@ class Display: | |
The array buffer must match the width and height, and the edges | ||
of the bounding rectangle should lie within the Display. | ||
Concrete subclasses must implement this method, either to | ||
directly render partial updates to the underlying device, or to | ||
render to a complete framebuffer which is then rendered. | ||
""" | ||
raise NotImplementedError | ||
|
||
|