Sindbad~EG File Manager

Current Path : /usr/local/lib/python3.12/site-packages/PIL/__pycache__/
Upload File :
Current File : //usr/local/lib/python3.12/site-packages/PIL/__pycache__/WalImageFile.cpython-312.pyc

�

&ٜgH��~�dZddlmZddlmZddlmZmZddlm	Z
ddlmZGd�d	ej�Z
d
d
�ZdZy)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�$�eZdZdZdZdd�Zdd�Zy)�WalImageFile�WALzQuake2 Texturec��d|_|jjd�}t|d�t|d�f|_tj|j�t|d�}|jj|�|ddjdd�d|jd	<|d
djdd�d}|r||jd<yy)
N�P�d� �$�(�rr�name�8�X�	next_name)�_mode�fp�read�i32�_sizer�_decompression_bomb_check�size�seek�split�info)�self�header�offsetrs    �;/usr/local/lib/python3.12/site-packages/PIL/WalImageFile.py�_openzWalImageFile._open&s�����
������/�0�����_�c�&�"�o�5��
�
�'�'��	�	�2��V�R��������V��#�3�B�K�-�-�e�Q�7��:��	�	�&���2��(�.�.�u�a�8��;�	��%.�D�I�I�k�"��c��|j��tjj|j|j
�|_|j|jj|j
d|j
dz��|jt�tjj|�S)Nrr)
�_imr�core�new�moder�im�	frombytesrr�
putpalette�
quake2palette�load)r"s r%r1zWalImageFile.load8sy���8�8���j�j�n�n�T�Y�Y��	�	�:�D�G��N�N�4�7�7�<�<��	�	�!��t�y�y��|�(C�D�E��O�O�M�*��{�{����%�%r'N)�return�None)r2zImage.core.PixelAccess | None)�__name__�
__module__�__qualname__�format�format_descriptionr&r1�r'r%rr"s��
�F�)��/�$&r'rc��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%�openr<@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)r;zStrOrBytesPath | IO[bytes]r2r)�__doc__�
__future__r�typingr�rr�_binaryrr�_typingr	rr<r0r9r'r%�<module>rCs=��	�#���!�#�&�9�&�&�&�<
"�/H�r'

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists