
     f7                        d dl mZ ddlmZmZmZ  G d d          Z G d de          Z G d d	e          Z G d
 de          Z	 G d de          Z
dS )    )annotations   )ImageImageFilter	ImageStatc                  ,    e Zd ZU ded<   ded<   d	dZdS )
_EnhanceImage.Imageimage
degeneratefactorfloatreturnc                B    t          j        | 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   s     S/var/www/api.educacionweb.es/myenv/lib/python3.11/site-packages/PIL/ImageEnhance.pyenhancez_Enhance.enhance   s     {4?DJ???    N)r   r   r   r
   )__name__
__module____qualname____annotations__r    r   r   r	   r	      sH         @ @ @ @ @ @r   r	   c                      e Zd ZdZ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                    || _         d| _        d|                                v rd| _        |                    | j                                      |j                  | _        d S )NLALA)r   intermediate_modegetbandsconvertmoder   r   r   s     r   __init__zColor.__init__4   sX    
!$%..""""%)D"--(>??GG
SSr   Nr   r
   r   r   r   r   r   __doc__r'   r   r   r   r   r   +   s8         T T T T T Tr   r   c                      e Zd ZdZ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   r   c                   || _         t          t          j        |                    d                    j        d         dz             }t          j        d|j        |                              |j	                  | _
        d|                                v r/| j
                            |                    d                     d S d S )Nr   r   g      ?r    )r   intr   Statr$   meanr   newsizer%   r   r#   putalpha
getchannel)r   r   r0   s      r   r'   zContrast.__init__E   s    
9>%--"4"455:1=CDD)CT::BB5:NN%..""""O$$U%5%5c%:%:;;;;; #"r   Nr(   r)   r   r   r   r,   r,   =   s2         < < < < < <r   r,   c                      e Zd ZdZ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   r   c                    || _         t          j        |j        |j        d          | _        d|                                v r/| j                            |                    d                     d S d S )Nr   r    )	r   r   r1   r%   r2   r   r#   r3   r4   r&   s     r   r'   zBrightness.__init__V   si    
)EJ
A>>%..""""O$$U%5%5c%:%:;;;;; #"r   Nr(   r)   r   r   r   r6   r6   N   2         < < < < < <r   r6   c                      e Zd ZdZ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   r   c                    || _         |                    t          j                  | _        d|                                v r/| j                            |                    d                     d S d S )Nr    )r   filterr   SMOOTHr   r#   r3   r4   r&   s     r   r'   zSharpness.__init__f   sf    
,,{'9::%..""""O$$U%5%5c%:%:;;;;; #"r   Nr(   r)   r   r   r   r:   r:   ^   r8   r   r:   N)
__future__r    r   r   r   r	   r   r,   r6   r:   r   r   r   <module>r@      s!  ( # " " " " " + + + + + + + + + +@ @ @ @ @ @ @ @$T T T T TH T T T$< < < < <x < < <"< < < < < < < < < < < < < < < < < <r   