Your IP : 216.73.216.213


Current Path : /opt/alt/python35/lib64/python3.5/site-packages/PIL/__pycache__/
Upload File :
Current File : //opt/alt/python35/lib64/python3.5/site-packages/PIL/__pycache__/ImageEnhance.cpython-35.opt-1.pyc



�ʴWq�@s�ddlmZmZmZGdd�de�ZGdd�de�ZGdd�de�ZGdd	�d	e�ZGd
d�de�Z	dS)
�)�Image�ImageFilter�	ImageStatc@seZdZdd�ZdS)�_EnhancecCstj|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`
        )rZblend�
degenerate�image)�selfZfactor�r	�C/opt/alt/python35/lib64/python3.5/site-packages/PIL/ImageEnhance.py�enhancesz_Enhance.enhanceN)�__name__�
__module__�__qualname__rr	r	r	r
rsrc@s"eZdZdZdd�ZdS)�ColoraAdjust 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.
    cCsR||_d|_d|j�kr-d|_|j|j�j|j�|_dS)N�L�AZLA)rZintermediate_mode�getbands�convert�moder)rrr	r	r
�__init__0s
			zColor.__init__N)rr
r�__doc__rr	r	r	r
r(src@s"eZdZdZdd�ZdS)�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.
    cCs�||_ttj|jd��jdd�}tjd|j|�j|j	�|_
d|j�kr�|j
j|j
�d�dS)Nrrg�?r����)r�intrZStatr�meanr�new�sizerrr�putalpha�split)rrrr	r	r
r@s
	)'zContrast.__init__N)rr
rrrr	r	r	r
r9src@s"eZdZdZdd�ZdS)�
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.
    cCsW||_tj|j|jd�|_d|j�krS|jj|j�d�dS)Nrrrr)	rrrrrrrrr)rrr	r	r
rPs	zBrightness.__init__N)rr
rrrr	r	r	r
r Isr c@s"eZdZdZdd�ZdS)�	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.
    cCsN||_|jtj�|_d|j�krJ|jj|j�d�dS)Nrrr)r�filterrZSMOOTHrrrr)rrr	r	r
r_s	zSharpness.__init__N)rr
rrrr	r	r	r
r!Xsr!N)
ZPILrrr�objectrrrr r!r	r	r	r
�<module>s