forked from microsoft/python-type-stubs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathimage.pyi
More file actions
155 lines (129 loc) · 5.5 KB
/
Copy pathimage.pyi
File metadata and controls
155 lines (129 loc) · 5.5 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
# COMPLETE
from pathlib import Path
from typing import Any, BinaryIO, Collection, Dict, Literal, Optional, Tuple, Union
from PIL.Image import Image as PILImage
from matplotlib._typing import ArrayLike, ndarray
from matplotlib.artist import Artist
from matplotlib.axes._axes import Axes
from matplotlib.backend_bases import LocationEvent, MouseEvent, RendererBase
from matplotlib.cm import Colormap, ScalarMappable
from matplotlib.colors import Normalize
from matplotlib.figure import Figure
from matplotlib.transforms import Affine2D, Bbox
_PathOrIO = Union[str, Path, BinaryIO]
class _ImageBase(Artist, ScalarMappable):
def __init__(
self,
ax: Axes,
cmap: Optional[Union[str, Colormap]] = ...,
norm: Optional[Normalize] = ...,
interpolation: Optional[str] = ...,
origin: Optional[Literal['upper', 'lower']] = ...,
filternorm: bool = ...,
filterrad: float = ...,
resample: bool = ...,
**kwargs: Any
) -> None: ...
def get_size(self) -> Tuple[int, int]: ...
def set_alpha(self, alpha: float) -> None: ...
def changed(self) -> None: ...
def make_image(self, renderer: RendererBase, magnification: float = ..., unsampled: bool = ...) -> Tuple[ndarray, Tuple[float, float], Affine2D]: ...
def draw(self, renderer: RendererBase, *args: Any, **kwargs: Any) -> None: ...
def contains(self, mouseevent: MouseEvent) -> Tuple[bool, Dict[Any, Any]]: ...
def write_png(self, fname: _PathOrIO) -> None: ...
def set_data(self, A: Union[ArrayLike, PILImage]) -> None: ...
def set_array(self, A: ArrayLike) -> None: ...
def get_interpolation(self) -> str: ...
def set_interpolation(self, s: str) -> None: ...
def can_composite(self) -> bool: ...
def set_resample(self, v: Optional[bool]) -> None: ...
def get_resample(self) -> bool: ...
def set_filternorm(self, filternorm: bool) -> None: ...
def get_filternorm(self) -> bool: ...
def set_filterrad(self, filterrad: float) -> None: ...
def get_filterrad(self) -> float: ...
class AxesImage(_ImageBase):
def __init__(
self,
ax: Axes,
cmap: Optional[Union[str, Colormap]] = ...,
norm: Optional[Normalize] = ...,
interpolation: Optional[str] = ...,
origin: Optional[Literal['upper', 'lower']] = ...,
extent: Optional[Tuple[float, float, float, float]] = ...,
filternorm: bool = ...,
filterrad: float = ...,
resample: bool = ...,
**kwargs: Any
) -> None: ...
def format_cursor_data(self, data: ArrayLike) -> str: ...
def get_cursor_data(self, event: LocationEvent) -> Optional[ndarray]: ...
def set_extent(self, extent: Tuple[float, float, float, float]) -> None: ...
def get_extent(self) -> Tuple[float, float, float, float]: ...
def get_window_extent(self, renderer: Optional[RendererBase] = ...) -> Tuple[float, float, float, float]: ...
class NonUniformImage(AxesImage):
def __init__(self, ax: Axes, *, interpolation: str = ..., **kwargs: Any) -> None: ...
@property
def is_grayscale(self) -> bool: ...
def set_cmap(self, cmap: Optional[Union[str, Colormap]]) -> None: ...
def set_data(self, x: ArrayLike, y: ArrayLike, A: ArrayLike) -> None: ...
def set_norm(self, norm: Optional[Normalize]) -> None: ...
class PcolorImage(AxesImage):
def __init__(
self,
ax: Axes,
x: Optional[ArrayLike] = ...,
y: Optional[ArrayLike] = ...,
A: Optional[ArrayLike] = ...,
cmap: Optional[Union[str, Colormap]] = ...,
norm: Optional[Normalize] = ...,
**kwargs: Any
) -> None: ...
@property
def is_grayscale(self) -> bool: ...
def set_data(self, x: ArrayLike, y: ArrayLike, A: ArrayLike) -> None: ...
class BboxImage(_ImageBase):
def __init__(
self,
bbox: Bbox,
cmap: Optional[Union[str, Colormap]] = ...,
norm: Optional[Normalize] = ...,
interpolation: Optional[str] = ...,
origin: Optional[Literal['upper', 'lower']] = ...,
filternorm: bool = ...,
filterrad: float = ...,
resample: bool = ...,
**kwargs: Any
) -> None: ...
def get_window_extent(self, renderer: Optional[RendererBase] = ...) -> Tuple[float, float, float, float]: ...
class FigureImage(_ImageBase):
def __init__(
self,
fig: Figure,
cmap: Optional[Union[str, Colormap]] = ...,
norm: Optional[Normalize] = ...,
interpolation: Optional[str] = ...,
origin: Optional[Literal['upper', 'lower']] = ...,
filternorm: bool = ...,
filterrad: float = ...,
resample: bool = ...,
**kwargs: Any
) -> None: ...
def get_extent(self) -> Tuple[float, float, float, float]: ...
def composite_images(images: Collection[_ImageBase], renderer: RendererBase, magnification: float = ...) -> Tuple[ndarray, float, float]: ...
def imread(fname: _PathOrIO, format: Optional[str] = ...) -> ndarray: ...
def imsave(
fname: _PathOrIO,
arr: ArrayLike,
vmin: Optional[float] = ...,
vmax: Optional[float] = ...,
cmap: Optional[Union[str, Colormap]] = ...,
format: Optional[str] = ...,
origin: Optional[Literal['upper', 'lower']] = ...,
dpi: float = ...,
*,
metadata: Optional[Dict[Any, Any]] = ...,
pil_kwargs: Optional[Dict[str, Any]] = ...
) -> None: ...
def pil_to_array(pilImage: PILImage) -> ndarray: ...
def thumbnail(infile: _PathOrIO, thumbfile: _PathOrIO, scale: float = ..., interpolation: str = ..., preview: bool = ...) -> Figure: ...