massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-pyright / node_modules / pyright / dist / typeshed-fallback / stubs / Pillow / PIL / ImageDraw.pyi
1 from collections.abc import Container
2 from typing import Any, Sequence, Tuple, Union, overload
3 from typing_extensions import Literal
4
5 from .Image import Image
6 from .ImageColor import _Ink
7 from .ImageFont import _Font
8
9 _XY = Sequence[Union[float, Tuple[float, float]]]
10 _Outline = Any
11
12 class ImageDraw:
13     def __init__(self, im: Image, mode: str | None = ...) -> None: ...
14     def getfont(self): ...
15     def arc(self, xy: _XY, start: float, end: float, fill: _Ink | None = ..., width: float = ...) -> None: ...
16     def bitmap(self, xy: _XY, bitmap: Image, fill: _Ink | None = ...) -> None: ...
17     def chord(
18         self, xy: _XY, start: float, end: float, fill: _Ink | None = ..., outline: _Ink | None = ..., width: float = ...
19     ) -> None: ...
20     def ellipse(self, xy: _XY, fill: _Ink | None = ..., outline: _Ink | None = ..., width: float = ...) -> None: ...
21     def line(self, xy: _XY, fill: _Ink | None = ..., width: float = ..., joint: Literal["curve"] | None = ...) -> None: ...
22     def shape(self, shape: _Outline, fill: _Ink | None = ..., outline: _Ink | None = ...) -> None: ...
23     def pieslice(
24         self,
25         xy: tuple[tuple[float, float], tuple[float, float]],
26         start: float,
27         end: float,
28         fill: _Ink | None = ...,
29         outline: _Ink | None = ...,
30         width: float = ...,
31     ) -> None: ...
32     def point(self, xy: _XY, fill: _Ink | None = ...) -> None: ...
33     def polygon(self, xy: _XY, fill: _Ink | None = ..., outline: _Ink | None = ...) -> None: ...
34     def regular_polygon(
35         self,
36         bounding_circle: tuple[float, float] | tuple[float, float, float] | list[int],
37         n_sides: int,
38         rotation: float = ...,
39         fill: _Ink | None = ...,
40         outline: _Ink | None = ...,
41     ) -> None: ...
42     def rectangle(
43         self,
44         xy: tuple[float, float, float, float] | tuple[tuple[float, float], tuple[float, float]],
45         fill: _Ink | None = ...,
46         outline: _Ink | None = ...,
47         width: float = ...,
48     ) -> None: ...
49     def rounded_rectangle(
50         self,
51         xy: tuple[float, float, float, float] | tuple[tuple[float, float], tuple[float, float]],
52         radius: float = ...,
53         fill: _Ink | None = ...,
54         outline: _Ink | None = ...,
55         width: float = ...,
56     ) -> None: ...
57     def text(
58         self,
59         xy: tuple[float, float],
60         text: str | bytes,
61         fill: _Ink | None = ...,
62         font: _Font | None = ...,
63         anchor: str | None = ...,
64         spacing: float = ...,
65         align: Literal["left", "center", "right"] = ...,
66         direction: Literal["rtl", "ltr", "ttb"] | None = ...,
67         features: Sequence[str] | None = ...,
68         language: str | None = ...,
69         stroke_width: int = ...,
70         stroke_fill: _Ink | None = ...,
71         embedded_color: bool = ...,
72         *args,
73         **kwargs,
74     ) -> None: ...
75     def multiline_text(
76         self,
77         xy: tuple[float, float],
78         text: str | bytes,
79         fill: _Ink | None = ...,
80         font: _Font | None = ...,
81         anchor: str | None = ...,
82         spacing: float = ...,
83         align: Literal["left", "center", "right"] = ...,
84         direction: Literal["rtl", "ltr", "ttb"] | None = ...,
85         features: Any | None = ...,
86         language: str | None = ...,
87         stroke_width: int = ...,
88         stroke_fill: _Ink | None = ...,
89         embedded_color: bool = ...,
90     ) -> None: ...
91     def textsize(
92         self,
93         text: str | bytes,
94         font: _Font | None = ...,
95         spacing: float = ...,
96         direction: Literal["rtl", "ltr", "ttb"] | None = ...,
97         features: Sequence[str] | None = ...,
98         language: str | None = ...,
99         stroke_width: int = ...,
100     ) -> tuple[int, int]: ...
101     def multiline_textsize(
102         self,
103         text: str | bytes,
104         font: _Font | None = ...,
105         spacing: float = ...,
106         direction: Literal["rtl", "ltr", "ttb"] | None = ...,
107         features: Sequence[str] | None = ...,
108         language: str | None = ...,
109         stroke_width: int = ...,
110     ) -> tuple[int, int]: ...
111     def textlength(
112         self,
113         text: str | bytes,
114         font: _Font | None = ...,
115         direction: Literal["rtl", "ltr", "ttb"] | None = ...,
116         features: Sequence[str] | None = ...,
117         language: str | None = ...,
118         embedded_color: bool = ...,
119     ) -> int: ...
120     def textbbox(
121         self,
122         xy: tuple[float, float],
123         text: str | bytes,
124         font: _Font | None = ...,
125         anchor: str | None = ...,
126         spacing: float = ...,
127         align: Literal["left", "center", "right"] = ...,
128         direction: Literal["rtl", "ltr", "ttb"] | None = ...,
129         features: Any | None = ...,
130         language: str | None = ...,
131         stroke_width: int = ...,
132         embedded_color: bool = ...,
133     ) -> tuple[int, int, int, int]: ...
134     def multiline_textbbox(
135         self,
136         xy: tuple[float, float],
137         text: str | bytes,
138         font: _Font | None = ...,
139         anchor: str | None = ...,
140         spacing: float = ...,
141         align: Literal["left", "center", "right"] = ...,
142         direction: Literal["rtl", "ltr", "ttb"] | None = ...,
143         features: Any | None = ...,
144         language: str | None = ...,
145         stroke_width: int = ...,
146         embedded_color: bool = ...,
147     ) -> tuple[int, int, int, int]: ...
148
149 def Draw(im: Image, mode: str | None = ...) -> ImageDraw: ...
150 def Outline() -> _Outline: ...
151 @overload
152 def getdraw(im: None = ..., hints: Container[Literal["nicest"]] | None = ...) -> tuple[None, Any]: ...
153 @overload
154 def getdraw(im: Image, hints: Container[Literal["nicest"]] | None = ...) -> tuple[Image, Any]: ...
155 def floodfill(image: Image, xy: tuple[float, float], value, border=..., thresh: float = ...) -> None: ...