mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-08-26 07:04:45 +03:00
Type annotations: Add & use Extrema type alias.
This commit is contained in:
parent
9625b7957e
commit
850e28a02f
|
@ -8,4 +8,5 @@ Size = XY # NOTE: All XY aliases will be interchangeable
|
|||
Matrix4 = Tuple[float, float, float, float]
|
||||
Matrix12 = Tuple[float, float, float, float, float, float, float, float, float, float, float, float]
|
||||
Mode = str
|
||||
Extrema = Union[Tuple[Any, Any], Tuple[Tuple[Any, Any], ...]] # Any -> float?
|
||||
|
||||
|
|
|
@ -1283,7 +1283,7 @@ class Image(object):
|
|||
return self.im # could be abused
|
||||
|
||||
def getextrema(self):
|
||||
# type: () -> Tuple
|
||||
# type: () -> Extrema
|
||||
"""
|
||||
Gets the the minimum and maximum pixel values for each band in
|
||||
the image.
|
||||
|
@ -1359,7 +1359,7 @@ class Image(object):
|
|||
return [i8(c) for c in x], [i8(c) for c in y]
|
||||
|
||||
def histogram(self, mask=None, extrema=None):
|
||||
# type: (Optional[Image], Optional[Any]) -> List[int]
|
||||
# type: (Optional[Image], Optional[Extrema]) -> List[int]
|
||||
"""
|
||||
Returns a histogram for the image. The histogram is returned as
|
||||
a list of pixel counts, one for each pixel value in the source
|
||||
|
|
Loading…
Reference in New Issue
Block a user