zmc
2023-08-08 e792e9a60d958b93aef96050644f369feb25d61b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
U
T±d
ã@sBdZddlmZmZddlmZGdd„dejƒZdd„ZdZ    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@s$eZdZdZdZdd„Zdd„ZdS)Ú WalImageFileZWALzQuake2 TexturecCs’d|_|j d¡}t|dƒt|dƒf|_t |j¡t|dƒ}|j |¡|dd…     dd¡d|j
d    <|d
d …     dd¡d}|rŽ||j
d <dS) NÚPédé é$é(óréÚnameé8éXÚ    next_name) ÚmodeÚfpÚreadÚi32Ú_sizerZ_decompression_bomb_checkÚsizeÚseekÚsplitÚinfo)ÚselfÚheaderÚoffsetr©rúGd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\PIL/WalImageFile.pyÚ_open"s  
 zWalImageFile._opencCsR|jsFtj |j|j¡|_| |j |jd|jd¡¡|     t
¡tj  |¡S)Nr r) ZimrÚcoreÚnewrrZ    frombytesrrZ
putpaletteÚ quake2paletteÚload)rrrrr#4s
"
zWalImageFile.loadN)Ú__name__Ú
__module__Ú __qualname__ÚformatÚformat_descriptionrr#rrrrrsrcCst|ƒ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)ÚfilenamerrrÚopen<s
r*s """&&&))),,,///222555777:::<<<$"      
 
 
##&""%" #!"   -( )$'"%8.1),%& <07,3(-$(" 
10., * '
%!    
 
 
 )#'!& %#!   
 
&#   
 
3"5)&7/-95479:379046+14'.1"+/(,%* & % "
  
,!!*)'&$"! 
 
 
.0)-.'+,&**$()#''!&&$$""
0-,*(&$!  
 
 
 
()8&'6%&4$$1""/ !-*'%! 
/2)-0&+.$),!'*%(#&!%" 
 
?< 9 5#1#-#)?????9??1??*?? ???<?9?5 ?2?-=*;&9!742/-* '#=??? <.*6' 0!)<9772/1,(+&!0" N)
Ú__doc__ÚrrÚ_binaryrrrr*r"rrrrÚ<module>s   þ