Merge pull request #2018 from wiredfool/doc-warnings

Fix documentation warnings, convert params to Sphinx format
This commit is contained in:
wiredfool 2016-07-11 10:49:11 +02:00 committed by GitHub
commit 3df1137c3a
3 changed files with 27 additions and 27 deletions

View File

@ -50,8 +50,8 @@ class ImageDraw(object):
""" """
Create a drawing instance. Create a drawing instance.
@param im The image to draw in. :param im: The image to draw in.
@param mode Optional mode to use for color values. For RGB :param mode: Optional mode to use for color values. For RGB
images, this argument can be RGB or RGBA (to blend the images, this argument can be RGB or RGBA (to blend the
drawing into the image). For all other modes, this argument drawing into the image). For all other modes, this argument
must be the same as the image mode. If omitted, the mode must be the same as the image mode. If omitted, the mode
@ -286,8 +286,8 @@ def Draw(im, mode=None):
""" """
A simple 2D drawing interface for PIL images. A simple 2D drawing interface for PIL images.
@param im The image to draw in. :param im: The image to draw in.
@param mode Optional mode to use for color values. For RGB :param mode: Optional mode to use for color values. For RGB
images, this argument can be RGB or RGBA (to blend the images, this argument can be RGB or RGBA (to blend the
drawing into the image). For all other modes, this argument drawing into the image). For all other modes, this argument
must be the same as the image mode. If omitted, the mode must be the same as the image mode. If omitted, the mode
@ -310,9 +310,9 @@ def getdraw(im=None, hints=None):
(Experimental) A more advanced 2D drawing interface for PIL images, (Experimental) A more advanced 2D drawing interface for PIL images,
based on the WCK interface. based on the WCK interface.
@param im The image to draw in. :param im: The image to draw in.
@param hints An optional list of hints. :param hints: An optional list of hints.
@return A (drawing context, drawing resource factory) tuple. :returns: A (drawing context, drawing resource factory) tuple.
""" """
# FIXME: this needs more work! # FIXME: this needs more work!
# FIXME: come up with a better 'hints' scheme. # FIXME: come up with a better 'hints' scheme.
@ -333,10 +333,10 @@ def floodfill(image, xy, value, border=None):
""" """
(experimental) Fills a bounded region with a given color. (experimental) Fills a bounded region with a given color.
@param image Target image. :param image: Target image.
@param xy Seed position (a 2-item coordinate tuple). :param xy: Seed position (a 2-item coordinate tuple).
@param value Fill color. :param value: Fill color.
@param border Optional border value. If given, the region consists of :param border: Optional border value. If given, the region consists of
pixels with a color different from the border color. If not given, pixels with a color different from the border color. If not given,
the region consists of pixels having the same color as the seed the region consists of pixels having the same color as the seed
pixel. pixel.

View File

@ -42,10 +42,10 @@ def show(image, title=None, **options):
""" """
Display a given image. Display a given image.
@param image An image object. :param image: An image object.
@param title Optional title. Not all viewers can display the title. :param title: Optional title. Not all viewers can display the title.
@param **options Additional viewer options. :param \**options: Additional viewer options.
@return True if a suitable viewer was found, false otherwise. :returns: True if a suitable viewer was found, false otherwise.
""" """
for viewer in _viewers: for viewer in _viewers:
if viewer.show(image, title=title, **options): if viewer.show(image, title=title, **options):

View File

@ -41,10 +41,10 @@ class AffineTransform(Transform):
This function can be used to scale, translate, rotate, and shear the This function can be used to scale, translate, rotate, and shear the
original image. original image.
@def AffineTransform(matrix) See :py:meth:`~PIL.Image.Image.transform`
@param matrix A 6-tuple (a, b, c, d, e, f) containing the first two rows
:param matrix: A 6-tuple (a, b, c, d, e, f) containing the first two rows
from an affine transform matrix. from an affine transform matrix.
@see Image#Image.transform
""" """
method = Image.AFFINE method = Image.AFFINE
@ -62,10 +62,10 @@ class ExtentTransform(Transform):
rectangle in the current image. It is slightly slower than crop, but about rectangle in the current image. It is slightly slower than crop, but about
as fast as a corresponding resize operation. as fast as a corresponding resize operation.
@def ExtentTransform(bbox) See :py:meth:`~PIL.Image.Image.transform`
@param bbox A 4-tuple (x0, y0, x1, y1) which specifies two points in the
:param bbox: A 4-tuple (x0, y0, x1, y1) which specifies two points in the
input image's coordinate system. input image's coordinate system.
@see Image#Image.transform
""" """
method = Image.EXTENT method = Image.EXTENT
@ -77,11 +77,11 @@ class QuadTransform(Transform):
Maps a quadrilateral (a region defined by four corners) from the image to a Maps a quadrilateral (a region defined by four corners) from the image to a
rectangle of the given size. rectangle of the given size.
@def QuadTransform(xy) See :py:meth:`~PIL.Image.Image.transform`
@param xy An 8-tuple (x0, y0, x1, y1, x2, y2, y3, y3) which contain the
: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 upper left, lower left, lower right, and upper right corner of the
source quadrilateral. source quadrilateral.
@see Image#Image.transform
""" """
method = Image.QUAD method = Image.QUAD
@ -91,9 +91,9 @@ class MeshTransform(Transform):
Define a mesh image transform. A mesh transform consists of one or more Define a mesh image transform. A mesh transform consists of one or more
individual quad transforms. individual quad transforms.
@def MeshTransform(data) See :py:meth:`~PIL.Image.Image.transform`
@param data A list of (bbox, quad) tuples.
@see Image#Image.transform :param data: A list of (bbox, quad) tuples.
""" """
method = Image.MESH method = Image.MESH