+
     iB  c                  s    R t ^ RIHt ^ RIHtHtHtHt ^ RIH	t	H
t
 ^RIHt Rt R R ltR R	 ltR
 R ltR R ltR R lt]]]]].t  ! R R4      t ! R R]4      tR# )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)IOCallable)o8g|=c               $    V ^8  d   QhRRRRRR/#    middlefloatposreturn Zformat   ";/usr/lib64/python3.14/site-packages/PIL/GimpGradientFile.py__annotate__r       s!     , ,5 ,u , ,    c                s    W8:  d   V \         8  d   R # RV,          V ,          # W,
          pRV ,
          p V \         8  d   R# RRV,          V ,          ,           # )g              ?      ?)EPSILONr   r      &&r   linearr       sP    
}G9v%%lvGsV+++r   c               r   r	   r   r   r   r   r   r   /   s!     9 95 9u 9 9r   c                sb    V\        R 4      \        \        V \        4      4      ,          ,          # )r   )r   Zmaxr   r   r   r   curvedr   /   s"    3s8c#fg"67788r   c               r   r	   r   r   r   r   r   r   3   s&     E E EU Eu Er   c                s    \        \        ) R ,          \        \        W4      ,          ,           4      R,           R ,          # )g       @r   )r   r   r   r   r   r   siner   3   s,    "sb6&#6667#=DDr   c               r   r	   r   r   r   r   r   r   7   s!     8 8e 8% 8E 8r   c                sT    \        R \        W4      R ,
          ^,          ,
          4      # r   r   r   r   r   r   sphere_increasingr   7   s!    vf*S0Q6677r   c               r   r	   r   r   r   r   r   r   ;   s!     6 6e 6% 6E 6r   c                sT    R \        R \        W4      ^,          ,
          4      ,
          # r   r   r   r   r   sphere_decreasingr    ;   s!    cF6/144555r   c                  s6    ] tR t^Ct$ RtR]R&   RR R lltRtR# )GradientFileNzblist[tuple[float, float, float, list[float], list[float], Callable[[float, float], float]]] | Nonegradientc                    V ^8  d   QhRRRR/# )r
   entriesintr   ztuple[bytes, str]r   r   r   r   r   ZGradientFile.__annotate__R   s     ) )# )0A )r   c           	     	s>   V P                   f   Q h. p^ pV P                   V,          w  rErgr\        V4       EF  p
W^,
          ,          pW[8  d#   V^,          pV P                   V,          w  rErgrK(  WT,
          pV\        8  d   V	! RR4      pM#V	! Wd,
          V,          W,
          V,          4      p\        \	        ^V^ ,          V^ ,          ,
          V,          V^ ,          ,           ,          R,           4      4      p\        \	        ^V^,          V^,          ,
          V,          V^,          ,           ,          R,           4      4      p\        \	        ^V^,          V^,          ,
          V,          V^,          ,           ,          R,           4      4      p\        \	        ^V^,          V^,          ,
          V,          V^,          ,           ,          R,           4      4      pVP                  W,           V,           V,           4       EK  	  RP                  V4      R3# )Nr   r   ZRGBA)r"   ranger   r   r%   appendZjoin)selfr$   ZpaletteZixx0x1xmrgb0rgb1segmentixwZscaleZrZgZbZas   &&                r   
getpaletteZGradientFile.getpaletteR   s   }}(((*.--*;'$wAq[!A&a26--2C/$A7{S)A!|< 3stAwa0E9DGCDsJKLA3stAwa0E9DGCDsJKLA3stAwa0E9DGCDsJKLA3stAwa0E9DGCDsJKLA NN1519q=)+  . xx &((r   r   )i   )__name__
__module____qualname____firstlineno__r"   Z__annotations__r2   __static_attributes__r   r   r   r!   r!   C   s      	 
	) )r   r!   c                  s&    ] tR t^stRtR R ltRtR# )GimpGradientFilez(File handler for GIMP's gradient format.c               r#   )r
   fpz	IO[bytes]r   ZNoner   r   r   r   r   ZGimpGradientFile.__annotate__v   s     D D9 D Dr   c           	     	s   VP                  4       P                  R 4      '       g   Rp\        V4      hVP                  4       pVP                  R4      '       d   VP                  4       P                  4       p\	        V4      p. V n        \        V4       F  pVP                  4       P                  4       pVR,           Uu. uF  p\        V4      NK  	  ppV^ ,          V^,          rV^,          pVR,          pVR,          p\        \	        V^,          4      ,          p\	        V^,          4      pV^ 8w  d   Rp\        V4      hV P
                  P                  WWW34       K  	  R# u upi )s   GIMP Gradientznot a GIMP gradient files   Name: :N   N:i      N:r;   r:   Nzcannot handle HSV colour spaceN)ZreadlineZ
startswithZSyntaxErrorZstripr%   r"   r&   Zsplitr   SEGMENTSZOSErrorr'   )r(   r9   ZmsgZlineZcountr/   Zsr0   r1   r)   r*   r+   r,   r-   r.   Zcspaces   &&              r   __init__ZGimpGradientFile.__init__v   s#   {{}''(899,Cc""{{} ??9%%;;=&&(DD	uA##%A#$S6*6aq6A*qT1Q41BS6DT7Ds1R5z*G2ZF{6cl"MM  ""D!BC! *s   E*)r"   N)r3   r4   r5   r6   __doc__r=   r7   r   r   r   r8   r8   s   s    2D Dr   r8   N)r>   Z
__future__r    Zmathr   r   r   r   Ztypingr   r   Z_binaryr   r   r   r   r   r   r    r<   r!   r8   r   r   r   <module>r?      sm    
 # # #  
 ,9E86 FD"35FG -) -)`"D| "Dr   