ó
    ©Rj  ã                  ó€   • S r SSKJr  SSKJr  SSKJrJr  SSKJ	r
  SSKJr   " S S	\R                  5      rSS
 jrSrg)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.
é    )Úannotations)ÚIOé   )ÚImageÚ	ImageFile)Úi32le)ÚStrOrBytesPathc                  ó0   • \ rS rSrSrSrSS jrS	S jrSrg)
ÚWalImageFileé#   ÚWALzQuake2 Texturec                óÔ  • SU l         U R                  c   eU R                  R                  S5      n[        US5      [        US5      4U l        [
        R                  " U R                  5        [        US5      nU R                  R                  U5        US S R                  SS5      S   U R                  S	'   US
S R                  SS5      S   =n(       a  X0R                  S'   g g )NÚPéd   é    é$   é(   ó    r   r   Únameé8   éX   Ú	next_name)Ú_modeÚfpÚreadÚi32Ú_sizer   Ú_decompression_bomb_checkÚsizeÚseekÚsplitÚinfo)ÚselfÚheaderÚoffsetr   s       Ú<D:\diplom_project\venv\Lib\site-packages\PIL/WalImageFile.pyÚ_openÚWalImageFile._open'   sÓ   € ØˆŒ
ð �w‰wÑ"Ð"Ð"Ø—‘—‘Ð/Ó0ˆÜ˜ “_¤c¨&°"£oÐ5ˆŒ
Ü×'Ò'¨¯	©	Ô2ô �V˜R“ˆØ�‰�‰�VÔð # 3 B˜K×-Ñ-¨e°QÓ7¸Ñ:ˆ�	‰	�&ÑØ˜r GÐ,×2Ñ2°5¸!Ó<¸QÑ?Ð?ˆ9Õ?Ø%.�I‰I�kÒ"ð @ó    c                ó¢  • U R                   c¤  U R                  c   e[        R                  R	                  U R
                  U R                  5      U l        U R                  U R                  R                  U R                  S   U R                  S   -  5      5        U R                  [        5        [        R                  R                  U 5      $ )Nr   r   )Ú_imr   r   ÚcoreÚnewÚmoder   ÚimÚ	frombytesr   Ú
putpaletteÚquake2paletteÚload)r#   s    r&   r3   ÚWalImageFile.load9   s‰   € Ø�8‰8ÑØ—7‘7Ñ&Ð&Ð&Ü—j‘j—n‘n T§Y¡Y°·	±	Ó:ˆDŒGØ�N‰N˜4Ÿ7™7Ÿ<™<¨¯	©	°!©°t·y±yÀ±|Ñ(CÓDÔEØ�O‰OœMÔ*Ü�{‰{×Ñ Ó%Ð%r)   )r   r   r/   N)ÚreturnÚNone)r5   zImage.core.PixelAccess | None)	Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__ÚformatÚformat_descriptionr'   r3   Ú__static_attributes__© r)   r&   r   r   #   s   † Ø€FØ)Ðô/÷$&r)   r   c                ó   • [        U 5      $ )a  
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&   ÚopenrA   B   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)r@   zStrOrBytesPath | IO[bytes]r5   r   )Ú__doc__Ú
__future__r   Útypingr   Ú r   r   Ú_binaryr   r   Ú_typingr	   r   rA   r2   r>   r)   r&   Ú<module>rH      s=   ðñ	õ #å ç Ý !Ý #ô&�9×&Ñ&ô &ô>
"ð/Hñ r)   