Expand description
Data mode segmentation optimizer.
QR codes support four data modes (Numeric, Alphanumeric, Byte, Kanji), each with different efficiency for different character types. This module finds the optimal sequence of mode switches to minimize the total number of bits required to encode the input data.
The optimizer uses dynamic programming to explore all possible mode transitions and selects the segmentation that produces the shortest bit stream for the target QR code version.
Structs§
- Optimizer
- Iterator that merges consecutive parser segments to minimize the total
encoded length for a given
Version. Created viaParser::optimize. - Parser
- QR code data parser to classify the input into distinct segments.
- Segment
- A segment of data committed to an encoding mode.
Functions§
- optimize_
segments - Computes the minimum-size merge plan for parser segments.
- total_
encoded_ len - Computes the total encoded length of all segments.