U
    Evf
  ć                   @  s¦  d dl mZ ddlmZ ddddddZddd	d
dZddd	ddZddddddZddddddZddddddZ	ddddddZ
ddddddZddddddZddddddZddddddZd;ddd d dd!d"d#Zd<ddd d dd!d$d%Zddddd&d'Zddddd(d)Zddddd*d+Zddddd,d-Zddddd.d/Zddd dd0d1d2Zddddd3d4d5Zd=ddd7dd8d9d:Zd6S )>é    )Śannotationsé   )ŚImagezImage.ImageŚint)ŚimageŚvalueŚreturnc                 C  s   t  d| j|”S )zVFill a channel with a given gray level.

    :rtype: :py:class:`~PIL.Image.Image`
    ŚL)r   ŚnewŚsize)r   r   © r   ś2/tmp/pip-unpacked-wheel-ciywl2yd/PIL/ImageChops.pyŚconstant   s    r   )r   r   c                 C  s   |   ” S )ziCopy a channel. Alias for :py:meth:`PIL.Image.Image.copy`.

    :rtype: :py:class:`~PIL.Image.Image`
    )Ścopy©r   r   r   r   Ś	duplicate    s    r   c                 C  s   |   ”  |  | j ” ”S )zl
    Invert an image (channel). ::

        out = MAX - image

    :rtype: :py:class:`~PIL.Image.Image`
    )ŚloadŚ_newŚimZchop_invertr   r   r   r   Śinvert)   s    	r   )Śimage1Śimage2r   c                 C  s$   |   ”  |  ”  |  | j |j””S )z½
    Compares the two images, pixel by pixel, and returns a new image containing
    the lighter values. ::

        out = max(image1, image2)

    :rtype: :py:class:`~PIL.Image.Image`
    )r   r   r   Zchop_lighter©r   r   r   r   r   Ślighter6   s    
r   c                 C  s$   |   ”  |  ”  |  | j |j””S )z¼
    Compares the two images, pixel by pixel, and returns a new image containing
    the darker values. ::

        out = min(image1, image2)

    :rtype: :py:class:`~PIL.Image.Image`
    )r   r   r   Zchop_darkerr   r   r   r   ŚdarkerE   s    
r   c                 C  s$   |   ”  |  ”  |  | j |j””S )z²
    Returns the absolute value of the pixel-by-pixel difference between the two
    images. ::

        out = abs(image1 - image2)

    :rtype: :py:class:`~PIL.Image.Image`
    )r   r   r   Zchop_differencer   r   r   r   Ś
differenceT   s    
r   c                 C  s$   |   ”  |  ”  |  | j |j””S )a  
    Superimposes two images on top of each other.

    If you multiply an image with a solid black image, the result is black. If
    you multiply with a solid white image, the image is unaffected. ::

        out = image1 * image2 / MAX

    :rtype: :py:class:`~PIL.Image.Image`
    )r   r   r   Zchop_multiplyr   r   r   r   Śmultiplyc   s    r   c                 C  s$   |   ”  |  ”  |  | j |j””S )zŖ
    Superimposes two inverted images on top of each other. ::

        out = MAX - ((MAX - image1) * (MAX - image2) / MAX)

    :rtype: :py:class:`~PIL.Image.Image`
    )r   r   r   Zchop_screenr   r   r   r   Śscreent   s    	r   c                 C  s$   |   ”  |  ”  |  | j |j””S )z
    Superimposes two images on top of each other using the Soft Light algorithm

    :rtype: :py:class:`~PIL.Image.Image`
    )r   r   r   Zchop_soft_lightr   r   r   r   Ś
soft_light   s    r   c                 C  s$   |   ”  |  ”  |  | j |j””S )z
    Superimposes two images on top of each other using the Hard Light algorithm

    :rtype: :py:class:`~PIL.Image.Image`
    )r   r   r   Zchop_hard_lightr   r   r   r   Ś
hard_light   s    r   c                 C  s$   |   ”  |  ”  |  | j |j””S )z|
    Superimposes two images on top of each other using the Overlay algorithm

    :rtype: :py:class:`~PIL.Image.Image`
    )r   r   r   Zchop_overlayr   r   r   r   Śoverlay   s    r    ē      š?Śfloat)r   r   ŚscaleŚoffsetr   c                 C  s(   |   ”  |  ”  |  | j |j||””S )zé
    Adds two images, dividing the result by scale and adding the
    offset. If omitted, scale defaults to 1.0, and offset to 0.0. ::

        out = ((image1 + image2) / scale + offset)

    :rtype: :py:class:`~PIL.Image.Image`
    )r   r   r   Zchop_add©r   r   r#   r$   r   r   r   Śadd¦   s    r&   c                 C  s(   |   ”  |  ”  |  | j |j||””S )zī
    Subtracts two images, dividing the result by scale and adding the offset.
    If omitted, scale defaults to 1.0, and offset to 0.0. ::

        out = ((image1 - image2) / scale + offset)

    :rtype: :py:class:`~PIL.Image.Image`
    )r   r   r   Zchop_subtractr%   r   r   r   Śsubtract·   s    r'   c                 C  s$   |   ”  |  ”  |  | j |j””S )zAdd two images, without clipping the result. ::

        out = ((image1 + image2) % MAX)

    :rtype: :py:class:`~PIL.Image.Image`
    )r   r   r   Zchop_add_modulor   r   r   r   Ś
add_moduloČ   s    r(   c                 C  s$   |   ”  |  ”  |  | j |j””S )zSubtract two images, without clipping the result. ::

        out = ((image1 - image2) % MAX)

    :rtype: :py:class:`~PIL.Image.Image`
    )r   r   r   Zchop_subtract_modulor   r   r   r   Śsubtract_moduloÕ   s    r)   c                 C  s$   |   ”  |  ”  |  | j |j””S )aj  Logical AND between two images.

    Both of the images must have mode "1". If you would like to perform a
    logical AND on an image with a mode other than "1", try
    :py:meth:`~PIL.ImageChops.multiply` instead, using a black-and-white mask
    as the second image. ::

        out = ((image1 and image2) % MAX)

    :rtype: :py:class:`~PIL.Image.Image`
    )r   r   r   Zchop_andr   r   r   r   Ślogical_andā   s    r*   c                 C  s$   |   ”  |  ”  |  | j |j””S )z¦Logical OR between two images.

    Both of the images must have mode "1". ::

        out = ((image1 or image2) % MAX)

    :rtype: :py:class:`~PIL.Image.Image`
    )r   r   r   Zchop_orr   r   r   r   Ś
logical_orō   s    
r+   c                 C  s$   |   ”  |  ”  |  | j |j””S )z³Logical XOR between two images.

    Both of the images must have mode "1". ::

        out = ((bool(image1) != bool(image2)) % MAX)

    :rtype: :py:class:`~PIL.Image.Image`
    )r   r   r   Zchop_xorr   r   r   r   Ślogical_xor  s    
r,   )r   r   Śalphar   c                 C  s   t  | ||”S )zBlend images using constant transparency weight. Alias for
    :py:func:`PIL.Image.blend`.

    :rtype: :py:class:`~PIL.Image.Image`
    )r   Śblend)r   r   r-   r   r   r   r.     s    r.   )r   r   Śmaskr   c                 C  s   t  | ||”S )zCreate composite using transparency mask. Alias for
    :py:func:`PIL.Image.composite`.

    :rtype: :py:class:`~PIL.Image.Image`
    )r   Ś	composite)r   r   r/   r   r   r   r0     s    	r0   Nz
int | None)r   ŚxoffsetŚyoffsetr   c                 C  s(   |dkr|}|   ”  |  | j ||””S )a  Returns a copy of the image where data has been offset by the given
    distances. Data wraps around the edges. If ``yoffset`` is omitted, it
    is assumed to be equal to ``xoffset``.

    :param image: Input image.
    :param xoffset: The horizontal distance.
    :param yoffset: The vertical distance.  If omitted, both
        distances are set to the same value.
    :rtype: :py:class:`~PIL.Image.Image`
    N)r   r   r   r$   )r   r1   r2   r   r   r   r$   (  s    r$   )r!   r   )r!   r   )N)Ś
__future__r   Ś r   r   r   r   r   r   r   r   r   r   r   r    r&   r'   r(   r)   r*   r+   r,   r.   r0   r$   r   r   r   r   Ś<module>   s4   		   ’   ’
