mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-20 16:47:28 +01:00
29 lines
512 B
Plaintext
29 lines
512 B
Plaintext
use "std/io"
|
|
|
|
pub struct lzw_decoder?(
|
|
// TODO: default values??
|
|
literal_width u32[2..8],
|
|
stack[4096] u8,
|
|
suffixes[4096] u8,
|
|
prefixes[4096] u16,
|
|
)
|
|
|
|
pub func lzw_decoder.decode?(dst ptr io.buf1, src ptr io.buf1, src_final bool)() {
|
|
var bits u32
|
|
var n_bits u32
|
|
|
|
// TODO: set clear_code, end_code, etc.
|
|
|
|
var width u32[..12] = this.literal_width + 1
|
|
|
|
// TODO: implement.
|
|
|
|
while n_bits < width,
|
|
post n_bits >= width,
|
|
{
|
|
assert n_bits < 12 via "a < b: a < c <= b"(c:width)
|
|
// TODO.
|
|
n_bits += 8
|
|
}
|
|
}
|