î
úÙ Xq  ã               @   sŽ   d  d l  m Z m Z m Z Gd d „  d e ƒ Z Gd d „  d e ƒ Z Gd d „  d e ƒ Z Gd d	 „  d	 e ƒ Z Gd
 d „  d e ƒ Z	 d S)é    )ÚImageÚImageFilterÚ	ImageStatc               @   s   e  Z d  Z d d „  Z d S)Ú_Enhancec             C   s   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   ZblendÚ
degenerateÚimage)ÚselfÚfactor© r
   úM/home/ubuntu/projects/ifolica/lib/python3.4/site-packages/PIL/ImageEnhance.pyÚenhance   s    z_Enhance.enhanceN)Ú__name__Ú
__module__Ú__qualname__r   r
   r
   r
   r   r      s   r   c               @   s"   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.
    c             C   sU   | |  _  d |  _ d | j ƒ  k r0 d |  _ n  | j |  j ƒ j | j ƒ |  _ d  S)NÚLÚAZLA)r   Zintermediate_modeÚgetbandsÚconvertÚmoder   )r   r   r
   r
   r   Ú__init__0   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 „  Z d S)Ú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 grey image. A factor of 1.0 gives the original image.
    c             C   sŒ   | |  _  t t j | j d ƒ ƒ j d d ƒ } t j d | j | ƒ j | j	 ƒ |  _
 d | j ƒ  k rˆ |  j
 j | j ƒ  d ƒ n  d  S)Nr   r   g      à?r   é   éÿÿÿÿ)r   Úintr   ZStatr   Úmeanr   ÚnewÚsizer   r   r   ÚputalphaÚsplit)r   r   r   r
   r
   r   r   @   s
    	)'zContrast.__init__N)r   r   r   r   r   r
   r
   r
   r   r   9   s   r   c               @   s"   e  Z d  Z d Z d d „  Z d S)Ú
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.
    c             C   sZ   | |  _  t j | j | j d ƒ |  _ d | j ƒ  k rV |  j j | j ƒ  d ƒ n  d  S)Nr   r   r   r   )	r   r   r   r   r   r   r   r   r    )r   r   r
   r
   r   r   P   s    	zBrightness.__init__N)r   r   r   r   r   r
   r
   r
   r   r!   I   s   r!   c               @   s"   e  Z d  Z d Z d d „  Z d S)Ú	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.
    c             C   sQ   | |  _  | j t j ƒ |  _ d | j ƒ  k rM |  j j | j ƒ  d ƒ n  d  S)Nr   r   r   )r   Úfilterr   ZSMOOTHr   r   r   r    )r   r   r
   r
   r   r   _   s    	zSharpness.__init__N)r   r   r   r   r   r
   r
   r
   r   r"   X   s   r"   N)
ZPILr   r   r   Úobjectr   r   r   r!   r"   r
   r
   r
   r   Ú<module>   s
   