HEX
Server: Apache
System: Linux vmi1259262.contaboserver.net 5.15.0-170-generic #180-Ubuntu SMP Fri Jan 9 16:10:31 UTC 2026 x86_64
User: aqarnomics (1008)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: //lib/python3/dist-packages/PIL/__pycache__/GimpGradientFile.cpython-310.pyc
o

Z#�a
�@s�dZddlmZmZmZmZddlmZdZ	dd�Z	dd	�Z
d
d�Zdd
�Zdd�Z
e	e
eee
gZ	Gdd�d�ZGdd�de�ZdS)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.)
�)�log�pi�sin�sqrt�)�o8g�����|�=cCsL||kr|tkr
dSd||S||}d|}|tkrdSdd||S)Ng��?��?)�EPSILON��middle�pos�r�6/usr/lib/python3/dist-packages/PIL/GimpGradientFile.py�linearsrcCs|td�tt|t��S)Nr)r�maxr
rrrr�curved.�rcCs$ttdtt||��ddS)Ng@r	)rrrrrrr�sine2s$rcCstdt||�dd�S�Nr	��rrrrrr�sphere_increasing6rrcCsdtdt||�d�Srrrrrr�sphere_decreasing:rrc@seZdZdZddd�ZdS)�GradientFileN�cCspg}d}|j|\}}}}}}	t|�D]�}
|
|d}||kr2|d7}|j|\}}}}}}	||ks||}|tkr@|	dd�}
n
|	||||||�}
ttd|d|d|
|dd��}ttd|d|d|
|dd��}ttd|d|d|
|dd��}ttd|d|d|
|dd��}|�||||�qd�|�dfS)	Nrrr�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�arrr�
getpaletteFs&�,,,,zGradientFile.getpalette)r)�__name__�
__module__�__qualname__r r7rrrrrBsrc@seZdZdZdd�ZdS)�GimpGradientFilez(File handler for GIMP's gradient format.c	Cs�|��dd�dkrtd��|��}|�d�r|����}t|�}g}t|�D]M}|����}dd�|dd�D�}|d|d	}}	|d
}
|dd�}|dd�}tt|d�}
t|d
�}|dkritd��|�	||	|
|||
f�q'||_
dS)N�
s
GIMP Gradientznot a GIMP gradient filesName: cSsg|]}t|��qSr)�float)�.0r0rrr�
<listcomp>}sz-GimpGradientFile.__init__.<locals>.<listcomp>�rrrr��zcannot handle HSV colour space)�readline�SyntaxError�
startswith�stripr"r!�split�SEGMENTS�OSErrorr#r )r%�fp�line�countr r/�sr1r)r*r+r,r-r.�cspacerrr�__init__ks(

zGimpGradientFile.__init__N)r8r9r:�__doc__rOrrrrr;hsr;N)rP�mathrrrr�_binaryrr
rrrrrrHrr;rrrr�<module>s&