Ë
    /æj`  ã                  óX   — d dl mZ ddhZd dlZd dlmZ dZerd dlmZm	Z	  G d„ d	«      Z
y)
é    )ÚannotationsÚioÚreN)ÚBytesIOF)ÚIOÚSelfc                  ó@   — e Zd ZdZdZdd	d„Zd
d„Zedd„«       Zdd„Z	y)ÚGimpPaletteFilez'File handler for GIMP's palette format.ÚRGBc                óÜ  ‡— |j                  «       j                  d«      sd}t        |«      ‚g }d}	 |r|dk(  rn¢|dz  }|j                  «       }|snŠt        j                  d|«      rŒ8|rt        |«      dkD  rd}t        |«      ‚|j                  d	¬
«      Št        ‰«      d	k  rd}t        |«      ‚|ˆfd„t        d	«      D «       z  }|rt        |«      dk(  rnŒªt        |«      | _
        y )Ns   GIMP Paletteznot a GIMP palette filer   i  é   s   \w+:|#éd   zbad palette fileé   )Úmaxsplitzbad palette entryc              3  ó:   •K  — | ]  }t        ‰|   «      –— Œ y ­w©N)Úint)Ú.0ÚiÚvs     €úV/root/repos/pocs/video-evals/.venv/lib/python3.12/site-packages/PIL/GimpPaletteFile.pyú	<genexpr>z(GimpPaletteFile._read.<locals>.<genexpr>=   s   øè ø€ Ò4 aœ˜A˜a™DŸ	Ñ4ùs   ƒi   )ÚreadlineÚ
startswithÚSyntaxErrorr   ÚmatchÚlenÚsplitÚ
ValueErrorÚrangeÚbytesÚpalette)ÚselfÚfpÚlimitÚmsgr"   r   Úsr   s          @r   Ú_readzGimpPaletteFile._read!   së   ø€ Ø�{‰{‹}×'Ñ'¨Ô8Ø+ˆCÜ˜cÓ"Ð"àˆØˆØÙ˜˜gšØà�‰FˆAØ—‘“ˆAÙØô �x‰x˜
 AÔ&ØÙœ˜Q› #šØ(�Ü! #Ó&Ð&à—‘ �Ó#ˆAÜ�1‹v˜ŠzØ)�Ü  “oÐ%àÓ4¬5°«8Ô4Ñ4ˆGÙœ˜W›¨Ò,Øð/ ô2 ˜W“~ˆ�ó    c                ó&   — | j                  |«       y r   )r(   )r#   r$   s     r   Ú__init__zGimpPaletteFile.__init__C   s   € Ø�
‰
�2�r)   c                ó^   — | j                  | «      }|j                  t        |«      d«       |S )NF)Ú__new__r(   r   )ÚclsÚdatar#   s      r   Ú	frombyteszGimpPaletteFile.frombytesF   s'   € à�{‰{˜3ÓˆØ�
‰
”7˜4“= %Ô(Øˆr)   c                ó2   — | j                   | j                  fS r   )r"   Úrawmode)r#   s    r   Ú
getpalettezGimpPaletteFile.getpaletteL   s   € Ø�|‰|˜TŸ\™\Ð)Ð)r)   N)T)r$   ú	IO[bytes]r%   ÚboolÚreturnÚNone)r$   r4   r6   r7   )r/   r!   r6   r   )r6   ztuple[bytes, str])
Ú__name__Ú
__module__Ú__qualname__Ú__doc__r2   r(   r+   Úclassmethodr0   r3   © r)   r   r
   r
      s.   „ Ù1à€Gô &óDð òó ðô
*r)   r
   )Ú
__future__r   Ú__lazy_modules__r   r   r   ÚTYPE_CHECKINGÚtypingr   r   r
   r=   r)   r   ú<module>rB      s/   ðõ  #à˜$�<Ð ã 	Ý à€Ùß÷1*ò 1*r)   