MCPcopy Create free account
hub / github.com/TactilityProject/Tactility / drawFunctionPatterns

Method drawFunctionPatterns

Libraries/QRCode/tests/QrCode.cpp:194–221  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

192
193
194void qrcodegen::QrCode::drawFunctionPatterns() {
195 // Draw the horizontal and vertical timing patterns
196 for (int i = 0; i < size; i++) {
197 setFunctionModule(6, i, i % 2 == 0);
198 setFunctionModule(i, 6, i % 2 == 0);
199 }
200
201 // Draw 3 finder patterns (all corners except bottom right; overwrites some timing modules)
202 drawFinderPattern(3, 3);
203 drawFinderPattern(size - 4, 3);
204 drawFinderPattern(3, size - 4);
205
206 // Draw the numerous alignment patterns
207 const std::vector<int> alignPatPos(getAlignmentPatternPositions(version));
208 int numAlign = alignPatPos.size();
209 for (int i = 0; i < numAlign; i++) {
210 for (int j = 0; j < numAlign; j++) {
211 if ((i == 0 && j == 0) || (i == 0 && j == numAlign - 1) || (i == numAlign - 1 && j == 0))
212 continue; // Skip the three finder corners
213 else
214 drawAlignmentPattern(alignPatPos.at(i), alignPatPos.at(j));
215 }
216 }
217
218 // Draw configuration data
219 drawFormatBits(0); // Dummy mask value; overwritten later in the constructor
220 drawVersion();
221}
222
223
224void qrcodegen::QrCode::drawFormatBits(int mask) {

Callers

nothing calls this directly

Calls 5

setFunctionModuleFunction · 0.85
drawFinderPatternFunction · 0.85
drawAlignmentPatternFunction · 0.85
drawFormatBitsFunction · 0.85
drawVersionFunction · 0.85

Tested by

no test coverage detected