mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-07-28 17:10:02 +03:00
Added type hints
This commit is contained in:
parent
7ebfb871d0
commit
79b753c87e
|
@ -141,10 +141,10 @@ class QoiEncoder(ImageFile.PyEncoder):
|
||||||
_previous_pixel: tuple[int, int, int, int] | None = None
|
_previous_pixel: tuple[int, int, int, int] | None = None
|
||||||
_previously_seen_pixels: dict[int, tuple[int, int, int, int]] = {}
|
_previously_seen_pixels: dict[int, tuple[int, int, int, int]] = {}
|
||||||
|
|
||||||
def _write_run(self, run):
|
def _write_run(self, run: int) -> bytes:
|
||||||
return o8(0xC0 | (run - 1)) # QOI_OP_RUN
|
return o8(0xC0 | (run - 1)) # QOI_OP_RUN
|
||||||
|
|
||||||
def _delta(self, left, right):
|
def _delta(self, left: int, right: int) -> int:
|
||||||
result = (left - right) & 0xFF
|
result = (left - right) & 0xFF
|
||||||
if result >= 0x80:
|
if result >= 0x80:
|
||||||
result -= 0x100
|
result -= 0x100
|
||||||
|
|
Loading…
Reference in New Issue
Block a user