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

Method decode

czxing/src/main/cpp/zxing/src/qrcode/QRReader.cpp:24–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22namespace ZXing::QRCode {
23
24Result Reader::decode(const BinaryBitmap& image) const
25{
26#if 1
27 if (!_hints.isPure())
28 return FirstOrDefault(decode(image, 1));
29#endif
30
31 auto binImg = image.getBitMatrix();
32 if (binImg == nullptr)
33 return {};
34
35 DetectorResult detectorResult;
36 if (_hints.hasFormat(BarcodeFormat::QRCode))
37 detectorResult = DetectPureQR(*binImg);
38 if (_hints.hasFormat(BarcodeFormat::MicroQRCode) && !detectorResult.isValid())
39 detectorResult = DetectPureMQR(*binImg);
40
41 if (!detectorResult.isValid())
42 return {};
43
44 auto decoderResult = Decode(detectorResult.bits());
45 auto position = detectorResult.position();
46
47 return Result(std::move(decoderResult), std::move(position),
48 detectorResult.bits().width() < 21 ? BarcodeFormat::MicroQRCode : BarcodeFormat::QRCode);
49}
50
51void logFPSet(const FinderPatternSet& fps [[maybe_unused]])
52{

Callers

nothing calls this directly

Calls 15

FirstOrDefaultFunction · 0.85
DetectPureQRFunction · 0.85
DetectPureMQRFunction · 0.85
moveFunction · 0.85
ContainsFunction · 0.85
logFPSetFunction · 0.85
SampleQRFunction · 0.85
SampleMQRFunction · 0.85
getBitMatrixMethod · 0.80
hasFormatMethod · 0.80
bitsMethod · 0.80

Tested by

no test coverage detected