8#include "../container/module.hpp"
9#include "../parser/parser.hpp"
10#include "../macros.hpp"
15hi_export_module(hikogui.codec.zlib);
17namespace hi {
inline namespace v1 {
31 hi_check(
header_chksum % 31 == 0,
"zlib header checksum failed.");
33 hi_check((
header->CMF & 0xf) == 8,
"zlib compression method must be 8");
34 hi_check(((
header->CMF >> 4) & 0xf) <= 7,
"zlib LZ77 window too large");
35 hi_check((
header->FLG & 0x20) == 0,
"zlib must not use a preset dictionary");
48[[
nodiscard]]
inline bstring zlib_decompress(std::filesystem::path
const& path,
std::size_t max_size = 0x01000000)
DOXYGEN BUG.
Definition algorithm.hpp:16
geometry/margins.hpp
Definition lookahead_iterator.hpp:5
hi_export bstring inflate(std::span< std::byte const > bytes, std::size_t &offset, std::size_t max_size=0x0100 '0000)
Inflate compressed data using the deflate algorithm bytes should include at least 32 bit of trailer,...
Definition inflate.hpp:358
constexpr Out narrow_cast(In const &rhs) noexcept
Cast numeric values without loss of precision.
Definition cast.hpp:377