11from collections .abc import Callable , Sequence
2+ from enum import Enum
23import os
34import pathlib
4- from typing import Any , BinaryIO , Literal
5+ from typing import Any , BinaryIO , Literal , cast
56
67import numpy as np
78from numpy .typing import ArrayLike , NDArray
@@ -19,34 +20,58 @@ from matplotlib.transforms import Affine2D, BboxBase, Bbox, Transform
1920# These names are re-exported from matplotlib._image.
2021#
2122
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
23+ class _InterpolationType (Enum ):
24+ NEAREST = cast (int , ...)
25+ BILINEAR = cast (int , ...)
26+ BICUBIC = cast (int , ...)
27+ SPLINE16 = cast (int , ...)
28+ SPLINE36 = cast (int , ...)
29+ HANNING = cast (int , ...)
30+ HAMMING = cast (int , ...)
31+ HERMITE = cast (int , ...)
32+ KAISER = cast (int , ...)
33+ QUADRIC = cast (int , ...)
34+ CATROM = cast (int , ...)
35+ GAUSSIAN = cast (int , ...)
36+ BESSEL = cast (int , ...)
37+ MITCHELL = cast (int , ...)
38+ SINC = cast (int , ...)
39+ LANCZOS = cast (int , ...)
40+ BLACKMAN = cast (int , ...)
41+
42+ # ``_InterpolationType`` uses ``.export_values()``, so every member is also
43+ # injected as a module-level constant.
44+ NEAREST : _InterpolationType
45+ BILINEAR : _InterpolationType
46+ BICUBIC : _InterpolationType
47+ SPLINE16 : _InterpolationType
48+ SPLINE36 : _InterpolationType
49+ HANNING : _InterpolationType
50+ HAMMING : _InterpolationType
51+ HERMITE : _InterpolationType
52+ KAISER : _InterpolationType
53+ QUADRIC : _InterpolationType
54+ CATROM : _InterpolationType
55+ GAUSSIAN : _InterpolationType
56+ BESSEL : _InterpolationType
57+ MITCHELL : _InterpolationType
58+ SINC : _InterpolationType
59+ LANCZOS : _InterpolationType
60+ BLACKMAN : _InterpolationType
3961
4062def resample (
4163 input_array : NDArray [np .float32 ] | NDArray [np .float64 ] | NDArray [np .int8 ],
4264 output_array : NDArray [np .float32 ] | NDArray [np .float64 ] | NDArray [np .int8 ],
4365 transform : Transform ,
44- interpolation : int = ...,
66+ interpolation : _InterpolationType = ...,
4567 resample : bool = ...,
4668 alpha : float = ...,
4769 norm : bool = ...,
4870 radius : float = ...,
4971) -> None : ...
72+ def calculate_rms_and_diff (
73+ expected_image : np .ndarray , actual_image : np .ndarray
74+ ) -> tuple [float , np .ndarray ]: ...
5075
5176#
5277# END names re-exported from matplotlib._image.
0 commit comments