Skip to content

Commit

Permalink
Added _SupportsGetMesh to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Feb 19, 2024
1 parent e1c5d57 commit c24c771
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/reference/ImageOps.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ only work on L and RGB images.
.. autofunction:: colorize
.. autofunction:: crop
.. autofunction:: scale
.. autoclass:: _SupportsGetMesh
.. autofunction:: deform
.. autofunction:: equalize
.. autofunction:: expand
Expand Down
8 changes: 8 additions & 0 deletions src/PIL/ImageOps.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,14 @@ def scale(


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(
self, image: Image.Image
) -> list[
Expand Down

0 comments on commit c24c771

Please sign in to comment.