BYPASS SHELL BY ./RAZORGANZ
Server: nginx/1.20.1
System: Linux iZdzfnv9mwfppeZ 5.10.134-19.2.al8.x86_64 #1 SMP Wed Oct 29 22:47:09 CST 2025 x86_64
User: apache (48)
PHP: 8.2.30
Disabled: NONE
Upload Files
File: //usr/local/lib64/python3.6/site-packages/PIL/__pycache__/GimpGradientFile.cpython-36.pyc
3

Zƍh
�@s�dZddlmZmZmZmZddlmZdZdd�Z	dd	�Z
d
d�Zdd
�Zdd�Z
e	e
eee
gZGdd�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�����|�=cCsR||kr"|tkrdSd||Sn,||}d|}|tkr>dSdd||SdS)Ngg�?g�?)�EPSILON)�middle�pos�r�@/usr/local/lib64/python3.6/site-packages/PIL/GimpGradientFile.py�linearsr
cCs|td�tt|t��S)Ng�?)r�maxr)r	r
rrr�curved.srcCs$ttdtt||��ddS)Ng@g�?)rrr
)r	r
rrr�sine2srcCstdt||�dd�S)Ng�?�)rr
)r	r
rrr�sphere_increasing6srcCsdtdt||�d�S)Ng�?r)rr
)r	r
rrr�sphere_decreasing:src@seZdZdZddd�ZdS)�GradientFileN�cCsvg}d}|j|\}}}}}}	�xFt|�D�]8}
|
|d}x*||krf|d7}|j|\}}}}}}	q>W||}|tkr�|	dd�}
n|	||||||�}
ttd|d|d|
|dd��}ttd|d|d|
|dd��}ttd|d|d|
|dd��}ttd|d|d|
|dd��}|j||||�q*Wdj|�dfS)	Nrrg�?�r��ZRGBA)�gradient�rangerr�int�append�join)�self�entriesZpalette�ix�x0�x1�xm�rgb0�rgb1�segment�i�x�wZscale�r�g�b�arrr�
getpaletteFs$
,,,,zGradientFile.getpalette)r)�__name__�
__module__�__qualname__rr.rrrrrBsrc@seZdZdZdd�ZdS)�GimpGradientFilez(File handler for GIMP's gradient format.cCs�|j�dd�dkrtd��|j�}|jd�r:|j�j�}t|�}g}x�t|�D]�}|j�j�}dd�|dd�D�}|d|d	}}	|d
}
|dd�}|dd�}tt|d�}
t|d
�}|dkr�td��|j	||	|
|||
f�qPW||_
dS)N�
s
GIMP Gradientznot a GIMP gradient filesName: cSsg|]}t|��qSr)�float)�.0r(rrr�
<listcomp>}sz-GimpGradientFile.__init__.<locals>.<listcomp>�rrrr��zcannot handle HSV colour space)�readline�SyntaxError�
startswith�striprr�split�SEGMENTS�OSErrorrr)r�fp�line�countrr'�sr)r!r"r#r$r%r&Zcspacerrr�__init__ks(
zGimpGradientFile.__init__N)r/r0r1�__doc__rErrrrr2hsr2N)rF�mathrrrr�_binaryrrr
rrrrr?rr2rrrr�<module>s&