Add default values for third-party stubs beginning with 'P' (#9957)

This commit is contained in:
Alex Waygood
2023-03-27 18:58:53 +01:00
committed by GitHub
parent 20f9b3685d
commit 6fd7e36e80
248 changed files with 2181 additions and 2133 deletions
+1 -1
View File
@@ -28,7 +28,7 @@ BLP_ALPHA_ENCODING_DXT3: Literal[AlphaEncoding.DXT3]
BLP_ALPHA_ENCODING_DXT5: Literal[AlphaEncoding.DXT5]
def unpack_565(i): ...
def decode_dxt1(data, alpha: bool = ...): ...
def decode_dxt1(data, alpha: bool = False): ...
def decode_dxt3(data): ...
def decode_dxt5(data): ...
+2 -2
View File
@@ -7,8 +7,8 @@ class ContainerIO:
length: Any
def __init__(self, file, offset, length) -> None: ...
def isatty(self): ...
def seek(self, offset, mode=...) -> None: ...
def seek(self, offset, mode=0) -> None: ...
def tell(self): ...
def read(self, n: int = ...): ...
def read(self, n: int = 0): ...
def readline(self): ...
def readlines(self): ...
+3 -3
View File
@@ -8,13 +8,13 @@ field: Any
gs_windows_binary: Any
def has_ghostscript(): ...
def Ghostscript(tile, size, fp, scale: int = ..., transparency: bool = ...): ...
def Ghostscript(tile, size, fp, scale: int = 1, transparency: bool = False): ...
class PSFile:
fp: Any
char: Any
def __init__(self, fp) -> None: ...
def seek(self, offset, whence=...) -> None: ...
def seek(self, offset, whence=0) -> None: ...
def readline(self): ...
class EpsImageFile(ImageFile):
@@ -24,5 +24,5 @@ class EpsImageFile(ImageFile):
im: Any
mode: Any
tile: Any
def load(self, scale: int = ..., transparency: bool = ...) -> None: ...
def load(self, scale: int = 1, transparency: bool = False) -> None: ...
def load_seek(self, *args, **kwargs) -> None: ...
+1 -1
View File
@@ -7,4 +7,4 @@ class GdImageFile(ImageFile):
format: ClassVar[Literal["GD"]]
format_description: ClassVar[str]
def open(fp, mode: str = ...): ...
def open(fp, mode: str = "r"): ...
+2 -2
View File
@@ -20,5 +20,5 @@ class GifImageFile(ImageFile):
RAWMODE: Any
def get_interlace(im): ...
def getheader(im, palette: Incomplete | None = ..., info: Incomplete | None = ...): ...
def getdata(im, offset=..., **params): ...
def getheader(im, palette: Incomplete | None = None, info: Incomplete | None = None): ...
def getdata(im, offset=(0, 0), **params): ...
+1 -1
View File
@@ -12,7 +12,7 @@ SEGMENTS: Any
class GradientFile:
gradient: Any
def getpalette(self, entries: int = ...): ...
def getpalette(self, entries: int = 256): ...
class GimpGradientFile(GradientFile):
gradient: Any
+1 -1
View File
@@ -21,7 +21,7 @@ class IcnsFile:
def itersizes(self): ...
def bestsize(self): ...
def dataforsize(self, size): ...
def getimage(self, size: Incomplete | None = ...): ...
def getimage(self, size: Incomplete | None = None): ...
class IcnsImageFile(ImageFile):
format: ClassVar[Literal["ICNS"]]
+2 -2
View File
@@ -9,8 +9,8 @@ class IcoFile:
nb_items: Any
def __init__(self, buf): ...
def sizes(self): ...
def getentryindex(self, size, bpp: bool = ...): ...
def getimage(self, size, bpp: bool = ...): ...
def getentryindex(self, size, bpp: bool = False): ...
def getimage(self, size, bpp: bool = False): ...
def frame(self, idx): ...
class IcoImageFile(ImageFile):
+43 -43
View File
@@ -177,74 +177,74 @@ class Image:
def __eq__(self, other: object) -> bool: ...
def __getstate__(self) -> _ImageState: ...
def __setstate__(self, state: _ImageState) -> None: ...
def tobytes(self, encoder_name: str = ..., *args) -> bytes: ...
def tobitmap(self, name: str = ...) -> bytes: ...
def frombytes(self, data: bytes, decoder_name: str = ..., *args) -> None: ...
def tobytes(self, encoder_name: str = "raw", *args) -> bytes: ...
def tobitmap(self, name: str = "image") -> bytes: ...
def frombytes(self, data: bytes, decoder_name: str = "raw", *args) -> None: ...
def load(self) -> None: ...
def verify(self) -> None: ...
def convert(
self,
mode: _Mode | None = ...,
matrix: _ConversionMatrix | None = ...,
dither: int | None = ...,
mode: _Mode | None = None,
matrix: _ConversionMatrix | None = None,
dither: int | None = None,
palette: Palette | Literal[0, 1] = ...,
colors: int = ...,
colors: int = 256,
) -> Image: ...
def quantize(
self,
colors: int = ...,
method: Quantize | Literal[0, 1, 2, 3] | None = ...,
kmeans: int = ...,
palette: Image | None = ...,
colors: int = 256,
method: Quantize | Literal[0, 1, 2, 3] | None = None,
kmeans: int = 0,
palette: Image | None = None,
dither: int = ...,
) -> Image: ...
def copy(self) -> Image: ...
__copy__ = copy
def crop(self, box: _Box | None = ...) -> Image: ...
def crop(self, box: _Box | None = None) -> Image: ...
def draft(self, mode: _Mode, size: _Size) -> None: ...
def filter(self, filter: Filter | Callable[[], Filter]) -> Image: ...
def getbands(self) -> tuple[str, ...]: ...
def getbbox(self) -> tuple[int, int, int, int] | None: ...
def getcolors(self, maxcolors: int = ...) -> list[tuple[int, int]]: ...
def getdata(self, band: int | None = ...): ...
def getcolors(self, maxcolors: int = 256) -> list[tuple[int, int]]: ...
def getdata(self, band: int | None = None): ...
def getextrema(self): ...
def getexif(self) -> Exif: ...
def get_child_images(self) -> list[Image]: ...
def getim(self): ...
def getpalette(self, rawmode: str | None = ...) -> list[int] | None: ...
def getpalette(self, rawmode: str | None = "RGB") -> list[int] | None: ...
def getpixel(self, xy: tuple[int, int]): ...
def getprojection(self) -> tuple[list[int], list[int]]: ...
def histogram(self, mask: Image | None = ..., extrema: tuple[int, int] | tuple[float, float] | None = ...) -> list[int]: ...
def entropy(self, mask: Image | None = ..., extrema: tuple[int, int] | tuple[float, float] | None = ...) -> float: ...
def paste(self, im: Image | _Color, box: tuple[int, int] | _Box | None = ..., mask: Image | None = ...) -> None: ...
def alpha_composite(self, im: Image, dest: tuple[int, int] = ..., source: tuple[int, int] = ...) -> None: ...
def point(self, lut, mode: _Mode | None = ...) -> Image: ...
def histogram(self, mask: Image | None = None, extrema: tuple[int, int] | tuple[float, float] | None = None) -> list[int]: ...
def entropy(self, mask: Image | None = None, extrema: tuple[int, int] | tuple[float, float] | None = None) -> float: ...
def paste(self, im: Image | _Color, box: tuple[int, int] | _Box | None = None, mask: Image | None = None) -> None: ...
def alpha_composite(self, im: Image, dest: tuple[int, int] = (0, 0), source: tuple[int, int] = (0, 0)) -> None: ...
def point(self, lut, mode: _Mode | None = None) -> Image: ...
def putalpha(self, alpha: Image | int) -> None: ...
def putdata(self, data: Sequence[int], scale: float = ..., offset: float = ...) -> None: ...
def putpalette(self, data: ImagePalette | bytes | Iterable[int] | SupportsBytes, rawmode: _Mode | None = ...) -> None: ...
def putdata(self, data: Sequence[int], scale: float = 1.0, offset: float = 0.0) -> None: ...
def putpalette(self, data: ImagePalette | bytes | Iterable[int] | SupportsBytes, rawmode: _Mode | None = "RGB") -> None: ...
def putpixel(self, xy: tuple[int, int], value: _Color | list[float]) -> None: ...
def remap_palette(self, dest_map: Iterable[int], source_palette: Sequence[int] | None = ...) -> Image: ...
def remap_palette(self, dest_map: Iterable[int], source_palette: Sequence[int] | None = None) -> Image: ...
def resize(
self,
size: tuple[int, int],
resample: Resampling | _Resample | None = ...,
box: tuple[float, float, float, float] | None = ...,
reducing_gap: float | None = ...,
resample: Resampling | _Resample | None = None,
box: tuple[float, float, float, float] | None = None,
reducing_gap: float | None = None,
) -> Image: ...
def reduce(self, factor: int | tuple[int, int] | list[int], box: _Box | None = ...) -> Image: ...
def reduce(self, factor: int | tuple[int, int] | list[int], box: _Box | None = None) -> Image: ...
def rotate(
self,
angle: float,
resample: Resampling | _Resample = ...,
expand: bool = ...,
center: tuple[float, float] | None = ...,
translate: tuple[float, float] | None = ...,
fillcolor: _Color | None = ...,
center: tuple[float, float] | None = None,
translate: tuple[float, float] | None = None,
fillcolor: _Color | None = None,
) -> Image: ...
def save(
self,
fp: str | bytes | Path | _Writeable,
format: str | None = ...,
format: str | None = None,
*,
save_all: bool = ...,
bitmap_format: Literal["bmp", "png"] = ..., # for ICO files
@@ -252,19 +252,19 @@ class Image:
**params: Any,
) -> None: ...
def seek(self, frame: int) -> None: ...
def show(self, title: str | None = ...) -> None: ...
def show(self, title: str | None = None) -> None: ...
def split(self) -> tuple[Image, ...]: ...
def getchannel(self, channel: int | str) -> Image: ...
def tell(self) -> int: ...
def thumbnail(self, size: tuple[int, int], resample: Resampling | _Resample = ..., reducing_gap: float = ...) -> None: ...
def thumbnail(self, size: tuple[int, int], resample: Resampling | _Resample = ..., reducing_gap: float = 2.0) -> None: ...
def transform(
self,
size: _Size,
method: Transform | Literal[0, 1, 2, 3, 4],
data=...,
data=None,
resample: Resampling | _Resample = ...,
fill: int = ...,
fillcolor: _Color | int | None = ...,
fill: int = 1,
fillcolor: _Color | int | None = None,
) -> Image: ...
def transpose(self, method: Transpose | Literal[0, 1, 2, 3, 4, 5, 6]) -> Image: ...
def effect_spread(self, distance: int) -> Image: ...
@@ -274,21 +274,21 @@ class Image:
class ImagePointHandler: ...
class ImageTransformHandler: ...
def new(mode: _Mode, size: tuple[int, int], color: _Color = ...) -> Image: ...
def frombytes(mode: _Mode, size: tuple[int, int], data, decoder_name: str = ..., *args) -> Image: ...
def frombuffer(mode: _Mode, size: tuple[int, int], data, decoder_name: str = ..., *args) -> Image: ...
def fromarray(obj, mode: _Mode | None = ...) -> Image: ...
def new(mode: _Mode, size: tuple[int, int], color: _Color = 0) -> Image: ...
def frombytes(mode: _Mode, size: tuple[int, int], data, decoder_name: str = "raw", *args) -> Image: ...
def frombuffer(mode: _Mode, size: tuple[int, int], data, decoder_name: str = "raw", *args) -> Image: ...
def fromarray(obj, mode: _Mode | None = None) -> Image: ...
def fromqimage(im) -> Image: ...
def fromqpixmap(im) -> Image: ...
def open(
fp: str | bytes | Path | SupportsRead[bytes], mode: Literal["r"] = ..., formats: list[str] | tuple[str, ...] | None = ...
fp: str | bytes | Path | SupportsRead[bytes], mode: Literal["r"] = "r", formats: list[str] | tuple[str, ...] | None = None
) -> Image: ...
def alpha_composite(im1: Image, im2: Image) -> Image: ...
def blend(im1: Image, im2: Image, alpha: float) -> Image: ...
def composite(image1: Image, image2: Image, mask: Image) -> Image: ...
def eval(image: Image, *args) -> Image: ...
def merge(mode: _Mode, bands: Sequence[Image]) -> Image: ...
def register_open(id: str, factory, accept=...) -> None: ...
def register_open(id: str, factory, accept=None) -> None: ...
def register_mime(id: str, mimetype: str) -> None: ...
def register_save(id: str, driver) -> None: ...
def register_save_all(id: str, driver) -> None: ...
@@ -304,7 +304,7 @@ def radial_gradient(mode: _Mode) -> Image: ...
class Exif(MutableMapping[int, Any]):
def load(self, data: bytes) -> None: ...
def tobytes(self, offset: int = ...) -> bytes: ...
def tobytes(self, offset: int = 8) -> bytes: ...
def get_ifd(self, tag: int): ...
def hide_offsets(self) -> None: ...
def __len__(self) -> int: ...
+3 -3
View File
@@ -11,8 +11,8 @@ def screen(image1: Image, image2: Image) -> Image: ...
def soft_light(image1: Image, image2: Image) -> Image: ...
def hard_light(image1: Image, image2: Image) -> Image: ...
def overlay(image1: Image, image2: Image) -> Image: ...
def add(image1: Image, image2: Image, scale: float = ..., offset: int = ...) -> Image: ...
def subtract(image1: Image, image2: Image, scale: float = ..., offset: int = ...) -> Image: ...
def add(image1: Image, image2: Image, scale: float = 1.0, offset: int = 0) -> Image: ...
def subtract(image1: Image, image2: Image, scale: float = 1.0, offset: int = 0) -> Image: ...
def add_modulo(image1: Image, image2: Image) -> Image: ...
def subtract_modulo(image1: Image, image2: Image) -> Image: ...
def logical_and(image1: Image, image2: Image) -> Image: ...
@@ -20,4 +20,4 @@ def logical_or(image1: Image, image2: Image) -> Image: ...
def logical_xor(image1: Image, image2: Image) -> Image: ...
def blend(image1: Image, image2: Image, alpha: float) -> Image: ...
def composite(image1: Image, image2: Image, mask: Image) -> Image: ...
def offset(image: Image, xoffset: int, yoffset: int | None = ...) -> Image: ...
def offset(image: Image, xoffset: int, yoffset: int | None = None) -> Image: ...
+11 -11
View File
@@ -47,15 +47,15 @@ class ImageCmsTransform(ImagePointHandler):
input_mode,
output_mode,
intent=...,
proof: Incomplete | None = ...,
proof: Incomplete | None = None,
proof_intent=...,
flags: int = ...,
flags: int = 0,
) -> None: ...
def point(self, im): ...
def apply(self, im, imOut: Incomplete | None = ...): ...
def apply(self, im, imOut: Incomplete | None = None): ...
def apply_in_place(self, im): ...
def get_display_profile(handle: Incomplete | None = ...): ...
def get_display_profile(handle: Incomplete | None = None): ...
class PyCMSError(Exception): ...
@@ -64,21 +64,21 @@ def profileToProfile(
inputProfile,
outputProfile,
renderingIntent=...,
outputMode: Incomplete | None = ...,
inPlace: bool = ...,
flags: int = ...,
outputMode: Incomplete | None = None,
inPlace: bool = False,
flags: int = 0,
): ...
def getOpenProfile(profileFilename): ...
def buildTransform(inputProfile, outputProfile, inMode, outMode, renderingIntent=..., flags: int = ...): ...
def buildTransform(inputProfile, outputProfile, inMode, outMode, renderingIntent=..., flags: int = 0): ...
def buildProofTransform(
inputProfile, outputProfile, proofProfile, inMode, outMode, renderingIntent=..., proofRenderingIntent=..., flags=...
inputProfile, outputProfile, proofProfile, inMode, outMode, renderingIntent=..., proofRenderingIntent=..., flags=16384
): ...
buildTransformFromOpenProfiles = buildTransform
buildProofTransformFromOpenProfiles = buildProofTransform
def applyTransform(im, transform, inPlace: bool = ...): ...
def createProfile(colorSpace, colorTemp: int = ...): ...
def applyTransform(im, transform, inPlace: bool = False): ...
def createProfile(colorSpace, colorTemp: int = -1): ...
def getProfileName(profile): ...
def getProfileInfo(profile): ...
def getProfileCopyright(profile): ...
+83 -83
View File
@@ -11,65 +11,65 @@ _XY: TypeAlias = Sequence[float | tuple[float, float]]
_Outline: TypeAlias = Any
class ImageDraw:
def __init__(self, im: Image, mode: str | None = ...) -> None: ...
def __init__(self, im: Image, mode: str | None = None) -> None: ...
def getfont(self): ...
def arc(self, xy: _XY, start: float, end: float, fill: _Ink | None = ..., width: float = ...) -> None: ...
def bitmap(self, xy: _XY, bitmap: Image, fill: _Ink | None = ...) -> None: ...
def arc(self, xy: _XY, start: float, end: float, fill: _Ink | None = None, width: float = 1) -> None: ...
def bitmap(self, xy: _XY, bitmap: Image, fill: _Ink | None = None) -> None: ...
def chord(
self, xy: _XY, start: float, end: float, fill: _Ink | None = ..., outline: _Ink | None = ..., width: float = ...
self, xy: _XY, start: float, end: float, fill: _Ink | None = None, outline: _Ink | None = None, width: float = 1
) -> None: ...
def ellipse(self, xy: _XY, fill: _Ink | None = ..., outline: _Ink | None = ..., width: float = ...) -> None: ...
def line(self, xy: _XY, fill: _Ink | None = ..., width: float = ..., joint: Literal["curve"] | None = ...) -> None: ...
def shape(self, shape: _Outline, fill: _Ink | None = ..., outline: _Ink | None = ...) -> None: ...
def ellipse(self, xy: _XY, fill: _Ink | None = None, outline: _Ink | None = None, width: float = 1) -> None: ...
def line(self, xy: _XY, fill: _Ink | None = None, width: float = 0, joint: Literal["curve"] | None = None) -> None: ...
def shape(self, shape: _Outline, fill: _Ink | None = None, outline: _Ink | None = None) -> None: ...
def pieslice(
self,
xy: tuple[tuple[float, float], tuple[float, float]],
start: float,
end: float,
fill: _Ink | None = ...,
outline: _Ink | None = ...,
width: float = ...,
fill: _Ink | None = None,
outline: _Ink | None = None,
width: float = 1,
) -> None: ...
def point(self, xy: _XY, fill: _Ink | None = ...) -> None: ...
def polygon(self, xy: _XY, fill: _Ink | None = ..., outline: _Ink | None = ..., width: float = ...) -> None: ...
def point(self, xy: _XY, fill: _Ink | None = None) -> None: ...
def polygon(self, xy: _XY, fill: _Ink | None = None, outline: _Ink | None = None, width: float = 1) -> None: ...
def regular_polygon(
self,
bounding_circle: tuple[float, float] | tuple[float, float, float] | list[int],
n_sides: int,
rotation: float = ...,
fill: _Ink | None = ...,
outline: _Ink | None = ...,
rotation: float = 0,
fill: _Ink | None = None,
outline: _Ink | None = None,
) -> None: ...
def rectangle(
self,
xy: tuple[float, float, float, float] | tuple[tuple[float, float], tuple[float, float]],
fill: _Ink | None = ...,
outline: _Ink | None = ...,
width: float = ...,
fill: _Ink | None = None,
outline: _Ink | None = None,
width: float = 1,
) -> None: ...
def rounded_rectangle(
self,
xy: tuple[float, float, float, float] | tuple[tuple[float, float], tuple[float, float]],
radius: float = ...,
fill: _Ink | None = ...,
outline: _Ink | None = ...,
width: float = ...,
radius: float = 0,
fill: _Ink | None = None,
outline: _Ink | None = None,
width: float = 1,
) -> None: ...
def text(
self,
xy: tuple[float, float],
text: str | bytes,
fill: _Ink | None = ...,
font: _Font | None = ...,
anchor: str | None = ...,
spacing: float = ...,
align: Literal["left", "center", "right"] = ...,
direction: Literal["rtl", "ltr", "ttb"] | None = ...,
features: Sequence[str] | None = ...,
language: str | None = ...,
stroke_width: int = ...,
stroke_fill: _Ink | None = ...,
embedded_color: bool = ...,
fill: _Ink | None = None,
font: _Font | None = None,
anchor: str | None = None,
spacing: float = 4,
align: Literal["left", "center", "right"] = "left",
direction: Literal["rtl", "ltr", "ttb"] | None = None,
features: Sequence[str] | None = None,
language: str | None = None,
stroke_width: int = 0,
stroke_fill: _Ink | None = None,
embedded_color: bool = False,
*args,
**kwargs,
) -> None: ...
@@ -77,80 +77,80 @@ class ImageDraw:
self,
xy: tuple[float, float],
text: str | bytes,
fill: _Ink | None = ...,
font: _Font | None = ...,
anchor: str | None = ...,
spacing: float = ...,
align: Literal["left", "center", "right"] = ...,
direction: Literal["rtl", "ltr", "ttb"] | None = ...,
features: Incomplete | None = ...,
language: str | None = ...,
stroke_width: int = ...,
stroke_fill: _Ink | None = ...,
embedded_color: bool = ...,
fill: _Ink | None = None,
font: _Font | None = None,
anchor: str | None = None,
spacing: float = 4,
align: Literal["left", "center", "right"] = "left",
direction: Literal["rtl", "ltr", "ttb"] | None = None,
features: Incomplete | None = None,
language: str | None = None,
stroke_width: int = 0,
stroke_fill: _Ink | None = None,
embedded_color: bool = False,
) -> None: ...
def textsize(
self,
text: str | bytes,
font: _Font | None = ...,
spacing: float = ...,
direction: Literal["rtl", "ltr", "ttb"] | None = ...,
features: Sequence[str] | None = ...,
language: str | None = ...,
stroke_width: int = ...,
font: _Font | None = None,
spacing: float = 4,
direction: Literal["rtl", "ltr", "ttb"] | None = None,
features: Sequence[str] | None = None,
language: str | None = None,
stroke_width: int = 0,
) -> tuple[int, int]: ...
def multiline_textsize(
self,
text: str | bytes,
font: _Font | None = ...,
spacing: float = ...,
direction: Literal["rtl", "ltr", "ttb"] | None = ...,
features: Sequence[str] | None = ...,
language: str | None = ...,
stroke_width: int = ...,
font: _Font | None = None,
spacing: float = 4,
direction: Literal["rtl", "ltr", "ttb"] | None = None,
features: Sequence[str] | None = None,
language: str | None = None,
stroke_width: int = 0,
) -> tuple[int, int]: ...
def textlength(
self,
text: str | bytes,
font: _Font | None = ...,
direction: Literal["rtl", "ltr", "ttb"] | None = ...,
features: Sequence[str] | None = ...,
language: str | None = ...,
embedded_color: bool = ...,
font: _Font | None = None,
direction: Literal["rtl", "ltr", "ttb"] | None = None,
features: Sequence[str] | None = None,
language: str | None = None,
embedded_color: bool = False,
) -> float: ...
def textbbox(
self,
xy: tuple[float, float],
text: str | bytes,
font: _Font | None = ...,
anchor: str | None = ...,
spacing: float = ...,
align: Literal["left", "center", "right"] = ...,
direction: Literal["rtl", "ltr", "ttb"] | None = ...,
features: Incomplete | None = ...,
language: str | None = ...,
stroke_width: int = ...,
embedded_color: bool = ...,
font: _Font | None = None,
anchor: str | None = None,
spacing: float = 4,
align: Literal["left", "center", "right"] = "left",
direction: Literal["rtl", "ltr", "ttb"] | None = None,
features: Incomplete | None = None,
language: str | None = None,
stroke_width: int = 0,
embedded_color: bool = False,
) -> tuple[int, int, int, int]: ...
def multiline_textbbox(
self,
xy: tuple[float, float],
text: str | bytes,
font: _Font | None = ...,
anchor: str | None = ...,
spacing: float = ...,
align: Literal["left", "center", "right"] = ...,
direction: Literal["rtl", "ltr", "ttb"] | None = ...,
features: Incomplete | None = ...,
language: str | None = ...,
stroke_width: int = ...,
embedded_color: bool = ...,
font: _Font | None = None,
anchor: str | None = None,
spacing: float = 4,
align: Literal["left", "center", "right"] = "left",
direction: Literal["rtl", "ltr", "ttb"] | None = None,
features: Incomplete | None = None,
language: str | None = None,
stroke_width: int = 0,
embedded_color: bool = False,
) -> tuple[int, int, int, int]: ...
def Draw(im: Image, mode: str | None = ...) -> ImageDraw: ...
def Draw(im: Image, mode: str | None = None) -> ImageDraw: ...
def Outline() -> _Outline: ...
@overload
def getdraw(im: None = ..., hints: Container[Literal["nicest"]] | None = ...) -> tuple[None, Any]: ...
def getdraw(im: None = None, hints: Container[Literal["nicest"]] | None = None) -> tuple[None, Any]: ...
@overload
def getdraw(im: Image, hints: Container[Literal["nicest"]] | None = ...) -> tuple[Image, Any]: ...
def floodfill(image: Image, xy: tuple[float, float], value, border=..., thresh: float = ...) -> None: ...
def getdraw(im: Image, hints: Container[Literal["nicest"]] | None = None) -> tuple[Image, Any]: ...
def floodfill(image: Image, xy: tuple[float, float], value, border=None, thresh: float = 0) -> None: ...
+5 -5
View File
@@ -4,24 +4,24 @@ from typing import Any
class Pen:
color: Any
width: Any
def __init__(self, color, width: int = ..., opacity: int = ...) -> None: ...
def __init__(self, color, width: int = 1, opacity: int = 255) -> None: ...
class Brush:
color: Any
def __init__(self, color, opacity: int = ...) -> None: ...
def __init__(self, color, opacity: int = 255) -> None: ...
class Font:
color: Any
font: Any
def __init__(self, color, file, size: int = ...) -> None: ...
def __init__(self, color, file, size: int = 12) -> None: ...
class Draw:
draw: Any
image: Any
transform: Any
def __init__(self, image, size: Incomplete | None = ..., color: Incomplete | None = ...) -> None: ...
def __init__(self, image, size: Incomplete | None = None, color: Incomplete | None = None) -> None: ...
def flush(self): ...
def render(self, op, xy, pen, brush: Incomplete | None = ...) -> None: ...
def render(self, op, xy, pen, brush: Incomplete | None = None) -> None: ...
def settransform(self, offset) -> None: ...
def arc(self, xy, start, end, *options) -> None: ...
def chord(self, xy, start, end, *options) -> None: ...
+3 -3
View File
@@ -19,7 +19,7 @@ class ImageFile(Image):
decodermaxblock: Any
fp: Any
filename: Any
def __init__(self, fp: Incomplete | None = ..., filename: Incomplete | None = ...) -> None: ...
def __init__(self, fp: Incomplete | None = None, filename: Incomplete | None = None) -> None: ...
def get_format_mimetype(self): ...
def verify(self) -> None: ...
map: Any
@@ -65,5 +65,5 @@ class PyDecoder:
def decode(self, buffer) -> None: ...
def cleanup(self) -> None: ...
def setfd(self, fd) -> None: ...
def setimage(self, im, extents: Incomplete | None = ...) -> None: ...
def set_as_raw(self, data, rawmode: Incomplete | None = ...) -> None: ...
def setimage(self, im, extents: Incomplete | None = None) -> None: ...
def set_as_raw(self, data, rawmode: Incomplete | None = None) -> None: ...
+13 -15
View File
@@ -18,7 +18,7 @@ class BuiltinFilter(MultibandFilter):
class Kernel(BuiltinFilter):
name: str
filterargs: _FilterArgs
def __init__(self, size: Sequence[int], kernel: Sequence[int], scale: Incomplete | None = ..., offset: int = ...) -> None: ...
def __init__(self, size: Sequence[int], kernel: Sequence[int], scale: Incomplete | None = None, offset: int = 0) -> None: ...
class RankFilter(Filter):
name: str
@@ -31,30 +31,30 @@ class MedianFilter(RankFilter):
name: str
size: int
rank: int
def __init__(self, size: int = ...) -> None: ...
def __init__(self, size: int = 3) -> None: ...
class MinFilter(RankFilter):
name: str
size: int
rank: int
def __init__(self, size: int = ...) -> None: ...
def __init__(self, size: int = 3) -> None: ...
class MaxFilter(RankFilter):
name: str
size: int
rank: int
def __init__(self, size: int = ...) -> None: ...
def __init__(self, size: int = 3) -> None: ...
class ModeFilter(Filter):
name: str
size: int
def __init__(self, size: int = ...) -> None: ...
def __init__(self, size: int = 3) -> None: ...
def filter(self, image) -> Image: ...
class GaussianBlur(MultibandFilter):
name: str
radius: float
def __init__(self, radius: float = ...) -> None: ...
def __init__(self, radius: float = 2) -> None: ...
def filter(self, image) -> Image: ...
class BoxBlur(MultibandFilter):
@@ -68,7 +68,7 @@ class UnsharpMask(MultibandFilter):
radius: float
percent: int
threshold: int
def __init__(self, radius: float = ..., percent: int = ..., threshold: int = ...) -> None: ...
def __init__(self, radius: float = 2, percent: int = 150, threshold: int = 3) -> None: ...
def filter(self, image) -> Image: ...
class BLUR(BuiltinFilter):
@@ -117,22 +117,20 @@ class Color3DLUT(MultibandFilter):
channels: int
mode: str | None
table: Any
def __init__(
self, size: int | Iterable[int], table, channels: int = ..., target_mode: str | None = ..., **kwargs
) -> None: ...
def __init__(self, size: int | Iterable[int], table, channels: int = 3, target_mode: str | None = None, **kwargs) -> None: ...
@classmethod
def generate(
cls,
size: int | tuple[int, int, int],
callback: Callable[[float, float, float], Iterable[float]],
channels: int = ...,
target_mode: str | None = ...,
channels: int = 3,
target_mode: str | None = None,
) -> Self: ...
def transform(
self,
callback: Callable[..., Iterable[float]],
with_normals: bool = ...,
channels: Literal[3, 4] | None = ...,
target_mode: Incomplete | None = ...,
with_normals: bool = False,
channels: Literal[3, 4] | None = None,
target_mode: Incomplete | None = None,
) -> Self: ...
def filter(self, image) -> Image: ...
+53 -53
View File
@@ -15,7 +15,7 @@ class _Font(Protocol):
class ImageFont:
def getsize(self, text: str | bytes, *args, **kwargs) -> tuple[int, int]: ...
def getmask(self, text: str | bytes, mode: str = ..., direction=..., features=...): ...
def getmask(self, text: str | bytes, mode: str = "", direction=..., features=...): ...
class FreeTypeFont:
path: str | bytes | SupportsRead[bytes] | None
@@ -25,84 +25,84 @@ class FreeTypeFont:
layout_engine: Layout
def __init__(
self,
font: str | bytes | SupportsRead[bytes] | None = ...,
size: int = ...,
index: int = ...,
encoding: str = ...,
layout_engine: Layout | None = ...,
font: str | bytes | SupportsRead[bytes] | None = None,
size: int = 10,
index: int = 0,
encoding: str = "",
layout_engine: Layout | None = None,
) -> None: ...
def getname(self) -> tuple[str, str]: ...
def getmetrics(self) -> tuple[int, int]: ...
def getlength(
self,
text: str | bytes,
mode: str = ...,
direction: Literal["ltr", "rtl", "ttb"] | None = ...,
features: Incomplete | None = ...,
language: str | None = ...,
mode: str = "",
direction: Literal["ltr", "rtl", "ttb"] | None = None,
features: Incomplete | None = None,
language: str | None = None,
) -> int: ...
def getbbox(
self,
text: str | bytes,
mode: str = ...,
direction=...,
features=...,
language: str | None = ...,
stroke_width: int = ...,
anchor: str | None = ...,
mode: str = "",
direction=None,
features=None,
language: str | None = None,
stroke_width: int = 0,
anchor: str | None = None,
) -> tuple[int, int, int, int]: ...
def getsize(
self,
text: str | bytes,
direction: Literal["ltr", "rtl", "ttb"] | None = ...,
features: Incomplete | None = ...,
language: str | None = ...,
stroke_width: int = ...,
direction: Literal["ltr", "rtl", "ttb"] | None = None,
features: Incomplete | None = None,
language: str | None = None,
stroke_width: int = 0,
) -> tuple[int, int]: ...
def getsize_multiline(
self,
text: str | bytes,
direction: Literal["ltr", "rtl", "ttb"] | None = ...,
spacing: float = ...,
features: Incomplete | None = ...,
language: str | None = ...,
stroke_width: float = ...,
direction: Literal["ltr", "rtl", "ttb"] | None = None,
spacing: float = 4,
features: Incomplete | None = None,
language: str | None = None,
stroke_width: float = 0,
) -> tuple[int, int]: ...
def getoffset(self, text: str | bytes) -> tuple[int, int]: ...
def getmask(
self,
text: str | bytes,
mode: str = ...,
direction: Literal["ltr", "rtl", "ttb"] | None = ...,
features: Incomplete | None = ...,
language: str | None = ...,
stroke_width: float = ...,
anchor: str | None = ...,
ink=...,
start: tuple[float, float] | None = ...,
mode: str = "",
direction: Literal["ltr", "rtl", "ttb"] | None = None,
features: Incomplete | None = None,
language: str | None = None,
stroke_width: float = 0,
anchor: str | None = None,
ink=0,
start: tuple[float, float] | None = None,
): ...
def getmask2(
self,
text: str | bytes,
mode: str = ...,
mode: str = "",
fill=...,
direction: Literal["ltr", "rtl", "ttb"] | None = ...,
features: Incomplete | None = ...,
language: str | None = ...,
stroke_width: float = ...,
anchor: str | None = ...,
ink=...,
start: tuple[float, float] | None = ...,
direction: Literal["ltr", "rtl", "ttb"] | None = None,
features: Incomplete | None = None,
language: str | None = None,
stroke_width: float = 0,
anchor: str | None = None,
ink=0,
start: tuple[float, float] | None = None,
*args,
**kwargs,
): ...
def font_variant(
self,
font: str | bytes | SupportsRead[bytes] | None = ...,
size: int | None = ...,
index: int | None = ...,
encoding: str | None = ...,
layout_engine: Layout | None = ...,
font: str | bytes | SupportsRead[bytes] | None = None,
size: int | None = None,
index: int | None = None,
encoding: str | None = None,
layout_engine: Layout | None = None,
) -> FreeTypeFont: ...
def get_variation_names(self): ...
def set_variation_by_name(self, name): ...
@@ -110,17 +110,17 @@ class FreeTypeFont:
def set_variation_by_axes(self, axes): ...
class TransposedFont:
def __init__(self, font: _Font, orientation: int | None = ...) -> None: ...
def __init__(self, font: _Font, orientation: int | None = None) -> None: ...
def getsize(self, text: str | bytes, *args, **kwargs) -> tuple[int, int]: ...
def getmask(self, text: str | bytes, mode: str = ..., *args, **kwargs): ...
def getmask(self, text: str | bytes, mode: str = "", *args, **kwargs): ...
def load(filename: FileDescriptorOrPath) -> ImageFont: ...
def truetype(
font: str | bytes | SupportsRead[bytes] | None = ...,
size: int = ...,
index: int = ...,
encoding: str = ...,
layout_engine: Layout | None = ...,
font: str | bytes | SupportsRead[bytes] | None = None,
size: int = 10,
index: int = 0,
encoding: str = "",
layout_engine: Layout | None = None,
) -> FreeTypeFont: ...
def load_path(filename: str | bytes) -> ImageFont: ...
def load_default() -> ImageFont: ...
+1 -1
View File
@@ -3,6 +3,6 @@ from _typeshed import Incomplete
from .Image import Image, _Box
def grab(
bbox: _Box | None = ..., include_layered_windows: bool = ..., all_screens: bool = ..., xdisplay: Incomplete | None = ...
bbox: _Box | None = None, include_layered_windows: bool = False, all_screens: bool = False, xdisplay: Incomplete | None = None
) -> Image: ...
def grabclipboard() -> Image | None: ...
+2 -2
View File
@@ -4,7 +4,7 @@ from typing import Any
class _Operand:
im: Any
def __init__(self, im) -> None: ...
def apply(self, op, im1, im2: Incomplete | None = ..., mode: Incomplete | None = ...): ...
def apply(self, op, im1, im2: Incomplete | None = None, mode: Incomplete | None = None): ...
def __bool__(self) -> bool: ...
def __abs__(self): ...
def __pos__(self): ...
@@ -47,4 +47,4 @@ def imagemath_convert(self, mode): ...
ops: Any
def eval(expression, _dict=..., **kw): ...
def eval(expression, _dict={}, **kw): ...
+2 -2
View File
@@ -9,7 +9,7 @@ MIRROR_MATRIX: list[int]
class LutBuilder:
patterns: list[str]
lut: bytearray
def __init__(self, patterns: list[str] | None = ..., op_name: str | None = ...) -> None: ...
def __init__(self, patterns: list[str] | None = None, op_name: str | None = None) -> None: ...
def add_patterns(self, patterns: list[str]) -> None: ...
def build_default_lut(self) -> None: ...
def get_lut(self) -> bytearray: ...
@@ -17,7 +17,7 @@ class LutBuilder:
class MorphOp:
lut: bytearray
def __init__(self, lut: bytearray | None = ..., op_name: str | None = ..., patterns: list[str] | None = ...) -> None: ...
def __init__(self, lut: bytearray | None = None, op_name: str | None = None, patterns: list[str] | None = None) -> None: ...
def apply(self, image: Image) -> tuple[int, Image]: ...
def match(self, image: Image) -> list[tuple[int, int]]: ...
def get_on_pixels(self, image: Image) -> list[tuple[int, int]]: ...
+12 -12
View File
@@ -12,37 +12,37 @@ class _Deformer(Protocol):
def getmesh(self, image: Image): ...
def autocontrast(
image: Image, cutoff: int = ..., ignore: int | None = ..., mask: Image | None = ..., preserve_tone: bool = ...
image: Image, cutoff: int = 0, ignore: int | None = None, mask: Image | None = None, preserve_tone: bool = False
) -> Image: ...
def colorize(
image: Image,
black: int | str,
white: int | str,
mid: int | str | None = ...,
blackpoint: int = ...,
whitepoint: int = ...,
midpoint: int = ...,
mid: int | str | None = None,
blackpoint: int = 0,
whitepoint: int = 255,
midpoint: int = 127,
) -> Image: ...
def contain(image: Image, size: _Size, method: Resampling | _Resample = ...) -> Image: ...
def pad(
image: Image,
size: _Size,
method: Resampling | _Resample = ...,
color: Incomplete | None = ...,
centering: Iterable[float] = ...,
color: Incomplete | None = None,
centering: Iterable[float] = (0.5, 0.5),
) -> Image: ...
def crop(image: Image, border: _Border = ...) -> Image: ...
def crop(image: Image, border: _Border = 0) -> Image: ...
def scale(image: Image, factor: float, resample: Resampling | _Resample = ...) -> Image: ...
def deform(image: Image, deformer: _Deformer, resample: Resampling | _Resample = ...) -> Image: ...
def equalize(image: Image, mask: Incomplete | None = ...) -> Image: ...
def expand(image: Image, border: _Border = ..., fill: _Ink = ...) -> Image: ...
def equalize(image: Image, mask: Incomplete | None = None) -> Image: ...
def expand(image: Image, border: _Border = 0, fill: _Ink = 0) -> Image: ...
def fit(
image: Image, size: _Size, method: Resampling | _Resample = ..., bleed: float = ..., centering: Iterable[float] = ...
image: Image, size: _Size, method: Resampling | _Resample = ..., bleed: float = 0.0, centering: Iterable[float] = (0.5, 0.5)
) -> Image: ...
def flip(image: Image) -> Image: ...
def grayscale(image: Image) -> Image: ...
def invert(image: Image) -> Image: ...
def mirror(image: Image) -> Image: ...
def posterize(image: Image, bits: int) -> Image: ...
def solarize(image: Image, threshold: int = ...) -> Image: ...
def solarize(image: Image, threshold: int = 128) -> Image: ...
def exif_transpose(image: Image) -> Image: ...
+6 -6
View File
@@ -9,19 +9,19 @@ class ImagePalette:
palette: Any
colors: Any
dirty: Any
def __init__(self, mode: str = ..., palette: Incomplete | None = ..., size: int = ...) -> None: ...
def __init__(self, mode: str = "RGB", palette: Incomplete | None = None, size: int = 0) -> None: ...
def copy(self) -> ImagePalette: ...
def getdata(self): ...
def tobytes(self) -> bytes: ...
tostring = tobytes
def getcolor(self, color: tuple[int, int, int], image: Image | None = ...) -> int: ...
def getcolor(self, color: tuple[int, int, int], image: Image | None = None) -> int: ...
def save(self, fp) -> None: ...
def raw(rawmode, data): ...
def make_linear_lut(black, white): ...
def make_gamma_lut(exp): ...
def negative(mode: str = ...): ...
def random(mode: str = ...): ...
def sepia(white: str = ...): ...
def wedge(mode: str = ...): ...
def negative(mode: str = "RGB"): ...
def random(mode: str = "RGB"): ...
def sepia(white: str = "#fff0c0"): ...
def wedge(mode: str = "RGB"): ...
def load(filename): ...
+1 -1
View File
@@ -13,7 +13,7 @@ qt_versions: Any
qt_is_installed: bool
qt_version: Any
def rgb(r: int, g: int, b: int, a: int = ...) -> int: ...
def rgb(r: int, g: int, b: int, a: int = 255) -> int: ...
def fromqimage(im: ImageQt | _QImage) -> Image: ...
def fromqpixmap(im: ImageQt | _QImage) -> Image: ...
def align8to32(bytes: bytes, width: int, mode: Literal["1", "L", "P"]) -> bytes: ...
+1 -1
View File
@@ -9,4 +9,4 @@ class Iterator:
def __iter__(self): ...
def __next__(self): ...
def all_frames(im, func: Incomplete | None = ...): ...
def all_frames(im, func: Incomplete | None = None): ...
+7 -7
View File
@@ -2,8 +2,8 @@ from _typeshed import Incomplete
from typing import Any
from typing_extensions import Literal
def register(viewer, order: int = ...) -> None: ...
def show(image, title: Incomplete | None = ..., **options): ...
def register(viewer, order: int = 1) -> None: ...
def show(image, title: Incomplete | None = None, **options): ...
class Viewer:
def show(self, image, **options): ...
@@ -13,7 +13,7 @@ class Viewer:
def get_command(self, file, **options) -> None: ...
def save_image(self, image): ...
def show_image(self, image, **options): ...
def show_file(self, path: Incomplete | None = ..., **options): ...
def show_file(self, path: Incomplete | None = None, **options): ...
class WindowsViewer(Viewer):
format: str
@@ -24,19 +24,19 @@ class MacViewer(Viewer):
format: str
options: Any
def get_command(self, file, **options): ...
def show_file(self, path: Incomplete | None = ..., **options): ...
def show_file(self, path: Incomplete | None = None, **options): ...
class UnixViewer(Viewer):
format: str
options: Any
def get_command(self, file, **options): ...
def show_file(self, path: Incomplete | None = ..., **options): ...
def show_file(self, path: Incomplete | None = None, **options): ...
class XDGViewer(UnixViewer):
def get_command_ex(self, file, **options) -> tuple[Literal["xdg-open"], Literal["xdg-open"]]: ...
class DisplayViewer(UnixViewer):
def get_command_ex(self, file, title: str | None = ..., **options): ...
def get_command_ex(self, file, title: str | None = None, **options): ...
class GmDisplayViewer(UnixViewer):
def get_command_ex(self, file, **options): ...
@@ -45,7 +45,7 @@ class EogViewer(UnixViewer):
def get_command_ex(self, file, **options): ...
class XVViewer(UnixViewer):
def get_command_ex(self, file, title: Incomplete | None = ..., **options): ...
def get_command_ex(self, file, title: Incomplete | None = None, **options): ...
class IPythonViewer(Viewer):
def show_image(self, image, **options): ...
+1 -1
View File
@@ -4,7 +4,7 @@ from typing import Any
class Stat:
h: Any
bands: Any
def __init__(self, image_or_list, mask: Incomplete | None = ...) -> None: ...
def __init__(self, image_or_list, mask: Incomplete | None = None) -> None: ...
def __getattr__(self, id: str): ...
Global = Stat
+1 -1
View File
@@ -27,7 +27,7 @@ class PhotoImage(tkinter._PhotoImageLike):
def width(self) -> int: ...
def height(self) -> int: ...
# box is deprecated and unused
def paste(self, im: Image, box: _Box | None = ...) -> None: ...
def paste(self, im: Image, box: _Box | None = None) -> None: ...
class BitmapImage(tkinter._BitmapImageLike):
def __init__(
+5 -5
View File
@@ -15,17 +15,17 @@ class Dib:
image: Any
mode: Any
size: Any
def __init__(self, image, size: Incomplete | None = ...) -> None: ...
def __init__(self, image, size: Incomplete | None = None) -> None: ...
def expose(self, handle): ...
def draw(self, handle, dst, src: Incomplete | None = ...): ...
def draw(self, handle, dst, src: Incomplete | None = None): ...
def query_palette(self, handle): ...
def paste(self, im, box: Incomplete | None = ...) -> None: ...
def paste(self, im, box: Incomplete | None = None) -> None: ...
def frombytes(self, buffer): ...
def tobytes(self): ...
class Window:
hwnd: Any
def __init__(self, title: str = ..., width: Incomplete | None = ..., height: Incomplete | None = ...) -> None: ...
def __init__(self, title: str = "PIL", width: Incomplete | None = None, height: Incomplete | None = None) -> None: ...
def ui_handle_clear(self, dc, x0, y0, x1, y1) -> None: ...
def ui_handle_damage(self, x0, y0, x1, y1) -> None: ...
def ui_handle_destroy(self) -> None: ...
@@ -35,5 +35,5 @@ class Window:
class ImageWindow(Window):
image: Any
def __init__(self, image, title: str = ...) -> None: ...
def __init__(self, image, title: str = "PIL") -> None: ...
def ui_handle_repair(self, dc, x0, y0, x1, y1) -> None: ...
+1 -1
View File
@@ -30,4 +30,4 @@ samplings: Any
def convert_dict_qtables(qtables): ...
def get_sampling(im): ...
def jpeg_factory(fp: Incomplete | None = ..., filename: Incomplete | None = ...): ...
def jpeg_factory(fp: Incomplete | None = None, filename: Incomplete | None = None): ...
+1 -1
View File
@@ -13,4 +13,4 @@ class MpoImageFile(JpegImageFile):
def seek(self, frame) -> None: ...
def tell(self): ...
@staticmethod
def adopt(jpeg_instance, mpheader: Incomplete | None = ...): ...
def adopt(jpeg_instance, mpheader: Incomplete | None = None): ...
+2 -2
View File
@@ -4,7 +4,7 @@ from .Image import Image
class PSDraw:
fp: SupportsWrite[bytes]
def __init__(self, fp: SupportsWrite[bytes] | None = ...) -> None: ...
def __init__(self, fp: SupportsWrite[bytes] | None = None) -> None: ...
isofont: dict[bytes, int]
def begin_document(self, id: Unused = None) -> None: ...
def end_document(self) -> None: ...
@@ -12,7 +12,7 @@ class PSDraw:
def line(self, xy0: tuple[int, int], xy1: tuple[int, int]) -> None: ...
def rectangle(self, box: tuple[int, int, int, int]) -> None: ...
def text(self, xy: tuple[int, int], text: str) -> None: ...
def image(self, box: tuple[int, int, int, int], im: Image, dpi: float | None = ...) -> None: ...
def image(self, box: tuple[int, int, int, int], im: Image, dpi: float | None = None) -> None: ...
EDROFF_PS: bytes
VDI_PS: bytes
+1 -1
View File
@@ -22,4 +22,4 @@ class PcfFontFile(FontFile):
toc: Any
fp: Any
info: Any
def __init__(self, fp, charset_encoding: str = ...) -> None: ...
def __init__(self, fp, charset_encoding: str = "iso8859-1") -> None: ...
+11 -11
View File
@@ -90,11 +90,11 @@ class PdfParser:
xref_table: Any
def __init__(
self,
filename: Incomplete | None = ...,
f: Incomplete | None = ...,
buf: Incomplete | None = ...,
start_offset: int = ...,
mode: str = ...,
filename: Incomplete | None = None,
f: Incomplete | None = None,
buf: Incomplete | None = None,
start_offset: int = 0,
mode: str = "rb",
) -> None: ...
def __enter__(self): ...
def __exit__(
@@ -108,7 +108,7 @@ class PdfParser:
def write_comment(self, s) -> None: ...
def write_catalog(self): ...
def rewrite_pages(self) -> None: ...
def write_xref_and_trailer(self, new_root_ref: Incomplete | None = ...) -> None: ...
def write_xref_and_trailer(self, new_root_ref: Incomplete | None = None) -> None: ...
def write_page(self, ref, *objs, **dict_obj): ...
def write_obj(self, ref, *objs, **dict_obj): ...
def del_root(self) -> None: ...
@@ -116,7 +116,7 @@ class PdfParser:
def get_buf_from_file(f): ...
file_size_this: Any
def read_pdf_info(self) -> None: ...
def next_object_id(self, offset: Incomplete | None = ...): ...
def next_object_id(self, offset: Incomplete | None = None): ...
delimiter: bytes
delimiter_or_ws: bytes
whitespace: bytes
@@ -138,7 +138,7 @@ class PdfParser:
def interpret_trailer(cls, trailer_data): ...
re_hashes_in_name: Any
@classmethod
def interpret_name(cls, raw, as_text: bool = ...): ...
def interpret_name(cls, raw, as_text: bool = False): ...
re_null: Any
re_true: Any
re_false: Any
@@ -155,7 +155,7 @@ class PdfParser:
re_stream_start: Any
re_stream_end: Any
@classmethod
def get_value(cls, data, offset, expect_indirect: Incomplete | None = ..., max_nesting: int = ...): ...
def get_value(cls, data, offset, expect_indirect: Incomplete | None = None, max_nesting: int = -1): ...
re_lit_str_token: Any
escaped_chars: Any
@classmethod
@@ -164,5 +164,5 @@ class PdfParser:
re_xref_subsection_start: Any
re_xref_entry: Any
def read_xref_table(self, xref_section_offset): ...
def read_indirect(self, ref, max_nesting: int = ...): ...
def linearize_page_tree(self, node: Incomplete | None = ...): ...
def read_indirect(self, ref, max_nesting: int = -1): ...
def linearize_page_tree(self, node: Incomplete | None = None): ...
+5 -5
View File
@@ -39,20 +39,20 @@ class ChunkStream:
def call(self, cid, pos, length): ...
def crc(self, cid, data) -> None: ...
def crc_skip(self, cid, data) -> None: ...
def verify(self, endchunk: bytes = ...): ...
def verify(self, endchunk: bytes = b"IEND"): ...
class iTXt(str):
lang: Any
tkey: Any
@staticmethod
def __new__(cls, text, lang: Incomplete | None = ..., tkey: Incomplete | None = ...): ...
def __new__(cls, text, lang: Incomplete | None = None, tkey: Incomplete | None = None): ...
class PngInfo:
chunks: Any
def __init__(self) -> None: ...
def add(self, cid, data, after_idat: bool = ...) -> None: ...
def add_itxt(self, key, value, lang: str = ..., tkey: str = ..., zip: bool = ...) -> None: ...
def add_text(self, key, value, zip: bool = ...): ...
def add(self, cid, data, after_idat: bool = False) -> None: ...
def add_itxt(self, key, value, lang: str = "", tkey: str = "", zip: bool = False) -> None: ...
def add_text(self, key, value, zip: bool = False): ...
class PngStream(ChunkStream):
im_info: Any
+2 -2
View File
@@ -9,7 +9,7 @@ class PyAccess:
image8: Any
image32: Any
image: Any
def __init__(self, img, readonly: bool = ...) -> None: ...
def __init__(self, img, readonly: bool = False) -> None: ...
def __setitem__(self, xy, color) -> None: ...
def __getitem__(self, xy): ...
putpixel: Any
@@ -59,4 +59,4 @@ class _PyAccessF(PyAccess):
mode_map: Any
def new(img, readonly: bool = ...): ...
def new(img, readonly: bool = False): ...
+2 -2
View File
@@ -22,8 +22,8 @@ class SpiderImageFile(ImageFile):
stkoffset: Any
fp: Any
def seek(self, frame) -> None: ...
def convert2byte(self, depth: int = ...): ...
def convert2byte(self, depth: int = 255): ...
def tkPhotoImage(self): ...
def loadImageSeries(filelist: Incomplete | None = ...): ...
def loadImageSeries(filelist: Incomplete | None = None): ...
def makeSpiderHeader(im): ...
+14 -12
View File
@@ -55,7 +55,7 @@ OPEN_INFO: Any
PREFIXES: Any
class IFDRational(Rational):
def __init__(self, value, denominator: int = ...) -> None: ...
def __init__(self, value, denominator: int = 1) -> None: ...
@property
def numerator(a): ...
@property
@@ -93,7 +93,9 @@ class IFDRational(Rational):
class ImageFileDirectory_v2(MutableMapping[int, Any]):
group: int | None
tagtype: dict[int, int]
def __init__(self, ifh: bytes = ..., prefix: bytes | None = ..., group: int | None = ...) -> None: ...
def __init__(
self, ifh: bytes = b"II*\x00\x00\x00\x00\x00", prefix: bytes | None = None, group: int | None = None
) -> None: ...
@property
def prefix(self) -> bytes: ...
@property
@@ -108,18 +110,18 @@ class ImageFileDirectory_v2(MutableMapping[int, Any]):
def __setitem__(self, tag, value) -> None: ...
def __delitem__(self, tag) -> None: ...
def __iter__(self): ...
def load_byte(self, data, legacy_api: bool = ...): ...
def load_byte(self, data, legacy_api: bool = True): ...
def write_byte(self, data): ...
def load_string(self, data, legacy_api: bool = ...): ...
def load_string(self, data, legacy_api: bool = True): ...
def write_string(self, value: int | str | bytes) -> bytes: ...
def load_rational(self, data, legacy_api: bool = ...): ...
def load_rational(self, data, legacy_api: bool = True): ...
def write_rational(self, *values): ...
def load_undefined(self, data, legacy_api: bool = ...): ...
def load_undefined(self, data, legacy_api: bool = True): ...
def write_undefined(self, value): ...
def load_signed_rational(self, data, legacy_api: bool = ...): ...
def load_signed_rational(self, data, legacy_api: bool = True): ...
def write_signed_rational(self, *values): ...
def load(self, fp) -> None: ...
def tobytes(self, offset: int = ...): ...
def tobytes(self, offset: int = 0): ...
def save(self, fp): ...
class ImageFileDirectory_v1(ImageFileDirectory_v2):
@@ -145,7 +147,7 @@ class TiffImageFile(ImageFile):
format_description: ClassVar[str]
tag_v2: Any
tag: Any
def __init__(self, fp: Incomplete | None = ..., filename: Incomplete | None = ...) -> None: ...
def __init__(self, fp: Incomplete | None = None, filename: Incomplete | None = None) -> None: ...
@property
def n_frames(self): ...
im: Any
@@ -163,7 +165,7 @@ class AppendingTiffWriter:
close_fp: bool
name: Any
beginning: Any
def __init__(self, fn, new: bool = ...) -> None: ...
def __init__(self, fn, new: bool = False) -> None: ...
whereToWriteNewIFDOffset: Any
offsetOfNewPage: int
IIMM: Any
@@ -176,7 +178,7 @@ class AppendingTiffWriter:
self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None
) -> Literal[False]: ...
def tell(self): ...
def seek(self, offset, whence=...): ...
def seek(self, offset, whence=0): ...
def goToEnd(self) -> None: ...
endian: Any
longFmt: Any
@@ -194,4 +196,4 @@ class AppendingTiffWriter:
def writeLong(self, value) -> None: ...
def close(self) -> None: ...
def fixIFD(self) -> None: ...
def fixOffsets(self, count, isShort: bool = ..., isLong: bool = ...) -> None: ...
def fixOffsets(self, count, isShort: bool = False, isLong: bool = False) -> None: ...
+6 -6
View File
@@ -12,15 +12,15 @@ class _TagInfo(NamedTuple):
class TagInfo(_TagInfo):
def __new__(
cls,
value: Incomplete | None = ...,
name: str = ...,
type: _TagType | None = ...,
length: int | None = ...,
enum: dict[str, int] | None = ...,
value: Incomplete | None = None,
name: str = "unknown",
type: _TagType | None = None,
length: int | None = None,
enum: dict[str, int] | None = None,
): ...
def cvt_enum(self, value): ...
def lookup(tag: int, group: int | None = ...) -> _TagInfo: ...
def lookup(tag: int, group: int | None = None) -> _TagInfo: ...
BYTE: Literal[1]
ASCII: Literal[2]
+1 -1
View File
@@ -16,4 +16,4 @@ if sys.platform == "win32":
class WmfStubImageFile(StubImageFile):
format: ClassVar[Literal["WMF"]]
format_description: ClassVar[str]
def load(self, dpi: Incomplete | None = ...) -> None: ...
def load(self, dpi: Incomplete | None = None) -> None: ...
+6 -6
View File
@@ -1,11 +1,11 @@
def i8(c): ...
def o8(i): ...
def i16le(c, o: int = ...): ...
def si16le(c, o: int = ...): ...
def i32le(c, o: int = ...): ...
def si32le(c, o: int = ...): ...
def i16be(c, o: int = ...): ...
def i32be(c, o: int = ...): ...
def i16le(c, o: int = 0): ...
def si16le(c, o: int = 0): ...
def i32le(c, o: int = 0): ...
def si32le(c, o: int = 0): ...
def i16be(c, o: int = 0): ...
def i32be(c, o: int = 0): ...
def o16le(i): ...
def o32le(i): ...
def o16be(i): ...
+1 -1
View File
@@ -21,4 +21,4 @@ def get_supported_features(): ...
def check(feature): ...
def version(feature): ...
def get_supported(): ...
def pilinfo(out: Incomplete | None = ..., supported_formats: bool = ...) -> None: ...
def pilinfo(out: Incomplete | None = None, supported_formats: bool = True) -> None: ...