/ lib / PIL / WalImageFile.pyc
WalImageFile.pyc
 1  o

 2  Y��c�@sBdZddlmZmZddlmZGdd�dej�Zdd�ZdZ	d	S)
 3  a�
 4  This reader is based on the specification available from:
 5  https://www.flipcode.com/archives/Quake_2_BSP_File_Format.shtml
 6  and has been tested with a few sample files found using google.
 7  
 8  .. note::
 9      This format cannot be automatically recognized, so the reader
10      is not registered for use with :py:func:`PIL.Image.open()`.
11      To open a WAL file, use the :py:func:`PIL.WalImageFile.open()` function instead.
12  �)�Image�	ImageFile)�i32lec@s$eZdZdZdZdd�Zdd�ZdS)�WalImageFileZWALzQuake2 TexturecCs�d|_|j�d�}t|d�t|d�f|_t�|j�t|d�}|j�|�|dd��	dd�d|j
13  d	<|d
14  d��	dd�d}|rI||j
15  d<dSdS)
N�P�d� �$�(�r��name�8�X�	next_name)�mode�fp�read�i32�_sizer�_decompression_bomb_check�size�seek�split�info)�self�header�offsetr�r��C:\Users\Jacks.GUTTSPC\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\PIL\WalImageFile.py�_open#s
16  �zWalImageFile._opencCsR|js#tj�|j|j�|_|�|j�|jd|jd��|�	t
17  �tj�|�S)Nrr)�imr�core�newrr�	frombytesrr�
18  putpalette�
quake2palette�load)rrrrr'5s
19  "
20  zWalImageFile.loadN)�__name__�
21  __module__�__qualname__�format�format_descriptionr r'rrrrrs
22  rcCst|�S)a2
23      Load texture from a Quake2 WAL texture file.
24  
25      By default, a Quake2 standard palette is attached to the texture.
26      To override the palette, use the :py:func:`PIL.Image.Image.putpalette()` method.
27  
28      :param filename: WAL file name, or an opened file handle.
29      :returns: An image instance.
30      )r)�filenamerrr�open=s
31  r.s"""&&&))),,,///222555777:::<<<$" 



32  
33  

34  ##&""%" #!"  


-( )$'"%8.1),%& <07,3(-$("
35  10.,
*'
36  %!

37  
38  
39  
)#'!& %#! 

40  
41  &# 

42  
43  3"5)&7/-95479:379046+14'.1"+/(,%* &
%"
44   

45  ,!!*)'&$"!


46  
47  
48  .0)-.'+,&**$()#''!&&$$""

49  0-,*(&$!

50  
51  
52  
53  ()8&'6%&4$$1""/ !-*'%!

54  /2)-0&+.$),!'*%(#&!%"

55  

56  ?<9 5#1#-#)?????9??1??*?? ???<?9?5?2?-=*;&9!742/-*'#=???

<.*6' 0!)<9772/1,(+&!0" N)
57  �__doc__�rr�_binaryrrrr.r&rrrr�<module>s�