XU XUv0.8.8
中文

API

#compress/lzw

import: #compress/lzw

counts: 2 fns, 0 methods, 0 types, 2 consts, 0 ifaces

GIF LSB / PDF MSB LZW.

const lsb

XuAPI
pub const lsb = 0

Purpose

LZW as used by GIF (lsb) and PDF/TIFF-in- (msb), aligned with `compress/lzw`. Codes up to 12 bits; clear + eof after the literal alphabet. Owning strings, no io.Reader. Value `0`.

Parameters

none

const msb

XuAPI
pub const msb = 1

Purpose

Public constant `msb`. Value `1`.

Parameters

none

encode

XuAPI
pub fn encode(src &string, order int, lit_width int) string

Purpose

Encode. Throws on failure.

Parameters

src &string
source (borrowed; caller keeps it; type &string)
order int
order (int)
lit_width int
lit_width (int)

Returns

string — result string

decode

XuAPI
pub fn decode(src &string, order int, lit_width int) string

Purpose

Decode. Throws on failure.

Parameters

src &string
source (borrowed; caller keeps it; type &string)
order int
order (int)
lit_width int
lit_width (int)

Returns

string — result string