Added comment about remainder bits in QR symbol in all language versions.

This commit is contained in:
Nayuki Minase 2016-05-07 19:02:11 +00:00
parent 0cc355344d
commit 2de9610756
4 changed files with 8 additions and 0 deletions

View File

@ -358,6 +358,8 @@ void qrcodegen::QrCode::drawCodewords(const std::vector<uint8_t> &data) {
modules.at(y).at(x) = ((data.at(i >> 3) >> (7 - (i & 7))) & 1) != 0; modules.at(y).at(x) = ((data.at(i >> 3) >> (7 - (i & 7))) & 1) != 0;
i++; i++;
} }
// If there are any remainder bits (0 to 7), they are already
// set to 0/false/white when the grid of modules was initialized
} }
} }
} }

View File

@ -514,6 +514,8 @@ public final class QrCode {
modules[y][x] = ((data[i >>> 3] >>> (7 - (i & 7))) & 1) != 0; modules[y][x] = ((data[i >>> 3] >>> (7 - (i & 7))) & 1) != 0;
i++; i++;
} }
// If there are any remainder bits (0 to 7), they are already
// set to 0/false/white when the grid of modules was initialized
} }
} }
} }

View File

@ -415,6 +415,8 @@ var qrcodegen = new function() {
modules[y][x] = ((data[i >>> 3] >>> (7 - (i & 7))) & 1) != 0; modules[y][x] = ((data[i >>> 3] >>> (7 - (i & 7))) & 1) != 0;
i++; i++;
} }
// If there are any remainder bits (0 to 7), they are already
// set to 0/false/white when the grid of modules was initialized
} }
} }
} }

View File

@ -409,6 +409,8 @@ class QrCode(object):
if not self._isfunction[y][x] and i < len(data) * 8: if not self._isfunction[y][x] and i < len(data) * 8:
self._modules[y][x] = ((data[i >> 3] >> (7 - (i & 7))) & 1) != 0 self._modules[y][x] = ((data[i >> 3] >> (7 - (i & 7))) & 1) != 0
i += 1 i += 1
# If there are any remainder bits (0 to 7), they are already
# set to 0/false/white when the grid of modules was initialized
assert i == len(data) * 8 assert i == len(data) * 8