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

Function Detect

czxing/src/main/cpp/zxing/src/datamatrix/DMDetector.cpp:916–945  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

914}
915
916DetectorResults Detect(const BitMatrix& image, bool tryHarder, bool tryRotate, bool isPure)
917{
918#ifdef __cpp_impl_coroutine
919 if (isPure) {
920 co_yield DetectPure(image);
921 } else {
922 bool found = false;
923 for (auto&& r : DetectNew(image, tryHarder, tryRotate)) {
924 found = true;
925 co_yield std::move(r);
926 }
927 if (!found && tryHarder) {
928 if (auto r = DetectPure(image); r.isValid())
929 co_yield std::move(r);
930 else if(auto r = DetectOld(image); r.isValid())
931 co_yield std::move(r);
932 }
933 }
934#else
935 if (isPure)
936 return DetectPure(image);
937
938 auto result = DetectNew(image, tryHarder, tryRotate);
939 if (!result.isValid() && tryHarder)
940 result = DetectPure(image);
941 if (!result.isValid() && tryHarder)
942 result = DetectOld(image);
943 return result;
944#endif
945}
946
947} // namespace ZXing::DataMatrix

Callers 1

decodeMethod · 0.70

Calls 5

DetectPureFunction · 0.85
DetectNewFunction · 0.85
moveFunction · 0.85
DetectOldFunction · 0.85
isValidMethod · 0.45

Tested by

no test coverage detected