%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/PIL/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/PIL/__pycache__/GimpGradientFile.cpython-312.pyc

�

��ef
���dZddlmZddlmZmZmZmZddlm	Z	dZ
	d�Zd�Zd	�Z
d
�Zd�Zeee
eegZ	Gd�d
�ZGd�de�Zy)z�
Stuff to translate curve segments to palette values (derived from
the corresponding code in GIMP, written by Federico Mena Quintero.
See the GIMP distribution for more information.)
�)�annotations)�log�pi�sin�sqrt�)�o8g�����|�=c�n�||kr|tkryd|z|zS||z
}d|z
}|tkrydd|z|zzS)Ng��?��?)�EPSILON��middle�poss  �6/usr/lib/python3/dist-packages/PIL/GimpGradientFile.py�linearrsT��
�f�}��G�����9�v�%�%��F�l���v����G�����s��V�+�+�+�c�R�|td�tt|t��zzS)Nr)r�maxr
rs  r�curvedr.s"���3�s�8�c�#�f�g�"6�7�7�8�8rc�\�ttdztt||�zz�dzdzS)Ng@r)rrrrs  r�siner2s.���"��s��b�6�&�#�#6�6�6�7�#�=��D�Drc�>�tdt||�dz
dzz
�S�Nr��rrrs  r�sphere_increasingr6s#����v�f�c�*�S�0�Q�6�6�7�7rc�>�dtdt||�dzz
�z
Srrrs  r�sphere_decreasingr:s#����c�F�6�3�/�1�4�4�5�5�5rc��eZdZdZdd�Zy)�GradientFileNc	���g}d}|j|\}}}}}}	t|�D�](}
|
|dz
z}||kr!|dz
}|j|\}}}}}}	||kr�!||z
}|tkr
|	dd�}
n|	||z
|z||z
|z�}
tt	d|d|dz
|
z|dzzdz��}tt	d|d|dz
|
z|dzzdz��}tt	d|d|dz
|
z|dzzdz��}tt	d|d|dz
|
z|dzzdz��}|j||z|z|z���+dj
|�dfS)	Nrrr�r�r�RGBA)�gradient�ranger
r	�int�append�join)�self�entries�palette�ix�x0�x1�xm�rgb0�rgb1�segment�i�x�w�scale�r�g�b�as                  r�
getpalettezGradientFile.getpaletteEs�����
��*.�-�-��*;�'��B��D�$���w��	*�A��W�q�[�!�A��q�&��a���26�-�-��2C�/��B��D�$���q�&��R��A��7�{���S�)����b��A�
��B��!�|�<���3�s�t�A�w��a��0�E�9�D��G�C�D�s�J�K�L�A��3�s�t�A�w��a��0�E�9�D��G�C�D�s�J�K�L�A��3�s�t�A�w��a��0�E�9�D��G�C�D�s�J�K�L�A��3�s�t�A�w��a��0�E�9�D��G�C�D�s�J�K�L�A�
�N�N�1�q�5�1�9�q�=�)�+	*�.�x�x�� �&�(�(r)�)�__name__�
__module__�__qualname__r&r=�rrr!r!Bs���H�)rr!c��eZdZdZd�Zy)�GimpGradientFilez(File handler for GIMP's gradient format.c	�V�|j�dddk7r
d}t|��|j�}|jd�r|j�j�}t	|�}g}t|�D]�}|j�j
�}|ddD�cgc]
}t|���}	}|	d|	d}}
|	d}|	d	d
}
|	d
d}tt	|d�}t	|d�}|dk7r
d}t|��|j|
|||
||f���||_ycc}w)
N�
s
GIMP Gradientznot a GIMP gradient filesName: �rrrr$��zcannot handle HSV colour space)�readline�SyntaxError�
startswith�stripr(r'�split�float�SEGMENTS�OSErrorr)r&)r+�fp�msg�line�countr&r5�sr6r7r/r0r1r2r3r4�cspaces                 r�__init__zGimpGradientFile.__init__hs3��
�;�;�=��"��!1�1�,�C��c�"�"��{�{�}���?�?�9�%��;�;�=�&�&�(�D��D�	�����u��	?�A����
�#�#�%�A�#$�S�b�6�*�a��q��*�A�*��q�T�1�Q�4��B��1��B��Q�q�6�D��Q�r�7�D��s�1�R�5�z�*�G���2��Z�F���{�6���c�l�"��O�O�R��R��t�W�=�>�!	?�$!��
��!+s�#D&N)r?r@rA�__doc__rXrBrrrDrDes
��2�!!rrDN)rY�
__future__r�mathrrrr�_binaryr	r
rrrrrrPr!rDrBrr�<module>r]sh�� �
#�#�#��
���,�9�E�8�6�
�F�D�"3�5F�G��� )� )�F$!�|�$!r

Zerion Mini Shell 1.0