§
    œ"²c�  ã                   óV   — d Z ddlmZmZ ddlmZ  G d„ dej        ¦  «        Zd„ ZdZ	dS )	a�  
This reader is based on the specification available from:
https://www.flipcode.com/archives/Quake_2_BSP_File_Format.shtml
and has been tested with a few sample files found using google.

.. note::
    This format cannot be automatically recognized, so the reader
    is not registered for use with :py:func:`PIL.Image.open()`.
    To open a WAL file, use the :py:func:`PIL.WalImageFile.open()` function instead.
é   )ÚImageÚ	ImageFile)Úi32lec                   ó"   — e Zd ZdZdZd„ Zd„ ZdS )ÚWalImageFileÚWALzQuake2 Texturec                 óÔ  — d| _         | j                             d¦  «        }t          |d¦  «        t          |d¦  «        f| _        t          j        | j        ¦  «         t          |d¦  «        }| j                             |¦  «         |d d…          	                    dd¦  «        d         | j
        d	<   |d
d…          	                    dd¦  «        d         }|r|| j
        d<   d S d S )NÚPéd   é    é$   é(   ó    r   é    Únameé8   éX   Ú	next_name)ÚmodeÚfpÚreadÚi32Ú_sizer   Ú_decompression_bomb_checkÚsizeÚseekÚsplitÚinfo)ÚselfÚheaderÚoffsetr   s       ú2/usr/lib/python3/dist-packages/PIL/WalImageFile.pyÚ_openzWalImageFile._open#   sã   € ØˆŒ	ð ”—’Ð/Ñ0Ô0ˆÝ˜ ‘_”_¥c¨&°"¡o¤oÐ5ˆŒ
ÝÔ'¨¬	Ñ2Ô2Ð2õ �V˜R‘”ˆØŒ�Š�VÑÔÐð # 3 B 3œK×-Ò-¨e°QÑ7Ô7¸Ô:ˆŒ	�&ÑØ˜2 ˜<Ô(×.Ò.¨u°aÑ8Ô8¸Ô;ˆ	Øð 	/Ø%.ˆDŒI�kÑ"Ð"Ð"ð	/ð 	/ó    c                 ól  — | j         s�t          j                             | j        | j        ¦  «        | _         |                      | j                             | j        d         | j        d         z  ¦  «        ¦  «         |  	                    t          ¦  «         t          j                             | ¦  «        S )Nr   r   )Úimr   ÚcoreÚnewr   r   Ú	frombytesr   r   Ú
putpaletteÚquake2paletteÚload)r   s    r"   r,   zWalImageFile.load5   s€   € ØŒwð 	+Ý”j—n’n T¤Y°´	Ñ:Ô:ˆDŒGØ�NŠN˜4œ7Ÿ<š<¨¬	°!¬°t´yÀ´|Ñ(CÑDÔDÑEÔEÐEØ�OŠO�MÑ*Ô*Ð*ÝŒ{×Ò Ñ%Ô%Ð%r$   N)Ú__name__Ú
__module__Ú__qualname__ÚformatÚformat_descriptionr#   r,   © r$   r"   r   r      s=   € € € € € à€FØ)Ðð/ð /ð /ð$&ð &ð &ð &ð &r$   r   c                 ó    — t          | ¦  «        S )a2  
    Load texture from a Quake2 WAL texture file.

    By default, a Quake2 standard palette is attached to the texture.
    To override the palette, use the :py:func:`PIL.Image.Image.putpalette()` method.

    :param filename: WAL file name, or an opened file handle.
    :returns: An image instance.
    )r   )Úfilenames    r"   Úopenr5   =   s   € õ ˜Ñ!Ô!Ð!r$   s   """&&&))),,,///222555777:::<<<$" 


##&""%" #!"  -( )$'"%8.1),%& <07,3(-$("
10.,*'
%!


)#'!& %#! 

&# 

3"5)&7/-95479:379046+14'.1"+/(,%* &%"
 
,!!*)'&$"!


.0)-.'+,&**$()#''!&&$$""
0-,*(&$!



()8&'6%&4$$1""/ !-*'%!
/2)-0&+.$),!'*%(#&!%"

?<9 5#1#-#)?????9??1??*?? ???<?9?5?2?-=*;&9!742/-*'#=???<.*6' 0!)<9772/1,(+&!0" N)
Ú__doc__Ú r   r   Ú_binaryr   r   r   r5   r+   r2   r$   r"   ú<module>r9      s†   ðð	ð 	ð Ð Ð Ð Ð Ð Ð Ð Ø !Ð !Ð !Ð !Ð !Ð !ð&ð &ð &ð &ð &�9Ô&ñ &ô &ð &ð>
"ð 
"ð 
"ð/Hð €€r$   