o
    á©Zh7  ã                   @  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„Zd	S )Ú_EnhanceúImage.ImageÚimageÚ
degenerateÚfactorÚfloatÚ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   úG/var/www/html/lang_env/lib/python3.10/site-packages/PIL/ImageEnhance.pyÚenhance   s   z_Enhance.enhanceN)r   r   r   r   )Ú__name__Ú
__module__Ú__qualname__Ú__annotations__r   r   r   r   r   r      s   
 r   c                   @  ó   e Zd ZdZ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	   r   r   ÚNonec                 C  s8   || _ d| _d| ¡ v 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   r   ©r   r   r   Ú__doc__r    r   r   r   r   r   +   s    r   c                   @  r   )
ÚContrastzòAdjust 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   r   c                 C  sd   || _ tt | d¡¡jd d ƒ}t d|j|¡ |j	¡| _
d| ¡ v r0| j
 | d¡¡ d S 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   r$   =   ó    r$   c                   @  r   )
Ú
BrightnesszÅAdjust 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   r   c                 C  s@   || _ t |j|jd¡| _d| ¡ v r| j | d¡¡ d S 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   r,   N   r+   r,   c                   @  r   )
Ú	SharpnesszðAdjust 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   r   c                 C  s:   || _ | tj¡| _d| ¡ v r| j | d¡¡ d S 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   r-   ^   r+   r-   N)Ú
__future__r   Ú r   r   r   r   r   r$   r,   r-   r   r   r   r   Ú<module>   s   