packbits

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2026 License: MIT Imports: 1 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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