1
+ from collections .abc import Callable , Sequence
1
2
import os
2
3
import pathlib
4
+ from typing import Any , BinaryIO , Literal
5
+
6
+ import numpy as np
7
+ from numpy .typing import ArrayLike , NDArray
8
+ import PIL # type: ignore
3
9
4
- from matplotlib ._image import *
5
10
import matplotlib .artist as martist
6
11
from matplotlib .axes import Axes
7
12
from matplotlib import cm
8
13
from matplotlib .backend_bases import RendererBase , MouseEvent
9
14
from matplotlib .colors import Colormap , Normalize
10
15
from matplotlib .figure import Figure
11
- from matplotlib .transforms import (
12
- Affine2D ,
13
- BboxBase ,
14
- )
16
+ from matplotlib .transforms import Affine2D , BboxBase , Bbox , Transform
15
17
16
- from collections .abc import Sequence
17
- from typing import Any , BinaryIO , Literal
18
- import numpy as np
19
- from numpy .typing import ArrayLike
18
+ #
19
+ # These names are re-exported from matplotlib._image.
20
+ #
20
21
21
- import PIL # type: ignore
22
+ BESSEL : int
23
+ BICUBIC : int
24
+ BILINEAR : int
25
+ BLACKMAN : int
26
+ CATROM : int
27
+ GAUSSIAN : int
28
+ HAMMING : int
29
+ HANNING : int
30
+ HERMITE : int
31
+ KAISER : int
32
+ LANCZOS : int
33
+ MITCHELL : int
34
+ NEAREST : int
35
+ QUADRIC : int
36
+ SINC : int
37
+ SPLINE16 : int
38
+ SPLINE36 : int
22
39
23
- BESSEL : int = ...
24
- BICUBIC : int = ...
25
- BILINEAR : int = ...
26
- BLACKMAN : int = ...
27
- CATROM : int = ...
28
- GAUSSIAN : int = ...
29
- HAMMING : int = ...
30
- HANNING : int = ...
31
- HERMITE : int = ...
32
- KAISER : int = ...
33
- LANCZOS : int = ...
34
- MITCHELL : int = ...
35
- NEAREST : int = ...
36
- QUADRIC : int = ...
37
- SINC : int = ...
38
- SPLINE16 : int = ...
39
- SPLINE36 : int = ...
40
+ def resample (
41
+ input_array : NDArray [np .float32 ] | NDArray [np .float64 ] | NDArray [np .int8 ],
42
+ output_array : NDArray [np .float32 ] | NDArray [np .float64 ] | NDArray [np .int8 ],
43
+ transform : Transform ,
44
+ interpolation : int = ...,
45
+ resample : bool = ...,
46
+ alpha : float = ...,
47
+ norm : bool = ...,
48
+ radius : float = ...,
49
+ ) -> None : ...
50
+
51
+ #
52
+ # END names re-exported from matplotlib._image.
53
+ #
40
54
41
55
interpolations_names : set [str ]
42
56
@@ -156,7 +170,7 @@ class BboxImage(_ImageBase):
156
170
bbox : BboxBase
157
171
def __init__ (
158
172
self ,
159
- bbox : BboxBase ,
173
+ bbox : BboxBase | Callable [[ RendererBase | None ], Bbox ] ,
160
174
* ,
161
175
cmap : str | Colormap | None = ...,
162
176
norm : str | Normalize | None = ...,
@@ -167,10 +181,10 @@ class BboxImage(_ImageBase):
167
181
resample : bool = ...,
168
182
** kwargs
169
183
) -> None : ...
170
- def get_window_extent (self , renderer : RendererBase | None = ...): ...
184
+ def get_window_extent (self , renderer : RendererBase | None = ...) -> Bbox : ...
171
185
172
186
def imread (
173
- fname : str | pathlib .Path | BinaryIO , format : str | None = ...
187
+ fname : str | pathlib .Path | BinaryIO , format : str | None = ...
174
188
) -> np .ndarray : ...
175
189
def imsave (
176
190
fname : str | os .PathLike | BinaryIO ,
0 commit comments