Namespace WoWLib.Formats.BLP
Classes
- BLP
A BLP2 texture file — every WoW client release reads the same layout, so the class carries no client-version axis. read()/write() move the file whole with a byte-perfect round-trip while the mip payloads are unmodified; decode(level) produces an RGBA8 Image from a stored level (palettized, DXT1/3/5, BC5 and raw BGRA all decode); encode(image, settings) rebuilds the palette/compression/mip chain from one. Raw payload access goes through mip()/set_mip(). See https://wowdev.wiki/BLP.
- EncodeSettings
How encode() should build the file. The defaults produce what the client ships most: DXT compression with the block format chosen from the alpha depth (0 -> BC1, 1 -> BC1 punch-through, 4 -> BC2, 8 -> BC3), with a full generated mip chain.
- Image
A decoded texture surface: 8-bit RGBA pixels in row-major order, row 0 at the top. pixels holds width * height * 4 bytes (r, g, b, a per pixel) and maps to NumPy zero-copy; reshape to (height, width, 4).
Structs
- EncodeSettings.Data
A blittable value twin of the NATIVE layout (size 4): read or write whole record buffers through Vector<T>.AsSpan<Data>() / FixedArray<T>.AsSpan<Data>() — one interop crossing for the buffer, where the live-view indexer pays per element. Field offsets are the native ABI's, asserted in the shim.
Enums
- ColorEncoding
How a BLP's pixel payload is encoded (the header's colorEncoding byte).
- PixelFormat
The client-side pixel format hint (the header's preferredFormat byte). For DXT-encoded files it selects the block format: Dxt1 -> BC1, Dxt3 -> BC2, Dxt5 -> BC3, Bc5 -> BC5.