wowlib 0.0.0
Read & write World of Warcraft client files — a C++26 core
Loading...
Searching...
No Matches
wowlib::formats::blp Namespace Reference

Namespaces

namespace  detail

Classes

struct  Image
struct  EncodeSettings
struct  BLP

Enumerations

enum class  ColorEncoding : std::uint8_t {
  Jpeg = 0 , Palettized = 1 , Dxt = 2 , Bgra = 3 ,
  BgraAlt = 4
}
 How a BLP's pixel payload is encoded (the header's colorEncoding byte). More...
enum class  PixelFormat : std::uint8_t {
  Dxt1 = 0 , Dxt3 = 1 , Argb8888 = 2 , Argb1555 = 3 ,
  Argb4444 = 4 , Rgb565 = 5 , A8 = 6 , Dxt5 = 7 ,
  Unspecified = 8 , Argb2565 = 9 , Bc5 = 11
}
 The client-side pixel format hint (the header's preferredFormat byte). More...

Variables

constexpr std::uint32_t BlpMagic = fourcc("BLP2", FourCCEndian::Forward)
 The BLP2 magic: the literal bytes "BLP2" (a forward FourCC, unlike the reversed chunk ids).
constexpr std::uint32_t BlpVersion1 = 1
 The BLP2 header version field; always 1 in every shipped client.
constexpr std::size_t BlpMaxMips = 16
 The mip table capacity: a BLP addresses at most 16 levels.
constexpr std::size_t BlpPaletteSize = 256
 The palette entry count (one byte-sized index space).
constexpr std::size_t BlpHeaderBytes = 0x494
 The full header region: 148-byte header + 1024-byte palette.

Enumeration Type Documentation

◆ ColorEncoding

enum class wowlib::formats::blp::ColorEncoding : std::uint8_t
strong

How a BLP's pixel payload is encoded (the header's colorEncoding byte).

Enumerator
Jpeg 

JPEG-compressed content (Warcraft III heritage; never shipped in WoW clients — wowlib preserves but cannot decode it).

Palettized 

256-color palette indices, one byte per pixel, followed by a separate alpha plane of alphaDepth bits per pixel.

Dxt 

DXT/S3TC block compression; the variant (BC1/BC2/BC3/BC5) follows from preferred_format and alphaDepth.

Bgra 

Raw 32-bit BGRA pixels (Cataclysm+; terrain cube maps).

BgraAlt 

Raw 32-bit BGRA under a different client-side PIXEL_FORMAT; identical file content to Bgra.

Definition at line 56 of file blp.hpp.

◆ PixelFormat

enum class wowlib::formats::blp::PixelFormat : std::uint8_t
strong

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.

Enumerator
Dxt1 

BC1: 8-byte blocks, optional 1-bit punch-through alpha.

Dxt3 

BC2: 16-byte blocks, explicit 4-bit alpha.

Argb8888 

Raw 32-bit upload hint (used by Bgra-encoded files).

Argb1555 

16-bit 1555 upload hint; never a file content layout.

Argb4444 

16-bit 4444 upload hint; never a file content layout.

Rgb565 

16-bit 565 upload hint; never a file content layout.

A8 

Alpha-only upload hint; never a file content layout.

Dxt5 

BC3: 16-byte blocks, interpolated 8-bit alpha.

Unspecified 

No preference recorded (typical for palettized files).

Argb2565 

Component-texture upload hint; never a file content layout.

Bc5 

BC5: two interpolated channels (normal maps, later clients).

Definition at line 65 of file blp.hpp.

Variable Documentation

◆ BlpHeaderBytes

std::size_t wowlib::formats::blp::BlpHeaderBytes = 0x494
inlineconstexpr

The full header region: 148-byte header + 1024-byte palette.

Definition at line 53 of file blp.hpp.

Referenced by wowlib::formats::blp::BLP::read(), and wowlib::formats::blp::BLP::write().

◆ BlpMagic

std::uint32_t wowlib::formats::blp::BlpMagic = fourcc("BLP2", FourCCEndian::Forward)
inlineconstexpr

The BLP2 magic: the literal bytes "BLP2" (a forward FourCC, unlike the reversed chunk ids).

Definition at line 45 of file blp.hpp.

Referenced by wowlib::formats::blp::BLP::read(), and wowlib::formats::blp::BLP::write().

◆ BlpMaxMips

std::size_t wowlib::formats::blp::BlpMaxMips = 16
inlineconstexpr

◆ BlpPaletteSize

std::size_t wowlib::formats::blp::BlpPaletteSize = 256
inlineconstexpr

The palette entry count (one byte-sized index space).

Definition at line 51 of file blp.hpp.

Referenced by wowlib::formats::blp::detail::PaletteCodec::_nearestIndex(), and wowlib::formats::blp::detail::PaletteCodec::buildPalette().

◆ BlpVersion1

std::uint32_t wowlib::formats::blp::BlpVersion1 = 1
inlineconstexpr

The BLP2 header version field; always 1 in every shipped client.

Definition at line 47 of file blp.hpp.

Referenced by wowlib::formats::blp::BLP::encode().