|
wowlib 0.0.0
Read & write World of Warcraft client files — a C++26 core
|
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>
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. | |
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.
|
inlinenodiscard |
Decode a 512-byte 1-bit shadow bitmap to 4096 texels (0/1), LSB first.
| src | the on-disk 1-bit bytes. |
| fixEdges | whether to repair the 63x63 "unfixed" form. |
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().
|
inline |
Encode 4096 texels (0/1) to a 512-byte 1-bit bitmap, LSB first.
| map | the 4096-texel surface. |
| out | the 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().