package core:compress/zlib

⌘K
Ctrl+K
or
/

    Types

    Compression_Level ¶

    Compression_Level :: enum u8 {
    	Fastest = 0, 
    	Fast    = 1, 
    	Default = 2, 
    	Maximum = 3, 
    }

    Compression_Method ¶

    Compression_Method :: enum u8 {
    	DEFLATE  = 8, 
    	Reserved = 15, 
    }

    Deflate_Error ¶

    Deflate_Error :: compress.Deflate_Error

    Error ¶

    Error :: compress.Error

    General_Error ¶

    General_Error :: compress.General_Error

    Huffman_Table ¶

    Huffman_Table :: struct {
    	fast:        [512]u16,
    	firstcode:   [17]u16,
    	maxcode:     [17]int,
    	firstsymbol: [17]u16,
    	size:        [288]u8,
    	value:       [288]u16,
    }
     

    ZLIB-style Huffman encoding.

    JPEG packs from left, ZLIB from right. We can't share code.
    
    Related Procedures With Parameters
    Related Procedures With Returns

    Options ¶

    Options :: struct {
    	window_size: u16,
    	level:       u8,
    }

    ZLIB_Error ¶

    ZLIB_Error :: compress.ZLIB_Error

    Constants

    DEFLATE_MAX_CHUNK_SIZE ¶

    DEFLATE_MAX_CHUNK_SIZE :: 65535

    DEFLATE_MAX_DISTANCE ¶

    DEFLATE_MAX_DISTANCE :: 32768

    DEFLATE_MAX_LENGTH ¶

    DEFLATE_MAX_LENGTH :: 258

    DEFLATE_MAX_LITERAL_SIZE ¶

    DEFLATE_MAX_LITERAL_SIZE :: 65535

    HUFFMAN_FAST_BITS ¶

    HUFFMAN_FAST_BITS :: 9

    HUFFMAN_FAST_MASK ¶

    HUFFMAN_FAST_MASK :: (1 << HUFFMAN_FAST_BITS) - 1

    HUFFMAN_MAX_BITS ¶

    HUFFMAN_MAX_BITS :: 16

    ZFAST_BITS ¶

    ZFAST_BITS :: 9
     

    Accelerate all cases in default tables.

    ZFAST_MASK ¶

    ZFAST_MASK :: (1 << ZFAST_BITS) - 1

    Variables

    Z_DIST_BASE ¶

    Z_DIST_BASE: [32]u16 = …

    Z_DIST_EXTRA ¶

    Z_DIST_EXTRA: [32]u8 = …

    Z_FIXED_DIST ¶

    Z_FIXED_DIST: [32]u8 = …

    Z_FIXED_LENGTH ¶

    Z_FIXED_LENGTH: [288]u8 = …

    Z_LENGTH_BASE ¶

    Z_LENGTH_BASE: [31]u16 = …

    Z_LENGTH_DEZIGZAG ¶

    Z_LENGTH_DEZIGZAG: []u8 = …

    Z_LENGTH_EXTRA ¶

    Z_LENGTH_EXTRA: [31]u8 = …

    Procedures

    allocate_huffman_table ¶

    allocate_huffman_table :: proc(allocator := context.allocator) -> (z: ^Huffman_Table, err: compress.Error) {…}

    build_huffman ¶

    build_huffman :: proc(z: ^Huffman_Table, code_lengths: []u8) -> (err: compress.Error) {…}

    decode_huffman ¶

    decode_huffman :: proc(z: ^$T, t: ^Huffman_Table) -> (r: u16, err: compress.Error) {…}

    decode_huffman_slowpath ¶

    decode_huffman_slowpath :: proc(z: ^$T, t: ^Huffman_Table) -> (r: u16, err: compress.Error) {…}

    grow_buffer ¶

    grow_buffer :: proc(buf: ^[dynamic]u8) -> (err: compress.Error) {…}

    inflate_from_byte_array ¶

    inflate_from_byte_array :: proc(input: []u8, buf: ^bytes.Buffer, raw: bool = false, expected_output_size: int = -1) -> (err: compress.Error) {…}

    inflate_from_byte_array_raw ¶

    inflate_from_byte_array_raw :: proc(input: []u8, buf: ^bytes.Buffer, raw: bool = false, expected_output_size: int = -1) -> (err: compress.Error) {…}

    inflate_from_context ¶

    inflate_from_context :: proc(using ctx: ^compress.Context_Memory_Input, raw: bool = false, expected_output_size: int = -1, allocator := context.allocator) -> (err: compress.Error) {…}

    inflate_raw ¶

    inflate_raw :: proc(z: ^$T, expected_output_size: int = -1, allocator := context.allocator) -> (err: compress.Error) {…}

    parse_huffman_block ¶

    parse_huffman_block :: proc(z: ^$T, z_repeat, z_offset: ^Huffman_Table) -> (err: compress.Error) {…}

    repl_byte ¶

    repl_byte :: proc(z: ^$T, count: u16, c: u8) -> (err: io.Error) {…}

    repl_bytes ¶

    repl_bytes :: proc(z: ^$T, count: u16, distance: u16) -> (err: io.Error) {…}

    write_byte ¶

    write_byte :: proc(z: ^$T, c: u8) -> (err: io.Error) {…}

    z_bit_reverse ¶

    z_bit_reverse :: proc(n: u16, bits: u8) -> (r: u16) {…}
     

    Implementation starts here

    Procedure Groups

    Source Files

    Generation Information

    Generated with odin version dev-2024-04 (vendor "odin") Windows_amd64 @ 2024-04-25 21:10:21.681707700 +0000 UTC