mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-13 10:46:16 +03:00
Changed SupportsGetMesh protocol to be public
This commit is contained in:
parent
18af646365
commit
dcbe402f77
|
@ -14,6 +14,8 @@ only work on L and RGB images.
|
||||||
.. autofunction:: colorize
|
.. autofunction:: colorize
|
||||||
.. autofunction:: crop
|
.. autofunction:: crop
|
||||||
.. autofunction:: scale
|
.. autofunction:: scale
|
||||||
|
.. autoclass:: SupportsGetMesh
|
||||||
|
:show-inheritance:
|
||||||
.. autofunction:: deform
|
.. autofunction:: deform
|
||||||
.. autofunction:: equalize
|
.. autofunction:: equalize
|
||||||
.. autofunction:: expand
|
.. autofunction:: expand
|
||||||
|
|
|
@ -411,7 +411,15 @@ def scale(
|
||||||
return image.resize(size, resample)
|
return image.resize(size, resample)
|
||||||
|
|
||||||
|
|
||||||
class _SupportsGetMesh(Protocol):
|
class SupportsGetMesh(Protocol):
|
||||||
|
"""
|
||||||
|
An object that supports the ``getmesh`` method, taking an image as an
|
||||||
|
argument, and returning a list of tuples. Each tuple contains two tuples,
|
||||||
|
the source box as a tuple of 4 integers, and a tuple of 8 integers for the
|
||||||
|
final quadrilateral, in order of top left, bottom left, bottom right, top
|
||||||
|
right.
|
||||||
|
"""
|
||||||
|
|
||||||
def getmesh(
|
def getmesh(
|
||||||
self, image: Image.Image
|
self, image: Image.Image
|
||||||
) -> list[
|
) -> list[
|
||||||
|
@ -421,7 +429,7 @@ class _SupportsGetMesh(Protocol):
|
||||||
|
|
||||||
def deform(
|
def deform(
|
||||||
image: Image.Image,
|
image: Image.Image,
|
||||||
deformer: _SupportsGetMesh,
|
deformer: SupportsGetMesh,
|
||||||
resample: int = Image.Resampling.BILINEAR,
|
resample: int = Image.Resampling.BILINEAR,
|
||||||
) -> Image.Image:
|
) -> Image.Image:
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in New Issue
Block a user