Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix documentation warnings, convert params to correct format #2018

Merged
merged 1 commit into from
Jul 11, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
22 changes: 11 additions & 11 deletions PIL/ImageDraw.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ def __init__(self, im, mode=None):
"""
Create a drawing instance.

@param im The image to draw in.
@param mode Optional mode to use for color values. For RGB
:param im: The image to draw in.
:param mode: Optional mode to use for color values. For RGB
images, this argument can be RGB or RGBA (to blend the
drawing into the image). For all other modes, this argument
must be the same as the image mode. If omitted, the mode
Expand Down Expand Up @@ -286,8 +286,8 @@ def Draw(im, mode=None):
"""
A simple 2D drawing interface for PIL images.

@param im The image to draw in.
@param mode Optional mode to use for color values. For RGB
:param im: The image to draw in.
:param mode: Optional mode to use for color values. For RGB
images, this argument can be RGB or RGBA (to blend the
drawing into the image). For all other modes, this argument
must be the same as the image mode. If omitted, the mode
Expand All @@ -310,9 +310,9 @@ def getdraw(im=None, hints=None):
(Experimental) A more advanced 2D drawing interface for PIL images,
based on the WCK interface.

@param im The image to draw in.
@param hints An optional list of hints.
@return A (drawing context, drawing resource factory) tuple.
:param im: The image to draw in.
:param hints: An optional list of hints.
:returns: A (drawing context, drawing resource factory) tuple.
"""
# FIXME: this needs more work!
# FIXME: come up with a better 'hints' scheme.
Expand All @@ -333,10 +333,10 @@ def floodfill(image, xy, value, border=None):
"""
(experimental) Fills a bounded region with a given color.

@param image Target image.
@param xy Seed position (a 2-item coordinate tuple).
@param value Fill color.
@param border Optional border value. If given, the region consists of
:param image: Target image.
:param xy: Seed position (a 2-item coordinate tuple).
:param value: Fill color.
:param border: Optional border value. If given, the region consists of
pixels with a color different from the border color. If not given,
the region consists of pixels having the same color as the seed
pixel.
Expand Down
8 changes: 4 additions & 4 deletions PIL/ImageShow.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ def show(image, title=None, **options):
"""
Display a given image.

@param image An image object.
@param title Optional title. Not all viewers can display the title.
@param **options Additional viewer options.
@return True if a suitable viewer was found, false otherwise.
:param image: An image object.
:param title: Optional title. Not all viewers can display the title.
:param \**options: Additional viewer options.
:returns: True if a suitable viewer was found, false otherwise.
"""
for viewer in _viewers:
if viewer.show(image, title=title, **options):
Expand Down
24 changes: 12 additions & 12 deletions PIL/ImageTransform.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ class AffineTransform(Transform):
This function can be used to scale, translate, rotate, and shear the
original image.

@def AffineTransform(matrix)
@param matrix A 6-tuple (a, b, c, d, e, f) containing the first two rows
See :py:meth:`~PIL.Image.Image.transform`

:param matrix: A 6-tuple (a, b, c, d, e, f) containing the first two rows
from an affine transform matrix.
@see Image#Image.transform
"""
method = Image.AFFINE

Expand All @@ -62,10 +62,10 @@ class ExtentTransform(Transform):
rectangle in the current image. It is slightly slower than crop, but about
as fast as a corresponding resize operation.

@def ExtentTransform(bbox)
@param bbox A 4-tuple (x0, y0, x1, y1) which specifies two points in the
See :py:meth:`~PIL.Image.Image.transform`

:param bbox: A 4-tuple (x0, y0, x1, y1) which specifies two points in the
input image's coordinate system.
@see Image#Image.transform
"""
method = Image.EXTENT

Expand All @@ -77,11 +77,11 @@ class QuadTransform(Transform):
Maps a quadrilateral (a region defined by four corners) from the image to a
rectangle of the given size.

@def QuadTransform(xy)
@param xy An 8-tuple (x0, y0, x1, y1, x2, y2, y3, y3) which contain the
See :py:meth:`~PIL.Image.Image.transform`

:param xy: An 8-tuple (x0, y0, x1, y1, x2, y2, y3, y3) which contain the
upper left, lower left, lower right, and upper right corner of the
source quadrilateral.
@see Image#Image.transform
"""
method = Image.QUAD

Expand All @@ -91,9 +91,9 @@ class MeshTransform(Transform):
Define a mesh image transform. A mesh transform consists of one or more
individual quad transforms.

@def MeshTransform(data)
@param data A list of (bbox, quad) tuples.
@see Image#Image.transform
See :py:meth:`~PIL.Image.Image.transform`

:param data: A list of (bbox, quad) tuples.
"""
method = Image.MESH

Expand Down