backport changes from c++ for datamatrix

This commit is contained in:
Henry Schimke
2023-01-28 17:04:17 -06:00
parent 5637c26fb6
commit 0107d35b1b
4 changed files with 35 additions and 10 deletions

View File

@@ -51,6 +51,7 @@ impl DataBlock {
pub fn getDataBlocks(
rawCodewords: &[u8],
version: &Version,
fix259: bool,
) -> Result<Vec<DataBlock>, Exceptions> {
// Figure out the number and size of data blocks used by this version
let ecBlocks = version.getECBlocks();
@@ -121,7 +122,7 @@ impl DataBlock {
// for (int i = longerBlocksNumDataCodewords; i < max; i++) {
for j in 0..numRXingResultBlocks {
// for (int j = 0; j < numRXingResultBlocks; j++) {
let jOffset = if specialVersion {
let jOffset = if specialVersion && fix259 {
(j + 8) % numRXingResultBlocks
} else {
j