Skip to content

Commit

Permalink
ZXingReader: add -single option to setMaxNumberOfSymbols(1)
Browse files Browse the repository at this point in the history
  • Loading branch information
axxel committed Feb 6, 2024
1 parent e107516 commit e01f2d4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions example/ZXingReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ static void PrintUsage(const char* exePath)
<< " -noscale Don't try downscaled images during detection (faster)\n"
<< " -format <FORMAT[,...]>\n"
<< " Only detect given format(s) (faster)\n"
<< " -single Stop after the first barcode is detected (faster)\n"
<< " -ispure Assume the image contains only a 'pure'/perfect code (faster)\n"
<< " -errors Include results with errors (like checksum error)\n"
<< " -binarizer <local|global|fixed>\n"
Expand Down Expand Up @@ -73,6 +74,8 @@ static bool ParseOptions(int argc, char* argv[], ReaderOptions& options, bool& o
options.setTryInvert(false);
} else if (is("-noscale")) {
options.setTryDownscale(false);
} else if (is("-single")) {
options.setMaxNumberOfSymbols(1);
} else if (is("-ispure")) {
options.setIsPure(true);
options.setBinarizer(Binarizer::FixedThreshold);
Expand Down

0 comments on commit e01f2d4

Please sign in to comment.