Contents · Forum Home · StreamSec Tools 4.1.5.363 documentation

StreamSec.QR.Encode

Feature notes: QR code notes (ISO/IEC 18004)

Classes, interfaces and records

classeQrError

inherits from Exception

THE ROOT OF THE LAYER, declared here because every other unit of it reaches this one. A caller driving the whole pipeline - encode, draw, read back, decode - wants one handler for anything QR, and without a common ancestor it needs one per unit and acquires a new one each time the layer grows a unit.

(no public members)

classeQrEncode

inherits from eQrError

(no public members)

recordtQrCode

A finished code. Size is 4*Version + 17 modules on a side, and Dark says whether a module is set. Nothing here knows about pixels: rendering is the caller's, because a screen, a printer and a test harness want three different things.

Version: Integer; EcLevel: tQrEcLevel; Mask: Integer; Size: Integer; function Dark(aX, aY: Integer): Boolean; function AsLines(const aDark: string = '##'; const aLight: string = ' '): TArray<string>;
The code as one line per row, aDark for a set module and aLight for a clear one. For tests, logs and a console.

Types (enumerations, sets, aliases)

typetQrModules

A NAMED type for the modules, not `array of Boolean` written out at each site. Two anonymous dynamic array types are DISTINCT even when they are spelled identically, so Copy() of one does not assign to the other and the compiler says only "incompatible types".

  tQrModules = TArray<Boolean>;

enumtQrEcLevel

The four error correction levels of ISO/IEC 18004, in the standard's own order. The ordinal is NOT the two-bit code that goes into the format information - see cFormatEcBits.

  tQrEcLevel = (qrEcL, qrEcM, qrEcQ, qrEcH);

Routines