qr_encode — SYMBOL datacode2d op

• Data kinds: none → table (an op determined by its arguments alone — it takes no image or data input)

• Call: import fullseye as fs; fs.ledger.qr_encode(text, ec_level='M', version=None, mask=None, mode=None) -> 'dict' (to call the implementation directly, import qrsym; qrsym.qr_encode(text, ec_level='M', version=None, mask=None, mode=None) -> 'dict'; from the registry, opssymbol.get("qr_encode"))

• GPU: none (CPU reference implementation only)

Usage

Encode a string into a QR Code (Model 2) module grid and its module-to-codeword map (table).

> The detailed description below is the original text — the summary and the headings are translated.

Encode text as a QR Code (Model 2) module grid.

Parameters

text : str

符号化する文字列 / the text. Byte mode stores UTF-8 (no ECI).

ec_level : {"L", "M", "Q", "H"}

誤り訂正レベル / error-correction level.

version : int or None

1..40。None なら収まる最小 / 1..40, or None for the smallest that fits.

mask : int or None

0..7。None なら 4 規則の減点が最小のもの / 0..7, or None to pick by penalty.

mode : {"numeric", "alphanumeric", "byte"} or None

None なら文字種から自動 / None to choose from the characters.

Returns

dict

modules (N,N) uint8 (1=暗/dark), size, version, ec_level, mask,

mode, text, blocks [(n_data, n_ec)…], n_data_codewords,

n_ec_codewords, function_mask (N,N) bool, codeword_index (N,N) int16

(-1 = 機能/余り / function or remainder), codewords (interleaved list).

Detailed usage guide

• symbol_reading family guide

References (sample data, literature)

• Sample-data catalog (download URLs / licences) — 2-D uses skimage.data (BSD/public domain) plus synthetic images; 3-D lists download URLs for real data sources (Stanford, PDS, …).

• Operator provenance and references — the sources of the research/methods this op family came from.

• The canonical algorithm (author, year) and its uses are named in the family usage guide above.

Runnable examples (verified samples that actually call this op)

• poc_symbol_part_dpm — py -3.11 examples/poc_symbol_part_dpm.py

Ops the type connects to (they accept table as input)

render_symbol · symbol_read_trials · symbol_read_pod · ocr_classify · ocr_read_line · ocr_read_trials

Same category (datacode2d)

qr_decode_modules · qr_locate · qr_sample · qr_read · dm_encode · dm_decode_modules · dm_locate · dm_sample


*Provenance: qrsym.py — SYMBOL operator registry. This per-op note is generated by tools/opdocs.py md (do not hand-edit).*

© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.