diff --git a/cpp/QrCode.cpp b/cpp/QrCode.cpp index ab6039c..52281f7 100644 --- a/cpp/QrCode.cpp +++ b/cpp/QrCode.cpp @@ -119,14 +119,14 @@ QrCode::QrCode(int ver, Ecc ecl, const vector &dataCodewords, int mask) version(ver), size(MIN_VERSION <= ver && ver <= MAX_VERSION ? ver * 4 + 17 : -1), // Avoid signed overflow undefined behavior errorCorrectionLevel(ecl), - modules (size, vector(size)), // Entirely white grid + modules (size, vector(size)), // Initially all white isFunction(size, vector(size)) { // Check arguments if (ver < MIN_VERSION || ver > MAX_VERSION || mask < -1 || mask > 7) throw std::domain_error("Value out of range"); - // Draw function patterns, draw all codewords, do masking + // Compute ECC, draw modules, do masking drawFunctionPatterns(); const vector allCodewords = addEccAndInterleave(dataCodewords); drawCodewords(allCodewords); diff --git a/java/io/nayuki/qrcodegen/QrCode.java b/java/io/nayuki/qrcodegen/QrCode.java index 83f17f7..d89781c 100644 --- a/java/io/nayuki/qrcodegen/QrCode.java +++ b/java/io/nayuki/qrcodegen/QrCode.java @@ -222,10 +222,10 @@ public final class QrCode { // Initialize fields version = ver; size = ver * 4 + 17; - modules = new boolean[size][size]; // Entirely white grid + modules = new boolean[size][size]; // Initially all white isFunction = new boolean[size][size]; - // Draw function patterns, draw all codewords, do masking + // Compute ECC, draw modules, do masking drawFunctionPatterns(); byte[] allCodewords = addEccAndInterleave(dataCodewords); drawCodewords(allCodewords); diff --git a/javascript/qrcodegen.js b/javascript/qrcodegen.js index 5c6835a..25d2d09 100644 --- a/javascript/qrcodegen.js +++ b/javascript/qrcodegen.js @@ -83,14 +83,14 @@ var qrcodegen = new function() { var row = []; for (var i = 0; i < size; i++) row.push(false); - var modules = []; + var modules = []; // Initially all white var isFunction = []; for (var i = 0; i < size; i++) { modules .push(row.slice()); isFunction.push(row.slice()); } - // Handle grid fields, draw function patterns, draw all codewords + // Compute ECC, draw modules drawFunctionPatterns(); var allCodewords = addEccAndInterleave(dataCodewords); drawCodewords(allCodewords); diff --git a/python/qrcodegen.py b/python/qrcodegen.py index 0313f15..d07a6cf 100644 --- a/python/qrcodegen.py +++ b/python/qrcodegen.py @@ -167,11 +167,11 @@ class QrCode(object): # Initialize grids of modules # The modules of this QR Code symbol (False = white, True = black). Immutable after constructor finishes - self._modules = [[False] * self._size for _ in range(self._size)] + self._modules = [[False] * self._size for _ in range(self._size)] # Initially all white # Indicates function modules that are not subjected to masking. Discarded when constructor finishes self._isfunction = [[False] * self._size for _ in range(self._size)] - # Draw function patterns, draw all codewords + # Compute ECC, draw modules self._draw_function_patterns() allcodewords = self._add_ecc_and_interleave(datacodewords) self._draw_codewords(allcodewords) diff --git a/rust/src/lib.rs b/rust/src/lib.rs index b0d75bd..e8e8525 100644 --- a/rust/src/lib.rs +++ b/rust/src/lib.rs @@ -186,11 +186,11 @@ impl QrCode { size: size as i32, mask: Mask::new(0), // Dummy value errorcorrectionlevel: ecl, - modules : vec![false; size * size], // Entirely white grid + modules : vec![false; size * size], // Initially all white isfunction: vec![false; size * size], }; - // Draw function patterns, draw all codewords, do masking + // Compute ECC, draw modules, do masking result.draw_function_patterns(); let allcodewords: Vec = result.add_ecc_and_interleave(datacodewords); result.draw_codewords(&allcodewords); diff --git a/typescript/qrcodegen.ts b/typescript/qrcodegen.ts index 52d8cec..dde5e87 100644 --- a/typescript/qrcodegen.ts +++ b/typescript/qrcodegen.ts @@ -172,11 +172,11 @@ namespace qrcodegen { for (let i = 0; i < this.size; i++) row.push(false); for (let i = 0; i < this.size; i++) { - this.modules .push(row.slice()); + this.modules .push(row.slice()); // Initially all white this.isFunction.push(row.slice()); } - // Handle grid fields, draw function patterns, draw all codewords + // Compute ECC, draw modules this.drawFunctionPatterns(); let allCodewords: Array = this.addEccAndInterleave(dataCodewords); this.drawCodewords(allCodewords);