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 greedily merges consecutive 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§
- total_
encoded_ len - Computes the total encoded length of all segments.