-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
_imaging.pyi
30 lines (26 loc) · 1.23 KB
/
_imaging.pyi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
from _typeshed import Incomplete
from collections.abc import Sequence
from typing import Protocol
from typing_extensions import Literal
DEFAULT_STRATEGY: Literal[0]
FILTERED: Literal[1]
HUFFMAN_ONLY: Literal[2]
RLE: Literal[3]
FIXED: Literal[4]
class _PixelAccessor(Protocol): # noqa: Y046
# PIL has two concrete types for accessing an image's pixels by coordinate lookup:
# PixelAccess (written in C; not runtime-importable) and PyAccess (written in
# Python + cffi; is runtime-importable). PixelAccess came first. PyAccess was added
# in later to support PyPy, but otherwise is intended to expose the same interface
# PixelAccess.
#
# This protocol describes that interface.
# TODO: should the color args and getter return types be _Color?
def __setitem__(self, xy: tuple[int, int], color: Incomplete) -> None: ...
def __getitem__(self, xy: tuple[int, int]) -> Incomplete: ...
def putpixel(self, xy: tuple[int, int], color: Incomplete) -> None: ...
def getpixel(self, xy: tuple[int, int]) -> Incomplete: ...
class _Path:
def __getattr__(self, item: str) -> Incomplete: ...
def path(__x: Sequence[tuple[float, float]] | Sequence[float]) -> _Path: ...
def __getattr__(__name: str) -> Incomplete: ...