packbits

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 7, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package packbits provides a bounded, allocation-free byte-run codec. Control semantics follow TIFF 6.0 section 9; this is an EPS2 chunk codec, not TIFF row/file decoding. The EPS2 subset forbids the unused 0x80 no-op. https://www.itu.int/itudoc/itu-t/com16/tiff-fx/docs/tiff6.pdf

Index

Constants

This section is empty.

Variables

View Source
var ErrBlock = errors.New("packbits: invalid block or insufficient storage")

Functions

func Decode

func Decode(dst, src []byte) error

Decode must fill dst exactly and consume all src. Both slices are caller- bounded and must not overlap. On failure dst is unspecified scratch: never publish it or forward it to a sink unless this function succeeds.

func Encode

func Encode(dst, src []byte) (int, error)

Encode writes a deterministic greedy stream, returning ErrBlock if dst is insufficient. Callers may use a raw fallback; this does not promise globally optimal compression. It borrows disjoint storage and retains neither slice.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL