1+ from collections .abc import Callable , Sequence
12import os
23import 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
39
4- from matplotlib ._image import *
510import matplotlib .artist as martist
611from matplotlib .axes import Axes
712from matplotlib import cm
813from matplotlib .backend_bases import RendererBase , MouseEvent
914from matplotlib .colors import Colormap , Normalize
1015from matplotlib .figure import Figure
11- from matplotlib .transforms import (
12- Affine2D ,
13- BboxBase ,
14- )
16+ from matplotlib .transforms import Affine2D , BboxBase , Bbox , Transform
1517
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+ #
2021
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
2239
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+ #
4054
4155interpolations_names : set [str ]
4256
@@ -156,7 +170,7 @@ class BboxImage(_ImageBase):
156170 bbox : BboxBase
157171 def __init__ (
158172 self ,
159- bbox : BboxBase ,
173+ bbox : BboxBase | Callable [[ RendererBase | None ], Bbox ] ,
160174 * ,
161175 cmap : str | Colormap | None = ...,
162176 norm : str | Normalize | None = ...,
@@ -167,10 +181,10 @@ class BboxImage(_ImageBase):
167181 resample : bool = ...,
168182 ** kwargs
169183 ) -> None : ...
170- def get_window_extent (self , renderer : RendererBase | None = ...): ...
184+ def get_window_extent (self , renderer : RendererBase | None = ...) -> Bbox : ...
171185
172186def imread (
173- fname : str | pathlib .Path | BinaryIO , format : str | None = ...
187+ fname : str | pathlib .Path | BinaryIO , format : str | None = ...
174188) -> np .ndarray : ...
175189def imsave (
176190 fname : str | os .PathLike | BinaryIO ,
0 commit comments