CoolFace
Apppublic

Aluode/PerceptionLabPortable

sourceHugging Faceupdated 9mo agoView on Hugging Face
0likes
WalImageFile.cpython-310.pyc66 linesDownload Raw Back to __pycache__
1o

2��Yi�@shdZddlmZddlmZddlmZmZddlm	Z3ddlmZGdd	�d	ej�Z
dd
d�ZdZdS)a�4This reader is based on the specification available from:5https://www.flipcode.com/archives/Quake_2_BSP_File_Format.shtml6and has been tested with a few sample files found using google.7 8.. note::9    This format cannot be automatically recognized, so the reader10    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�)�annotations)�IO�)�Image�	ImageFile)�i32le)�StrOrBytesPathc@s(eZdZdZdZddd�Zddd	�Zd13S)
�WalImageFileZWALzQuake2 Texture�return�NonecCs�d|_|jdus14J�|j�d�}t|d�t|d�f|_t�|j�t|d�}|j�|�|dd��	dd�d|j15d	<|d16d��	dd�d}rP||j17d<dSdS)
N�P�d� �$�(�rr�name�8�X�	next_name)�_mode�fp�read�i32�_sizerZ_decompression_bomb_check�size�seek�split�info)�self�header�offsetr�r"�zE:\DocsHouse\542 percep lab latest\PerceptionLab\PerceptionLab_Portable\python_embed\Lib\site-packages\PIL/WalImageFile.py�_open&s18�zWalImageFile._open�Image.core.PixelAccess | NonecCsd|jdur,|jdusJ�tj�|j|j�|_|�|j�	|jd|jd��|�19t�tj�|�S)Nrr)
Z_imrr�core�new�moderZim�	frombytesrZ20putpalette�
quake2palette�load)rr"r"r#r+8s21"22zWalImageFile.loadN)r23r)r24r%)�__name__�25__module__�__qualname__�format�format_descriptionr$r+r"r"r"r#r	"s2627r	�filename�StrOrBytesPath | IO[bytes]r28cCst|�S)a229    Load texture from a Quake2 WAL texture file.30 31    By default, a Quake2 standard palette is attached to the texture.32    To override the palette, use the :py:func:`PIL.Image.Image.putpalette()` method.33 34    :param filename: WAL file name, or an opened file handle.35    :returns: An image instance.36    )r	)r1r"r"r#�openAs37r3s"""&&&))),,,///222555777:::<<<$" 



3839
40##&""%" #!"  


-( )$'"%8.1),%& <07,3(-$("4110.,
*'42%!
434445
)#'!& %#! 
4647&# 

48493"5)&7/-95479:379046+14'.1"+/(,%* &
%"50 
51,!!*)'&$"!


52 53 54.0)-.'+,&**$()#''!&&$$""
550-,*(&$!
56
575859()8&'6%&4$$1""/ !-*'%!
60/2)-0&+.$),!'*%(#&!%"
61
62?<9 5#1#-#)?????9??1??*?? ???<?9?5?2?-=*;&9!742/-*'#=???

<.*6' 0!)<9772/1,(+&!0" N)r1r2r63r	)�__doc__�64__future__r�typingr�rr�_binaryrrZ_typingrr	r3r*r"r"r"r#�<module>s6566�
Aluode/PerceptionLabPortable · CoolFace