File: //usr/lib/python3/dist-packages/PIL/__pycache__/BlpImagePlugin.cpython-38.pyc
U
tCf�8 � @ s� d Z ddlZddlmZ ddlmZmZ dZdZdZ dZ
dZdZdZ
d d
� Zd!dd
�Zdd� Zdd� ZG dd� de�ZG dd� dej�ZG dd� dej�ZG dd� de�ZG dd� de�Ze�ejedd� � e�ejd� e�de� e�d e� dS )"a�
Blizzard Mipmap Format (.blp)
Jerome Leclanche <jerome@leclan.ch>
The contents of this file are hereby released in the public domain (CC0)
Full text of the CC0 license:
https://creativecommons.org/publicdomain/zero/1.0/
BLP1 files, used mostly in Warcraft III, are not fully supported.
All types of BLP2 files used in World of Warcraft are supported.
The BLP file structure consists of a header, up to 16 mipmaps of the
texture
Texture sizes must be powers of two, though the two dimensions do
not have to be equal; 512x256 is valid, but 512x200 is not.
The first mipmap (mipmap #0) is the full size image; each subsequent
mipmap halves both dimensions. The final mipmap should be 1x1.
BLP files come in many different flavours:
* JPEG-compressed (type == 0) - only supported for BLP1.
* RAW images (type == 1, encoding == 1). Each mipmap is stored as an
array of 8-bit values, one per pixel, left to right, top to bottom.
Each value is an index to the palette.
* DXT-compressed (type == 1, encoding == 2):
- DXT1 compression is used if alpha_encoding == 0.
- An additional alpha bit is used if alpha_depth == 1.
- DXT3 compression is used if alpha_encoding == 1.
- DXT5 compression is used if alpha_encoding == 7.
� N)�BytesIO� )�Image� ImageFile� � � c C s* | d? d@ d>