MCPcopy Create free account
hub / github.com/devilsen/CZXing / BuildMatrix

Function BuildMatrix

czxing/src/main/cpp/zxing/src/qrcode/QRMatrixUtil.cpp:299–316  ·  view source on GitHub ↗

Build 2D matrix of QR Code from "dataBits" with "ecLevel", "version" and "getMaskPattern". On success, store the result in "matrix" and return true.

Source from the content-addressed store, hash-verified

297// Build 2D matrix of QR Code from "dataBits" with "ecLevel", "version" and "getMaskPattern". On
298// success, store the result in "matrix" and return true.
299void BuildMatrix(const BitArray& dataBits, ErrorCorrectionLevel ecLevel, const Version& version, int maskPattern, TritMatrix& matrix)
300{
301 matrix.clear();
302 // Let's get started with embedding big squares at corners.
303 EmbedPositionDetectionPatternsAndSeparators(matrix);
304 // Then, embed the dark dot at the left bottom corner.
305 EmbedDarkDotAtLeftBottomCorner(matrix);
306 // Position adjustment patterns appear if version >= 2.
307 EmbedPositionAdjustmentPatterns(version, matrix);
308 // Timing patterns should be embedded after position adj. patterns.
309 EmbedTimingPatterns(matrix);
310 // Type information appear with any version.
311 EmbedTypeInfo(ecLevel, maskPattern, matrix);
312 // Version info appear if version >= 7.
313 EmbedVersionInfo(version, matrix);
314 // Data should be embedded at end.
315 EmbedDataBits(dataBits, maskPattern, matrix);
316}
317
318} // namespace ZXing::QRCode

Callers 2

ChooseMaskPatternFunction · 0.85
EncodeFunction · 0.85

Calls 8

EmbedTimingPatternsFunction · 0.85
EmbedTypeInfoFunction · 0.85
EmbedVersionInfoFunction · 0.85
EmbedDataBitsFunction · 0.85
clearMethod · 0.45

Tested by

no test coverage detected