ó
î Xc           @   s   d  d l  m Z m Z m Z d d d     YZ d e f d     YZ d e f d     YZ d e f d	     YZ d
 e f d     YZ d S(   iÿÿÿÿ(   t   Imaget   ImageFiltert	   ImageStatt   _Enhancec           B   s   e  Z d    Z RS(   c         C   s   t  j |  j |  j |  S(   sµ  
        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    t   blendt
   degeneratet   image(   t   selft   factor(    (    s4   /usr/lib/python2.7/dist-packages/PIL/ImageEnhance.pyt   enhance   s    (   t   __name__t
   __module__R	   (    (    (    s4   /usr/lib/python2.7/dist-packages/PIL/ImageEnhance.pyR      s   t   Colorc           B   s   e  Z d  Z d   Z RS(   s  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(   Nt   Lt   At   LA(   R   t   intermediate_modet   getbandst   convertt   modeR   (   R   R   (    (    s4   /usr/lib/python2.7/dist-packages/PIL/ImageEnhance.pyt   __init__0   s
    		(   R
   R   t   __doc__R   (    (    (    s4   /usr/lib/python2.7/dist-packages/PIL/ImageEnhance.pyR   (   s   t   Contrastc           B   s   e  Z d  Z d   Z RS(   sò   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   i    g      à?R   iÿÿÿÿ(   R   t   intR   t   StatR   t   meanR    t   newt   sizeR   R   R   t   putalphat   split(   R   R   R   (    (    s4   /usr/lib/python2.7/dist-packages/PIL/ImageEnhance.pyR   ?   s
    	)'(   R
   R   R   R   (    (    (    s4   /usr/lib/python2.7/dist-packages/PIL/ImageEnhance.pyR   8   s   t
   Brightnessc           B   s   e  Z d  Z d   Z RS(   sÅ   Adjust image brightness.

    This class can be used to control the brighntess 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(   Ni    R   iÿÿÿÿ(	   R   R    R   R   R   R   R   R   R   (   R   R   (    (    s4   /usr/lib/python2.7/dist-packages/PIL/ImageEnhance.pyR   O   s    	(   R
   R   R   R   (    (    (    s4   /usr/lib/python2.7/dist-packages/PIL/ImageEnhance.pyR   H   s   t	   Sharpnessc           B   s   e  Z d  Z d   Z RS(   sð   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   iÿÿÿÿ(   R   t   filterR   t   SMOOTHR   R   R   R   (   R   R   (    (    s4   /usr/lib/python2.7/dist-packages/PIL/ImageEnhance.pyR   ^   s    	(   R
   R   R   R   (    (    (    s4   /usr/lib/python2.7/dist-packages/PIL/ImageEnhance.pyR   W   s   N(    (	   t   PILR    R   R   R   R   R   R   R   (    (    (    s4   /usr/lib/python2.7/dist-packages/PIL/ImageEnhance.pyt   <module>   s
   