Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
TgaImagePlugin.cpython-313.pyc45 linesDownload Raw Back to __pycache__
1�

2v�j����SSKJr SSKrSSKrSSKJr SSKJrJrJ	r	 SSK3Jr SSK4J
r SSK5Jr SS	K6Jr S7SSS
SSSS.r"SS\R5rSSSSSSS.rSSjr\R,"\R.\5 \R0"\R.\5 \R2"\R./SQ5 \R4"\R.S5 g)�)�annotationsN)�IO�)�Image�	ImageFile�ImagePalette)�i16le)�i32le)�o8)�o16le�P�1�L�LA�BGRA;15Z�BGR�BGRA))r�)�r)rr)r�)�r)r�)r� c�0�\rSrSrSrSrSSjrSSjrSrg)	�TgaImageFile�3�TGA�Targac���URceURRS5nUSnUSnUSnUSnUSn[US5[US54UlUS	;d,URSS::dURSS::dUS8;a
Sn[U5eUS;a#S
UlUS:XaSUlOHUS:XaSUlO:US;aU(aSOS
UlO#US;aUS:XaSOSUlO
Sn[U5eUS-nUS;UlUS;aSnOUS;aSnO
Sn[U5eX�RS'US-(aSURS 'U(a(URRU5URS!'U(Ga$[US"5[US#5US$p�n	US:XaY[R"S%[SU	-5URRSU9-5-5UlSURl
O�US:XaH[R"S&[S"U	-5URRS"U10-5-5UlO[US':XaH[R"S([S)U	-5URRS)U11-5-5UlO
S*n[U5e[US$-U4nUS-(aG[R "SS+UR-URR#5X�U45/Ulg[R "S,S+UR-URR#5USU45/Ulg![&a gf=f)-N�rrrr���)rr)rrrrrznot a TGA file)r�rrr)r�	r
)r�12r�RGB�RGBAzunknown TGA mode�0)rr))rr))rr�����zunknown TGA orientation�orientationr�tga_rle�compression�13id_sectionr��rrrr�zunknown TGA map depth�rr�raw)�fp�read�i16�_size�size�SyntaxError�_mode�_flip_horizontally�inforr3�bytes�palette�mode�MODESr�_Tile�tell�tile�KeyError)
�self�s�id_len�colormaptype�	imagetype�depth�flags�msgr+�startr8�mapdepth�rawmodes
             �XD:\code\apps\devtools\python\user_packages\Python313\site-packages\PIL/TgaImagePlugin.py�_open�TgaImageFile._open7s7���w�w�"�"�"��G�G�L�L�����1�����t���a�D�	��"����"�����B�Z��Q���+��14�
��&��y�y��|�q� ��y�y��|�q� ��.�.�"�C��c�"�"�����D�J���z� ��15��"��!��16��
�&�
 � ,��#�D�J�
�'�
!�"'�2�+��6�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�$��E��2�~�+�/�/���a�%�i� 0�4�7�7�<�<��D��3I� I� ���%+����!��R��+�/�/��5��U��+�d�g�g�l�l�1�t�8�.D�D� ����R��+�/�/��E�!�e�)�,�t�w�w�|�|�A��H�/E�E� ���.��!�#�&�&�	��Y��]�E�2�3�G��1�}��O�O�!�����*������� �u�5�	���	��O�O������*������� �!�[�1�	���	���	��	�s�4AM�AM�17M(�'M(c�f�URS:Xa�URceURRS[R5 URRS5nUR
S5(am[U5nU(a[URRUS-5 URRS5nUS:XaURRSS	5 UR(a9URR[RR5Ulgg)18Nr(i�����sTRUEVISION-XFILE.i�r�r��)r?r4�seek�os�SEEK_ENDr5�endswith�i32�im�fillbandr;�	transposer�	Transpose�FLIP_LEFT_RIGHT)rE�footer�extension_offset�attributes_types    rP�load_end�TgaImageFile.load_end�s����9�9����7�7�&�&�&��G�G�L�L��b�k�k�*��W�W�\�\�"�%�F����7�8�8�#&�v�;� �#��G�G�L�L�!1�C�!7�8�&*�g�g�l�l�1�o�O�&�'�1����(�(��C�0��"�"��g�g�'�'����(G�(G�H�D�G�#�)r;r:r7r\r>rCN)�return�None)	�__name__�19__module__�__qualname__�__firstlineno__�format�format_descriptionrQrd�__static_attributes__�rfrPrr3s��
�F� ��h�TIrfr)rrrr)rrrr)rrrr)r
rrr)rrrr)rrrr)rrrr
r'r(c�<�[URup4pVSUR;aURSn	O:URRSURRS55n20U21S:Hn	U	(aUS-
nURRSURRSS55n[U5nUS	:�aS	nUSS	n[R"S225 U(a,URRSS5n
[U
5S
-Sp�OSup�URS;aSnOSnURRSURRSS55nUS:�aUS-nUR[U5[U5-[U5-[S5-[U5-[U5-[S5-[S5-[URS5-[URS5-[U5-[U5-5 U(aURU5 U(aURW
5 U	(a@[ R""UU[ R$"SSUR-SUU45/5 O@[ R""UU[ R$"SSUR-SUSU45/5 URS5 g![a!nSURS3n[U5UeSnAff=f)Nzcannot write mode z as TGA�rler-r,rr.�rVz-id_section has been trimmed to 255 charactersr'rrrr2)rr(rr+r*rrr3sTRUEVISION-XFILE.)�SAVEr?rD�OSError�encoderinfo�getr<�len�warnings�warnr\�23getpalette�writer�o16r8r�_saverA)r\r4�filenamerO�bitsrHrI�erLrrr-r.rGr>�colormaplength�
colormapentryrKr+s                  rPr~r~�s���"�15�b�g�g��.��|�24
������n�n�U�#���n�n�(�(�������M�8R�S���Y�&��25��Q��	����#�#�L�"�'�'�+�+�l�B�2O�P�J�
��_�F�
��|������%�26��
�
�E�F���%�%�"�"�5�%�0��(+�G���(9�2�
�(,�%��	�w�w�.� ������.�.�$�$�]�B�G�G�K�K�
�r�4R�S�K��Q�������H�H�27�6�28�29�\�30�	�31�Y�-�	��a�&�	��n�32�		�33
�]�34�	��a�&�
	��a�&�	��b�g�g�a�j�/�	��b�g�g�a�j�/�		�
�T�(�35	�
�U�)�	�
��36������37�����38������
�_�_�Y�����(8�!�g�{�=S�
T�U�	39�	�����
�_�_�U�F�R�W�W�$4�a�'�1�k�9R�
S�T�	40��H�H�
9�:��K�"�"�2�7�7�)�7�3���c�l��!��"�s�K0�041L�:L�L)z.tgaz.icbz.vdaz.vstzimage/x-tga)r\zImage.Imager4z	IO[bytes]rzstr | bytesrgrh)�42__future__rrXry�typingrrsrrr�_binaryr	r6r43r[rrr}r@rrtr~�
register_openrm�
register_save�register_extensions�
register_mimerprfrP�<module>r�s���$#�	���,�,�!�!��!�
���
�
�
�
�		�� ~I�9�&�&�~I�N44�	�45�	���
��H;�`���L�'�'��6����L�'�'��/����,�-�-�/O�P����L�'�'��7rf
codekingpro/portable-devtools · Team Ai