Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes15kdownloads
FtexImagePlugin.cpython-313.pyc78 linesDownload Raw Back to __pycache__
1�

2v�je���SrSSKJr SSKrSSKJr SSKJr SSKJ	r	J3r4 Sr"S	S5\5r"SS\6R5r
SS
jr\	R"\
R \
\5 \	R""\
R SS/5 g)a7A Pillow loader for .ftc and .ftu files (FTEX)8Jerome Leclanche <jerome@leclan.ch>9 10The contents of this file are hereby released in the public domain (CC0)11Full text of the CC0 license:12  https://creativecommons.org/publicdomain/zero/1.0/13 14Independence War 2: Edge Of Chaos - Texture File Format - 16 October 200115 16The textures used for 3D objects in Independence War 2: Edge Of Chaos are in a17packed custom format called FTEX. This file format uses file extensions FTC18and FTU.19* FTC files are compressed textures (using standard texture compression).20* FTU files are not compressed.21Texture File Format22The FTC and FTU texture files both use the same format. This23has the following structure:24{header}25{format_directory}26{data}27Where:28{header} = {29    u32:magic,30    u32:version,31    u32:width,32    u32:height,33    u32:mipmap_count,34    u32:format_count35}36 37* The "magic" number is "FTEX".38* "width" and "height" are the dimensions of the texture.39* "mipmap_count" is the number of mipmaps in the texture.40* "format_count" is the number of texture formats (different versions of the41same texture) in this file.42 43{format_directory} = format_count * { u32:format, u32:where }44 45The format value is 0 for DXT1 compressed textures and 1 for 24-bit RGB46uncompressed textures.47The texture data for a format starts at the position "where" in the file.48 49Each set of texture data in the file has the following structure:50{data} = format_count * { u32:mipmap_size, mipmap_size * { u8 } }51* "mipmap_size" is the number of bytes in that mip level. For compressed52textures this is the size of the texture data compressed with DXT1. For 24 bit53uncompressed textures, this is 3 * width * height. Following this are the image54bytes for that mipmap level.55 56Note: All data is stored in little-Endian (Intel) byte order.57�)�annotationsN)�IntEnum)�BytesIO�)�Image�	ImageFilesFTEXc��\rSrSrSrSrSrg)�Format�Arr�N)�__name__�58__module__�__qualname__�__firstlineno__�DXT1�UNCOMPRESSED�__static_attributes__r��YD:\code\apps\devtools\python\user_packages\Python313\site-packages\PIL/FtexImagePlugin.pyr59r60As���D��Lrr61c�0�\rSrSrSrSrSSjrS	SjrSrg)62�
FtexImageFile�F�FTEXzTexture File Format (IW2:EOC)c��URce[URRS55(d
Sn[U5e[R63"SURRS55 [R64"SURRS55Ul[R65"SURRS55up#US:Xde[R66"SURRS55upEURRU5 [R67"SURRS55unURRU5nU[R:Xa4SUl68[R"SS	UR-S69S5/UlOaU[R:Xa4SUl70[R"S
S	UR-S71S5/UlOS[!U53n[#U5eURR%5 ['U5Ulg)N�znot an FTEX filez<iz<2i�r�RGBA�bcn)rrr)r�RGB�rawz$Invalid texture compression format: )�fp�_accept�read�SyntaxError�struct�unpack�_size�seekr72r�_moder�_Tile�size�tiler�repr�73ValueError�closer)�self�msg�mipmap_count�format_count�format�where�mipmap_size�datas        r�_open�FtexImageFile._openJs����w�w�"�"�"��t�w�w�|�|�A��'�'�$�C��c�"�"��
�
�d�D�G�G�L�L��O�,��]�]�5�$�'�'�,�,�q�/�:��74�%+�]�]�5�$�'�'�,�,�q�/�%J�"���q� � � ��
�
�e�T�W�W�\�\�!�_�=�
�������U�����t�T�W�W�\�\�!�_�=����w�w�|�|�K�(���V�[�[� ��D�J�"��������0B�A�t�L�M�D�I�
�v�*�*�
*��D�J�"��������0B�A�u�M�N�D�I�8��f���G�C��S�/�!����
�
���$�-��rc��g�Nr)r0�poss  r�	load_seek�FtexImageFile.load_seekjs��r)r)r'r!r,N)�return�None)r<�intr?r@)	r
rrrr4�format_descriptionr8r=rrrrrrFs��
�F�8�� �@
rrc�,�UR[5$r;)�75startswith�MAGIC)�prefixs rr"r"ns�����U�#�#rz.ftcz.ftu)rF�bytesr?�bool)�__doc__�76__future__rr%�enumr�ior�rrrEr77rr"�
register_openr4�register_extensionsrrr�<module>rPsz��3�j#�
�������W��78%
�I�'�'�%
�P$����M�(�(�-��A����-�.�.���0@�Ar
codekingpro/portable-devtools · Team Ai