Skip to content

Commit bd358db

Browse files
authored
Merge pull request #33 from FoamyGuy/pil_additions
pil additions
2 parents e54126d + c859532 commit bd358db

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

circuitpython_typing/pil.py

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* Author(s): Alec Delaney
1212
"""
1313

14-
from typing import Tuple
14+
from typing import Tuple, Optional, Callable
1515
from typing_extensions import Protocol # Safety import for Python 3.7
1616

1717

@@ -26,6 +26,7 @@ def __getitem__(self, xy: Tuple[int, int]) -> int:
2626
class Image(Protocol):
2727
"""Type annotation for PIL's Image class"""
2828

29+
# pylint: disable=too-many-arguments,invalid-name
2930
@property
3031
def mode(self) -> str:
3132
"""The mode of the image"""
@@ -36,3 +37,27 @@ def size(self) -> Tuple[int, int]:
3637

3738
def load(self) -> PixelAccess:
3839
"""Load the image for quick pixel access"""
40+
41+
def convert(
42+
self,
43+
mode: str,
44+
matrix: Optional[Tuple],
45+
dither: Callable,
46+
palette: int,
47+
colors: int,
48+
):
49+
"""Returns a converted copy of this image."""
50+
51+
def rotate(
52+
self,
53+
angle: int,
54+
resampling,
55+
expand: int,
56+
center: Tuple[int, int],
57+
translate: Tuple[int, int],
58+
fillcolor: int,
59+
):
60+
"""Returns a rotated copy of this image."""
61+
62+
def getpixel(self, xy: Tuple[int, int]):
63+
"""Returns the pixel value at a given position."""

0 commit comments

Comments
 (0)