MCPcopy Create free account
hub / github.com/MeisApps/pcbu-desktop / drawFunctionPatterns

Method drawFunctionPatterns

deps/qrcodegen.cpp:387–413  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

385
386
387void QrCode::drawFunctionPatterns() {
388 // Draw horizontal and vertical timing patterns
389 for (int i = 0; i < size; i++) {
390 setFunctionModule(6, i, i % 2 == 0);
391 setFunctionModule(i, 6, i % 2 == 0);
392 }
393
394 // Draw 3 finder patterns (all corners except bottom right; overwrites some timing modules)
395 drawFinderPattern(3, 3);
396 drawFinderPattern(size - 4, 3);
397 drawFinderPattern(3, size - 4);
398
399 // Draw numerous alignment patterns
400 const vector<int> alignPatPos = getAlignmentPatternPositions();
401 size_t numAlign = alignPatPos.size();
402 for (size_t i = 0; i < numAlign; i++) {
403 for (size_t j = 0; j < numAlign; j++) {
404 // Don't draw on the three finder corners
405 if (!((i == 0 && j == 0) || (i == 0 && j == numAlign - 1) || (i == numAlign - 1 && j == 0)))
406 drawAlignmentPattern(alignPatPos.at(i), alignPatPos.at(j));
407 }
408 }
409
410 // Draw configuration data
411 drawFormatBits(0); // Dummy mask value; overwritten later in the constructor
412 drawVersion();
413}
414
415
416void QrCode::drawFormatBits(int msk) {

Callers

nothing calls this directly

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected