Skip to main content

Module encoding

Module encoding 

Source
Expand description

Core encoding representations.

All symbologies produce an Encoded value that the renderer then turns into SVG or PNG. The two shapes mirror BWIPP’s split between renlinear (1D) and renmatrix (2D).

Structs§

BitMatrix
A 2D black/white module grid. (0, 0) is the top-left.
ColorMatrix
A 2D colour matrix: rows × columns cells where each cell carries a palette index into an 8-entry [Rgb8; 8] colour table. Cells with palette index 0 are treated as background (typically white) by the renderer — no rect / pixel emitted.
DotMatrix
A sparse 2D dot grid: rows × columns cells where true means a dot is present at that position. Only odd-parity positions ((x + y) % 2 == 1) ever carry true cells from a DotCode encoder; the renderer treats all true cells uniformly.
LinearPattern
A 1D bar pattern as a run-length encoding.
Postal4Pattern
A 4-state postal symbol: an ordered sequence of bars with optional human-readable text.
Rgb8
8-bit-per-channel sRGB colour. Used in ColorMatrix palettes and the renderer dispatch.
StackedPattern
A stacked / multi-row 1D barcode. Each row carries its own LinearPattern; the renderer draws them top-to-bottom with a one- module spacer between rows.

Enums§

Bar4State
A single bar in a 4-state postal code.
Encoded
Output of encoding a barcode payload.