rle

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package rle implements a simple RLE encoder, as used in ICNS format.

The encoded format can be seen as a sequence of segments of the following form: - 1 control byte N - a number of data bytes If the control byte value is N < 0x80, then the decoded data contains the

N+1 encoded bytes as is

If the control byte value is N >= 0x80, then the decoded data contains

N-0x80+3 repetitions of the following encoded byte

In particular, this means that the second case can cover only repetitions of

3 or more bytes.

Similarly, a "raw" sequence can contain only 128 (0x7f+1) bytes, and needs to be split if a longer non-repetitive pattern is seen.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(p []byte) []byte

Decode RLE-decodes the provided bytes.

func Encode

func Encode(b []byte) []byte

Encode RLE-encodes the provided bytes.

Types

This section is empty.

Jump to

Keyboard shortcuts

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