lsst.pipe.tasks g540474b770+e2881a99e2
Loading...
Searching...
No Matches
types.py
Go to the documentation of this file.
1from __future__ import annotations
2
3__all__ = (
4 "FloatImagePlane",
5 "ColorImage",
6 "RGBImage",
7 "LABImage",
8 "LocalContrastFunction",
9 "ScaleLumFunction",
10 "ScaleColorFunction",
11 "RemapBoundsFunction",
12 "BracketingFunction",
13 "GamutRemappingFunction",
14)
15
16import numpy as np
17from typing import TypeAlias, Callable, Literal
18
19FloatImagePlane: TypeAlias = np.ndarray[tuple[int, int], np.dtype[np.floating]]
20ColorImage: TypeAlias = np.ndarray[tuple[int, int, Literal[3]], np.dtype[np.floating]]
21RGBImage: TypeAlias = ColorImage
22LABImage: TypeAlias = ColorImage
23LocalContrastFunction: TypeAlias = Callable[[FloatImagePlane], FloatImagePlane]
24ScaleLumFunction: TypeAlias = Callable[[FloatImagePlane], FloatImagePlane]
25ScaleColorFunction: TypeAlias = Callable[
26 [FloatImagePlane, FloatImagePlane, FloatImagePlane, FloatImagePlane],
27 tuple[FloatImagePlane, FloatImagePlane],
28]
29RemapBoundsFunction: type = Callable[[RGBImage], RGBImage]
30BracketingFunction: type = Callable[[FloatImagePlane], FloatImagePlane]
31GamutRemappingFunction: type = Callable[[LABImage, tuple[float, float]], RGBImage]