Coverage for python / lsst / pipe / tasks / prettyPictureMaker / types.py: 100%

14 statements  

« prev     ^ index     » next       coverage.py v7.13.5, created at 2026-05-01 08:40 +0000

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]