U
    ?h7                     @  sr   d dl mZ ddlmZmZmZ G dd dZG dd deZG dd	 d	eZG d
d deZ	G dd deZ
dS )    )annotations   )ImageImageFilter	ImageStatc                   @  s.   e Zd ZU ded< ded< dddddZdS )	_EnhanceImage.Imageimage
degeneratefloat)factorreturnc                 C  s   t | j| j|S )a  
        Returns an enhanced image.

        :param factor: A floating point value controlling the enhancement.
                       Factor 1.0 always returns a copy of the original image,
                       lower factors mean less color (brightness, contrast,
                       etc), and higher values more. There are no restrictions
                       on this value.
        :rtype: :py:class:`~PIL.Image.Image`
        )r   blendr
   r	   )selfr    r   B/var/www/html/venv/lib/python3.8/site-packages/PIL/ImageEnhance.pyenhance   s    z_Enhance.enhanceN)__name__
__module____qualname____annotations__r   r   r   r   r   r      s   
r   c                   @  s    e Zd ZdZdddddZdS )Colora  Adjust image color balance.

    This class can be used to adjust the colour balance of an image, in
    a manner similar to the controls on a colour TV set. An enhancement
    factor of 0.0 gives a black and white image. A factor of 1.0 gives
    the original image.
    r   Noner	   r   c                 C  s8   || _ d| _d| krd| _|| j|j| _d S )NLAZLA)r	   Zintermediate_modegetbandsconvertmoder
   r   r	   r   r   r   __init__4   s
    zColor.__init__Nr   r   r   __doc__r    r   r   r   r   r   +   s   r   c                   @  s    e Zd ZdZdddddZdS )ContrastzAdjust image contrast.

    This class can be used to control the contrast of an image, similar
    to the contrast control on a TV set. An enhancement factor of 0.0
    gives a solid gray image. A factor of 1.0 gives the original image.
    r   r   r   c                 C  s`   || _ tt|djd d }td|j||j	| _
d| kr\| j
|d d S )Nr   r   g      ?r   )r	   intr   ZStatr   meanr   newsizer   r
   r   putalpha
getchannel)r   r	   r%   r   r   r   r    E   s
    zContrast.__init__Nr!   r   r   r   r   r#   =   s   r#   c                   @  s    e Zd ZdZdddddZdS )
BrightnesszAdjust image brightness.

    This class can be used to control the brightness of an image.  An
    enhancement factor of 0.0 gives a black image. A factor of 1.0 gives the
    original image.
    r   r   r   c                 C  s<   || _ t|j|jd| _d| kr8| j|d d S )Nr   r   )	r	   r   r&   r   r'   r
   r   r(   r)   r   r   r   r   r    V   s    zBrightness.__init__Nr!   r   r   r   r   r*   N   s   r*   c                   @  s    e Zd ZdZdddddZdS )	SharpnesszAdjust image sharpness.

    This class can be used to adjust the sharpness of an image. An
    enhancement factor of 0.0 gives a blurred image, a factor of 1.0 gives the
    original image, and a factor of 2.0 gives a sharpened image.
    r   r   r   c                 C  s6   || _ |tj| _d| kr2| j|d d S )Nr   )r	   filterr   ZSMOOTHr
   r   r(   r)   r   r   r   r   r    f   s    zSharpness.__init__Nr!   r   r   r   r   r+   ^   s   r+   N)
__future__r    r   r   r   r   r   r#   r*   r+   r   r   r   r   <module>   s   