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

The MCSH shadow-map codec: a 512-byte 1-bit bitmap on disk, a 4096-texel 0/1 surface in memory. More...

#include <wowlib/formats/adt/codec.hpp>

Inheritance diagram for wowlib::formats::adt::detail::ShadowMapCodec:

Public Member Functions

std::vector< std::uint8_t > decode (std::span< const std::byte > src, bool fixEdges) const
 Decode a 512-byte 1-bit shadow bitmap to 4096 texels (0/1), LSB first.
void encode (std::span< const std::uint8_t > map, std::vector< std::byte > &out) const
 Encode 4096 texels (0/1) to a 512-byte 1-bit bitmap, LSB first.

Detailed Description

The MCSH shadow-map codec: a 512-byte 1-bit bitmap on disk, a 4096-texel 0/1 surface in memory.

Stateless (a shadow map has no bit-depth axis), but a class for symmetry with AlphaMapCodec and to keep the encoding routines off the free-function surface.

Definition at line 203 of file codec.hpp.

Member Function Documentation

◆ decode()

std::vector< std::uint8_t > wowlib::formats::adt::detail::ShadowMapCodec::decode ( std::span< const std::byte > src,
bool fixEdges ) const
inlinenodiscard

Decode a 512-byte 1-bit shadow bitmap to 4096 texels (0/1), LSB first.

Parameters
srcthe on-disk 1-bit bytes.
fixEdgeswhether to repair the 63x63 "unfixed" form.
Returns
the decoded 4096-texel map.

Definition at line 210 of file codec.hpp.

References wowlib::formats::adt::detail::TerrainMapCodec::_fixLastRowCol(), and wowlib::formats::adt::detail::AlphaTexels.

Referenced by wowlib::formats::adt::detail::ShadowCodec::read().

◆ encode()

void wowlib::formats::adt::detail::ShadowMapCodec::encode ( std::span< const std::uint8_t > map,
std::vector< std::byte > & out ) const
inline

Encode 4096 texels (0/1) to a 512-byte 1-bit bitmap, LSB first.

Parameters
mapthe 4096-texel surface.
outthe destination buffer, appended to.

Definition at line 223 of file codec.hpp.

References wowlib::formats::adt::detail::ShadowBytes.

Referenced by wowlib::formats::adt::detail::ShadowCodec::write().


The documentation for this class was generated from the following file: