58 std::size_t
encodedSize(std::uint32_t width, std::uint32_t height)
const noexcept {
59 return ((width + 3) / 4) * std::size_t{(height + 3) / 4} *
blockBytes();
72 std::uint32_t height)
const;
120 std::uint32_t height,
122 std::uint32_t by)
noexcept;
138 explicit PaletteCodec(std::uint8_t alphaDepth) noexcept : _alphaDepth{alphaDepth} {}
146 std::size_t
encodedSize(std::uint32_t width, std::uint32_t height)
const noexcept {
147 const std::size_t texels = std::size_t{width} * height;
148 return texels + (texels * _alphaDepth + 7) / 8;
160 std::span<const CImVector, BlpPaletteSize> palette,
162 std::uint32_t height)
const;
173 std::span<const CImVector, BlpPaletteSize> palette,
175 std::uint32_t height)
const;
182 std::array<CImVector, BlpPaletteSize>
buildPalette(std::span<const std::uint8_t> rgba)
const;
190 std::uint8_t
_unpackAlpha(std::span<const std::byte> plane, std::size_t index)
const noexcept;
196 void _packAlpha(std::uint8_t alpha, std::span<std::byte> plane, std::size_t index)
const noexcept;
204 static std::uint8_t
_nearestIndex(std::span<const CImVector, BlpPaletteSize> palette,
207 std::uint8_t b)
noexcept;
211 std::uint8_t _alphaDepth;
228 std::uint32_t height)
const;
251 std::vector<std::uint8_t>
downscale(std::span<const std::uint8_t> rgba,
253 std::uint32_t height)
const;
The BLP entity (namespace wowlib::formats::blp): Blizzard's texture format.
The owning byte buffer file contents are read into.
The error-handling vocabulary: ErrorCode, Error and the Result<T> alias every fallible wowlib operati...
std::expected< T, Error > Result
Every fallible wowlib operation returns Result<T>; bindings translate the error branch into a target-...
The binary-level math and color primitives shared across WoW file formats (wowdev....