mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-08-26 07:04:45 +03:00
Typing: relaxed type for MultiChannelExtrema
This allows for the existence of (currently not implemented) multichannel floating point images
This commit is contained in:
parent
13e1902d5c
commit
bebece4672
|
@ -1292,7 +1292,7 @@ class Image(object):
|
|||
|
||||
self.load()
|
||||
if self.im.bands > 1:
|
||||
extrema = [] # type: Extrema
|
||||
extrema = []
|
||||
for i in range(self.im.bands):
|
||||
ex = self.im.getband(i).getextrema() # type: MultiChannelExtrema
|
||||
extrema.append(ex)
|
||||
|
|
|
@ -70,7 +70,7 @@ class ImagingCore:
|
|||
def isblock(self) -> int: ...
|
||||
def getbbox(self) -> Optional[LURD]: ...
|
||||
def getcolors(self, maxcolors: int) -> Optional[List[Tuple[int, Color]]]: ... ###################
|
||||
def getextrema(self) -> Tuple[float, float]: ...
|
||||
def getextrema(self) -> SingleChannelExtrema: ...
|
||||
def getprojection(self) -> Tuple[List[int], List[int]]: ...
|
||||
def getband(self, band: int) -> ImagingCore: ...
|
||||
def putband(self, image: ImagingCore, band_index: int) -> None: ...
|
||||
|
|
|
@ -10,7 +10,7 @@ Matrix12 = Tuple[float, float, float, float, float, float, float, float, float,
|
|||
Mode = str
|
||||
|
||||
SingleChannelExtrema = Union[Tuple[float, float], Tuple[int, int]]
|
||||
MultiChannelExtrema = Tuple[int, int]
|
||||
MultiChannelExtrema = SingleChannelExtrema # Note: currently only a Tuple[int,int]
|
||||
Extrema = Union[SingleChannelExtrema, Tuple[MultiChannelExtrema, ...]]
|
||||
|
||||
Color = Union[int, float, Tuple[int, int], Tuple[int, int, int], Tuple[int, int, int, int]]
|
||||
|
|
Loading…
Reference in New Issue
Block a user