File size: 1,192 Bytes
fe41391
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
from collections.abc import Callable
from typing import Literal, overload

from numpy.typing import NDArray

__all__ = ["calculate_rms", "comparable_formats", "compare_images"]

def make_test_filename(fname: str, purpose: str) -> str: ...
def get_cache_dir() -> str: ...
def get_file_hash(path: str, block_size: int = ...) -> str: ...

converter: dict[str, Callable[[str, str], None]] = {}

def comparable_formats() -> list[str]: ...
def convert(filename: str, cache: bool) -> str: ...
def crop_to_same(
    actual_path: str, actual_image: NDArray, expected_path: str, expected_image: NDArray
) -> tuple[NDArray, NDArray]: ...
def calculate_rms(expected_image: NDArray, actual_image: NDArray) -> float: ...
@overload
def compare_images(
    expected: str, actual: str, tol: float, in_decorator: Literal[True]
) -> None | dict[str, float | str]: ...
@overload
def compare_images(
    expected: str, actual: str, tol: float, in_decorator: Literal[False]
) -> None | str: ...
@overload
def compare_images(
    expected: str, actual: str, tol: float, in_decorator: bool = ...
) -> None | str | dict[str, float | str]: ...
def save_diff_image(expected: str, actual: str, output: str) -> None: ...