
    :h+                        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
y)    )annotations   )ImageImageFilter	ImageStatc                  *    e Zd ZU ded<   ded<   ddZy)_EnhanceImage.Imageimage
degeneratec                X    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   )selffactors     N/var/www/urcfiles/bundle/venv/lib/python3.12/site-packages/PIL/ImageEnhance.pyenhancez_Enhance.enhance   s     {{4??DJJ??    N)r   floatreturnr
   )__name__
__module____qualname____annotations__r    r   r   r	   r	      s    @r   r	   c                      e Zd ZdZddZy)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.
    c                    || _         d| _        d|j                         v rd| _        | j                  |j                  k7  r4|j	                  | j                        j	                  |j                        }|| _        y )NLALA)r   intermediate_modegetbandsmodeconvertr   r   r   s     r   __init__zColor.__init__4   sd    
!$%..""%)D"!!UZZ/MM$"8"89AA%**MEr   Nr   r
   r   Noner   r   r   __doc__r&   r   r   r   r   r   +   s     r   r   c                      e Zd ZdZddZy)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.
    c                ^   || _         |j                  dk7  r|j                  d      }t        t	        j
                  |      j                  d   dz         }t        j                  d|j                  |      | _
        | j                  j                  | j                   j                  k7  r4| j                  j                  | j                   j                        | _
        d| j                   j                         v r5| j                  j                  | j                   j                  d             y y )Nr   r   g      ?r   )r   r#   r$   intr   Statmeanr   newsizer   r"   putalpha
getchannel)r   r   r0   s      r   r&   zContrast.__init__G   s    
::MM#&E9>>%(--a0367))CT:??4::??2"oo55djjooFDO$**%%''OO$$TZZ%:%:3%?@ (r   Nr'   r)   r   r   r   r,   r,   ?   s    
Ar   r,   c                      e Zd ZdZddZy)
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.
    c                    || _         t        j                  |j                  |j                  d      | _        d|j                         v r+| j
                  j                  |j                  d             y y )Nr   r   )	r   r   r1   r#   r2   r   r"   r3   r4   r%   s     r   r&   zBrightness.__init__\   sV    
))EJJ

A>%..""OO$$U%5%5c%:; #r   Nr'   r)   r   r   r   r6   r6   T       <r   r6   c                      e Zd ZdZddZy)	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.
    c                    || _         |j                  t        j                        | _        d|j                         v r+| j                  j                  |j                  d             y y )Nr   )r   filterr   SMOOTHr   r"   r3   r4   r%   s     r   r&   zSharpness.__init__l   sP    
,,{'9'9:%..""OO$$U%5%5c%:; #r   Nr'   r)   r   r   r   r:   r:   d   r8   r   r:   N)
__future__r    r   r   r   r	   r   r,   r6   r:   r   r   r   <module>r@      sN   ( # + +@ @$ H  (Ax A*< < < <r   