diff --git a/src/QZXing.cpp b/src/QZXing.cpp index f92a2e1..04453ce 100644 --- a/src/QZXing.cpp +++ b/src/QZXing.cpp @@ -126,6 +126,9 @@ QString QZXing::decoderFormatToString(int fmt) case DecoderFormat_CODE_128: return "CODE_128"; + case DecoderFormat_CODE_128_GS1: + return "CODE_128_GS1"; + case DecoderFormat_DATA_MATRIX: return "DATA_MATRIX"; @@ -230,6 +233,12 @@ void QZXing::setDecoder(const uint &hint) if(hint & DecoderFormat_UPC_EAN_EXTENSION) newHints |= DecodeHints::UPC_EAN_EXTENSION_HINT; + if(hint & DecoderFormat_CODE_128_GS1) + { + newHints |= DecodeHints::CODE_128_HINT; + newHints |= DecodeHints::ASSUME_GS1; + } + enabledDecoders = newHints; emit enabledFormatsChanged(); diff --git a/src/QZXing.h b/src/QZXing.h index 13915e0..e423a4a 100644 --- a/src/QZXing.h +++ b/src/QZXing.h @@ -74,7 +74,8 @@ public: DecoderFormat_RSS_EXPANDED = 1 << 14, DecoderFormat_UPC_A = 1 << 15, DecoderFormat_UPC_E = 1 << 16, - DecoderFormat_UPC_EAN_EXTENSION = 1 << 17 + DecoderFormat_UPC_EAN_EXTENSION = 1 << 17, + DecoderFormat_CODE_128_GS1 = 1 << 18 } ; typedef unsigned int DecoderFormatType; diff --git a/src/zxing/zxing/BarcodeFormat.cpp b/src/zxing/zxing/BarcodeFormat.cpp index 8b023ea..7fcbe4d 100644 --- a/src/zxing/zxing/BarcodeFormat.cpp +++ b/src/zxing/zxing/BarcodeFormat.cpp @@ -36,5 +36,6 @@ const char* zxing::BarcodeFormat::barcodeFormatNames[] = { "RSS_EXPANDED", "UPC_A", "UPC_E", - "UPC_EAN_EXTENSION" + "UPC_EAN_EXTENSION", + "ASSUME_GS1" }; diff --git a/src/zxing/zxing/DecodeHints.cpp b/src/zxing/zxing/DecodeHints.cpp index 82f5504..3961683 100644 --- a/src/zxing/zxing/DecodeHints.cpp +++ b/src/zxing/zxing/DecodeHints.cpp @@ -24,48 +24,68 @@ using zxing::Ref; using zxing::ResultPointCallback; -using zxing::DecodeHintType; using zxing::DecodeHints; // VC++ using zxing::BarcodeFormat; -//favoritas37-22-01-14-change -#ifndef Q_CC_MSVC -const zxing::DecodeHintType DecodeHints::CHARACTER_SET; -#endif // Q_CC_MSVC +const zxing::DecodeHintType DecodeHints::AZTEC_HINT = 1 << BarcodeFormat::AZTEC; +const zxing::DecodeHintType DecodeHints::CODABAR_HINT = 1 << BarcodeFormat::CODABAR; +const zxing::DecodeHintType DecodeHints::CODE_39_HINT = 1 << BarcodeFormat::CODE_39; +const zxing::DecodeHintType DecodeHints::CODE_93_HINT = 1 << BarcodeFormat::CODE_93; +const zxing::DecodeHintType DecodeHints::CODE_128_HINT = 1 << BarcodeFormat::CODE_128; +const zxing::DecodeHintType DecodeHints::DATA_MATRIX_HINT = 1 << BarcodeFormat::DATA_MATRIX; +const zxing::DecodeHintType DecodeHints::EAN_8_HINT = 1 << BarcodeFormat::EAN_8; +const zxing::DecodeHintType DecodeHints::EAN_13_HINT = 1 << BarcodeFormat::EAN_13; +const zxing::DecodeHintType DecodeHints::ITF_HINT = 1 << BarcodeFormat::ITF; +const zxing::DecodeHintType DecodeHints::MAXICODE_HINT = 1 << BarcodeFormat::MAXICODE; +const zxing::DecodeHintType DecodeHints::PDF_417_HINT = 1 << BarcodeFormat::PDF_417; +const zxing::DecodeHintType DecodeHints::QR_CODE_HINT = 1 << BarcodeFormat::QR_CODE; +const zxing::DecodeHintType DecodeHints::RSS_14_HINT = 1 << BarcodeFormat::RSS_14; +const zxing::DecodeHintType DecodeHints::RSS_EXPANDED_HINT = 1 << BarcodeFormat::RSS_EXPANDED; +const zxing::DecodeHintType DecodeHints::UPC_A_HINT = 1 << BarcodeFormat::UPC_A; +const zxing::DecodeHintType DecodeHints::UPC_E_HINT = 1 << BarcodeFormat::UPC_E; +const zxing::DecodeHintType DecodeHints::UPC_EAN_EXTENSION_HINT = 1 << BarcodeFormat::UPC_EAN_EXTENSION; +const zxing::DecodeHintType DecodeHints::ASSUME_GS1 = 1 << BarcodeFormat::ASSUME_GS1; +const zxing::DecodeHintType DecodeHints::TRYHARDER_HINT = 1 << 31; +const zxing::DecodeHintType DecodeHints::CHARACTER_SET = 1 << 30; const zxing::DecodeHints DecodeHints::PRODUCT_HINT( - UPC_A_HINT | - UPC_E_HINT | - EAN_13_HINT | - EAN_8_HINT | - RSS_14_HINT + DecodeHints::UPC_A_HINT | + DecodeHints::UPC_E_HINT | + DecodeHints::EAN_13_HINT | + DecodeHints::EAN_8_HINT | + DecodeHints::RSS_14_HINT ); const zxing::DecodeHints DecodeHints::ONED_HINT( - CODE_39_HINT | - CODE_93_HINT | - CODE_128_HINT | - ITF_HINT | - CODABAR_HINT | + DecodeHints::CODE_39_HINT | + DecodeHints::CODE_93_HINT | + DecodeHints::CODE_128_HINT | + DecodeHints::ITF_HINT | + DecodeHints::CODABAR_HINT | DecodeHints::PRODUCT_HINT ); const zxing::DecodeHints DecodeHints::DEFAULT_HINT( - ONED_HINT | - QR_CODE_HINT | - DATA_MATRIX_HINT | - AZTEC_HINT | - PDF_417_HINT + DecodeHints::ONED_HINT | + DecodeHints::QR_CODE_HINT | + DecodeHints::DATA_MATRIX_HINT | + DecodeHints::AZTEC_HINT | + DecodeHints::PDF_417_HINT ); DecodeHints::DecodeHints() { hints = 0; } -DecodeHints::DecodeHints(DecodeHintType init) { - hints = init; +DecodeHints::DecodeHints(const zxing::DecodeHintType &init) { + hints = init; +} + +DecodeHints::DecodeHints(const DecodeHints &other) { + hints = other.hints; + callback = other.callback; } void DecodeHints::addFormat(BarcodeFormat toadd) { @@ -87,6 +107,7 @@ void DecodeHints::addFormat(BarcodeFormat toadd) { case BarcodeFormat::UPC_A: hints |= UPC_A_HINT; break; case BarcodeFormat::UPC_E: hints |= UPC_E_HINT; break; case BarcodeFormat::UPC_EAN_EXTENSION: hints |= UPC_EAN_EXTENSION_HINT; break; + case BarcodeFormat::ASSUME_GS1: hints |= ASSUME_GS1; break; default: throw IllegalArgumentException("Unrecognizd barcode format"); } } @@ -134,7 +155,14 @@ void DecodeHints::setResultPointCallback(Ref const& _callba } Ref DecodeHints::getResultPointCallback() const { - return callback; + return callback; +} + +zxing::DecodeHints &zxing::DecodeHints::operator =(const zxing::DecodeHints &other) +{ + hints = other.hints; + callback = other.callback; + return *this; } zxing::DecodeHints zxing::operator | (DecodeHints const& l, DecodeHints const& r) { diff --git a/src/zxing/zxing/DecodeHints.h b/src/zxing/zxing/DecodeHints.h index 6e5da9b..d11cfa3 100644 --- a/src/zxing/zxing/DecodeHints.h +++ b/src/zxing/zxing/DecodeHints.h @@ -35,29 +35,29 @@ class DecodeHints { Ref callback; public: - static const DecodeHintType AZTEC_HINT = 1 << BarcodeFormat::AZTEC; - static const DecodeHintType CODABAR_HINT = 1 << BarcodeFormat::CODABAR; - static const DecodeHintType CODE_39_HINT = 1 << BarcodeFormat::CODE_39; - static const DecodeHintType CODE_93_HINT = 1 << BarcodeFormat::CODE_93; - static const DecodeHintType CODE_128_HINT = 1 << BarcodeFormat::CODE_128; - static const DecodeHintType DATA_MATRIX_HINT = 1 << BarcodeFormat::DATA_MATRIX; - static const DecodeHintType EAN_8_HINT = 1 << BarcodeFormat::EAN_8; - static const DecodeHintType EAN_13_HINT = 1 << BarcodeFormat::EAN_13; - static const DecodeHintType ITF_HINT = 1 << BarcodeFormat::ITF; - static const DecodeHintType MAXICODE_HINT = 1 << BarcodeFormat::MAXICODE; - static const DecodeHintType PDF_417_HINT = 1 << BarcodeFormat::PDF_417; - static const DecodeHintType QR_CODE_HINT = 1 << BarcodeFormat::QR_CODE; - static const DecodeHintType RSS_14_HINT = 1 << BarcodeFormat::RSS_14; - static const DecodeHintType RSS_EXPANDED_HINT = 1 << BarcodeFormat::RSS_EXPANDED; - static const DecodeHintType UPC_A_HINT = 1 << BarcodeFormat::UPC_A; - static const DecodeHintType UPC_E_HINT = 1 << BarcodeFormat::UPC_E; - static const DecodeHintType UPC_EAN_EXTENSION_HINT = 1 << BarcodeFormat::UPC_EAN_EXTENSION; + static const DecodeHintType AZTEC_HINT; + static const DecodeHintType CODABAR_HINT; + static const DecodeHintType CODE_39_HINT; + static const DecodeHintType CODE_93_HINT; + static const DecodeHintType CODE_128_HINT; + static const DecodeHintType DATA_MATRIX_HINT; + static const DecodeHintType EAN_8_HINT; + static const DecodeHintType EAN_13_HINT; + static const DecodeHintType ITF_HINT; + static const DecodeHintType MAXICODE_HINT; + static const DecodeHintType PDF_417_HINT; + static const DecodeHintType QR_CODE_HINT; + static const DecodeHintType RSS_14_HINT; + static const DecodeHintType RSS_EXPANDED_HINT; + static const DecodeHintType UPC_A_HINT; + static const DecodeHintType UPC_E_HINT; + static const DecodeHintType UPC_EAN_EXTENSION_HINT; + static const DecodeHintType ASSUME_GS1; - static const DecodeHintType TRYHARDER_HINT = 1 << 31; - static const DecodeHintType CHARACTER_SET = 1 << 30; + static const DecodeHintType TRYHARDER_HINT; + static const DecodeHintType CHARACTER_SET; // static const DecodeHintType ALLOWED_LENGTHS = 1 << 29; // static const DecodeHintType ASSUME_CODE_39_CHECK_DIGIT = 1 << 28; - static const DecodeHintType ASSUME_GS1 = 1 << BarcodeFormat::ASSUME_GS1; // static const DecodeHintType NEED_RESULT_POINT_CALLBACK = 1 << 26; static const DecodeHints PRODUCT_HINT; @@ -65,7 +65,8 @@ class DecodeHints { static const DecodeHints DEFAULT_HINT; DecodeHints(); - DecodeHints(DecodeHintType init); + DecodeHints(const DecodeHintType &init); + DecodeHints(const DecodeHints &other); void addFormat(BarcodeFormat toadd); bool containsFormat(BarcodeFormat tocheck) const; @@ -77,7 +78,9 @@ class DecodeHints { void setResultPointCallback(Ref const&); Ref getResultPointCallback() const; - friend DecodeHints operator | (DecodeHints const&, DecodeHints const&); + DecodeHints& operator =(DecodeHints const &other); + + friend DecodeHints operator| (DecodeHints const&, DecodeHints const&); }; } diff --git a/src/zxing/zxing/oned/CodaBarReader.cpp b/src/zxing/zxing/oned/CodaBarReader.cpp index 2913ab2..3db0a47 100644 --- a/src/zxing/zxing/oned/CodaBarReader.cpp +++ b/src/zxing/zxing/oned/CodaBarReader.cpp @@ -76,7 +76,7 @@ const int CodaBarReader::PADDING = CodaBarReader::CodaBarReader() : counters(80, 0), counterLength(0) {} -Ref CodaBarReader::decodeRow(int rowNumber, Ref row) { +Ref CodaBarReader::decodeRow(int rowNumber, Ref row, zxing::DecodeHints /*hints*/) { { // Arrays.fill(counters, 0); int size = counters.size(); diff --git a/src/zxing/zxing/oned/CodaBarReader.h b/src/zxing/zxing/oned/CodaBarReader.h index a9f21b2..14d1eed 100644 --- a/src/zxing/zxing/oned/CodaBarReader.h +++ b/src/zxing/zxing/oned/CodaBarReader.h @@ -37,7 +37,7 @@ private: public: CodaBarReader(); - Ref decodeRow(int rowNumber, Ref row); + Ref decodeRow(int rowNumber, Ref row, DecodeHints hints); void validatePattern(int start); diff --git a/src/zxing/zxing/oned/Code128Reader.cpp b/src/zxing/zxing/oned/Code128Reader.cpp index 386acac..56ec39b 100644 --- a/src/zxing/zxing/oned/Code128Reader.cpp +++ b/src/zxing/zxing/oned/Code128Reader.cpp @@ -249,9 +249,9 @@ int Code128Reader::decodeCode(Ref row, vector& counters, int rowO } } -Ref Code128Reader::decodeRow(int rowNumber, Ref row) { - //bool convertFNC1 = activeHints.containsFormat(zxing::BarcodeFormat(zxing::BarcodeFormat::Value::ASSUME_GS1)); - bool convertFNC1 = true; +Ref Code128Reader::decodeRow(int rowNumber, Ref row, zxing::DecodeHints hints) { + bool convertFNC1 = hints.containsFormat(zxing::BarcodeFormat(zxing::BarcodeFormat::Value::ASSUME_GS1)); + vector startPatternInfo (findStartPattern(row)); int startCode = startPatternInfo[2]; int codeSet; diff --git a/src/zxing/zxing/oned/Code128Reader.h b/src/zxing/zxing/oned/Code128Reader.h index 7731ac7..052f540 100644 --- a/src/zxing/zxing/oned/Code128Reader.h +++ b/src/zxing/zxing/oned/Code128Reader.h @@ -35,7 +35,7 @@ private: int rowOffset); public: - Ref decodeRow(int rowNumber, Ref row); + Ref decodeRow(int rowNumber, Ref row, DecodeHints hints); Code128Reader(); ~Code128Reader(); diff --git a/src/zxing/zxing/oned/Code39Reader.cpp b/src/zxing/zxing/oned/Code39Reader.cpp index 32abb6f..04583de 100644 --- a/src/zxing/zxing/oned/Code39Reader.cpp +++ b/src/zxing/zxing/oned/Code39Reader.cpp @@ -92,7 +92,7 @@ Code39Reader::Code39Reader(bool usingCheckDigit_, bool extendedMode_) { init(usingCheckDigit_, extendedMode_); } -Ref Code39Reader::decodeRow(int rowNumber, Ref row) { +Ref Code39Reader::decodeRow(int rowNumber, Ref row, zxing::DecodeHints /*hints*/) { std::vector& theCounters (counters); { // Arrays.fill(counters, 0); int size = theCounters.size(); diff --git a/src/zxing/zxing/oned/Code39Reader.h b/src/zxing/zxing/oned/Code39Reader.h index 28b6285..4bab3bc 100644 --- a/src/zxing/zxing/oned/Code39Reader.h +++ b/src/zxing/zxing/oned/Code39Reader.h @@ -54,7 +54,7 @@ public: Code39Reader(bool usingCheckDigit_); Code39Reader(bool usingCheckDigit_, bool extendedMode_); - Ref decodeRow(int rowNumber, Ref row); + Ref decodeRow(int rowNumber, Ref row, DecodeHints hints); }; } diff --git a/src/zxing/zxing/oned/Code93Reader.cpp b/src/zxing/zxing/oned/Code93Reader.cpp index 8fd64e1..f01dba2 100644 --- a/src/zxing/zxing/oned/Code93Reader.cpp +++ b/src/zxing/zxing/oned/Code93Reader.cpp @@ -64,7 +64,7 @@ Code93Reader::Code93Reader() { counters.resize(6); } -Ref Code93Reader::decodeRow(int rowNumber, Ref row) { +Ref Code93Reader::decodeRow(int rowNumber, Ref row, zxing::DecodeHints /*hints*/) { Range start (findAsteriskPattern(row)); // Read off white space int nextStart = row->getNextSet(start[1]); diff --git a/src/zxing/zxing/oned/Code93Reader.h b/src/zxing/zxing/oned/Code93Reader.h index 7237aad..95c6828 100644 --- a/src/zxing/zxing/oned/Code93Reader.h +++ b/src/zxing/zxing/oned/Code93Reader.h @@ -35,7 +35,7 @@ namespace oned { class Code93Reader : public OneDReader { public: Code93Reader(); - Ref decodeRow(int rowNumber, Ref row); + Ref decodeRow(int rowNumber, Ref row, DecodeHints hints); private: std::string decodeRowResult; diff --git a/src/zxing/zxing/oned/ITFReader.cpp b/src/zxing/zxing/oned/ITFReader.cpp index 59e7a56..4fc1331 100644 --- a/src/zxing/zxing/oned/ITFReader.cpp +++ b/src/zxing/zxing/oned/ITFReader.cpp @@ -81,7 +81,7 @@ ITFReader::ITFReader() : narrowLineWidth(-1) { } -Ref ITFReader::decodeRow(int rowNumber, Ref row) { +Ref ITFReader::decodeRow(int rowNumber, Ref row, zxing::DecodeHints /*hints*/) { // Find out where the Middle section (payload) starts & ends Range startRange = decodeStart(row); diff --git a/src/zxing/zxing/oned/ITFReader.h b/src/zxing/zxing/oned/ITFReader.h index ce50dd9..aea279f 100644 --- a/src/zxing/zxing/oned/ITFReader.h +++ b/src/zxing/zxing/oned/ITFReader.h @@ -43,7 +43,7 @@ private: void append(char* s, char c); public: - Ref decodeRow(int rowNumber, Ref row); + Ref decodeRow(int rowNumber, Ref row, DecodeHints hints); ITFReader(); ~ITFReader(); }; diff --git a/src/zxing/zxing/oned/MultiFormatOneDReader.cpp b/src/zxing/zxing/oned/MultiFormatOneDReader.cpp index 8c0321b..3bfe5d0 100644 --- a/src/zxing/zxing/oned/MultiFormatOneDReader.cpp +++ b/src/zxing/zxing/oned/MultiFormatOneDReader.cpp @@ -80,12 +80,12 @@ MultiFormatOneDReader::MultiFormatOneDReader(DecodeHints hints) : readers() { #include -Ref MultiFormatOneDReader::decodeRow(int rowNumber, Ref row) { +Ref MultiFormatOneDReader::decodeRow(int rowNumber, Ref row, zxing::DecodeHints hints) { int size = readers.size(); for (int i = 0; i < size; i++) { OneDReader* reader = readers[i]; try { - Ref result = reader->decodeRow(rowNumber, row); + Ref result = reader->decodeRow(rowNumber, row, hints); return result; } catch (ReaderException const& re) { (void)re; diff --git a/src/zxing/zxing/oned/MultiFormatOneDReader.h b/src/zxing/zxing/oned/MultiFormatOneDReader.h index c939f66..dae214d 100644 --- a/src/zxing/zxing/oned/MultiFormatOneDReader.h +++ b/src/zxing/zxing/oned/MultiFormatOneDReader.h @@ -30,7 +30,7 @@ namespace zxing { public: MultiFormatOneDReader(DecodeHints hints); - Ref decodeRow(int rowNumber, Ref row); + Ref decodeRow(int rowNumber, Ref row, DecodeHints hints); }; } } diff --git a/src/zxing/zxing/oned/MultiFormatUPCEANReader.cpp b/src/zxing/zxing/oned/MultiFormatUPCEANReader.cpp index 0376649..dbc67b2 100644 --- a/src/zxing/zxing/oned/MultiFormatUPCEANReader.cpp +++ b/src/zxing/zxing/oned/MultiFormatUPCEANReader.cpp @@ -61,7 +61,7 @@ MultiFormatUPCEANReader::MultiFormatUPCEANReader(DecodeHints hints) : readers() #include -Ref MultiFormatUPCEANReader::decodeRow(int rowNumber, Ref row) { +Ref MultiFormatUPCEANReader::decodeRow(int rowNumber, Ref row, zxing::DecodeHints /*hints*/) { // Compute this location once and reuse it on multiple implementations UPCEANReader::Range startGuardPattern = UPCEANReader::findStartGuardPattern(row); for (int i = 0, e = readers.size(); i < e; i++) { diff --git a/src/zxing/zxing/oned/MultiFormatUPCEANReader.h b/src/zxing/zxing/oned/MultiFormatUPCEANReader.h index d0e2b20..9e141f9 100644 --- a/src/zxing/zxing/oned/MultiFormatUPCEANReader.h +++ b/src/zxing/zxing/oned/MultiFormatUPCEANReader.h @@ -32,7 +32,7 @@ private: std::vector< Ref > readers; public: MultiFormatUPCEANReader(DecodeHints hints); - Ref decodeRow(int rowNumber, Ref row); + Ref decodeRow(int rowNumber, Ref row, DecodeHints hints); }; } diff --git a/src/zxing/zxing/oned/OneDReader.cpp b/src/zxing/zxing/oned/OneDReader.cpp index 906a60e..4cf73b5 100644 --- a/src/zxing/zxing/oned/OneDReader.cpp +++ b/src/zxing/zxing/oned/OneDReader.cpp @@ -35,8 +35,6 @@ using zxing::BinaryBitmap; using zxing::BitArray; using zxing::DecodeHints; -OneDReader::OneDReader() {} - Ref OneDReader::decode(Ref image, DecodeHints hints) { try { return doDecode(image, hints); @@ -120,13 +118,10 @@ Ref OneDReader::doDecode(Ref image, DecodeHints hints) { row->reverse(); // reverse the row and continue } - // Java hints stuff missing - activeHints = hints; - try { // Look for a barcode // std::cerr << "rn " << rowNumber << " " << typeid(*this).name() << std::endl; - Ref result = decodeRow(rowNumber, row); + Ref result = decodeRow(rowNumber, row, hints); // We found our barcode if (attempt == 1) { // But it was upside down, so note that @@ -146,8 +141,6 @@ Ref OneDReader::doDecode(Ref image, DecodeHints hints) { (void)re; continue; } - - activeHints = DecodeHints(); } } throw NotFoundException(); diff --git a/src/zxing/zxing/oned/OneDReader.h b/src/zxing/zxing/oned/OneDReader.h index 5994dae..63cc4a9 100644 --- a/src/zxing/zxing/oned/OneDReader.h +++ b/src/zxing/zxing/oned/OneDReader.h @@ -33,7 +33,6 @@ private: protected: static const int INTEGER_MATH_SHIFT = 8; - DecodeHints activeHints; struct Range { private: @@ -64,12 +63,11 @@ protected: public: - OneDReader(); virtual Ref decode(Ref image, DecodeHints hints); // Implementations must not throw any exceptions. If a barcode is not found on this row, // a empty ref should be returned e.g. return Ref(); - virtual Ref decodeRow(int rowNumber, Ref row) = 0; + virtual Ref decodeRow(int rowNumber, Ref row, DecodeHints hints) = 0; static void recordPattern(Ref row, int start, diff --git a/src/zxing/zxing/oned/UPCAReader.cpp b/src/zxing/zxing/oned/UPCAReader.cpp index 38ca507..5bd36ab 100644 --- a/src/zxing/zxing/oned/UPCAReader.cpp +++ b/src/zxing/zxing/oned/UPCAReader.cpp @@ -32,8 +32,8 @@ using zxing::DecodeHints; UPCAReader::UPCAReader() : ean13Reader() {} -Ref UPCAReader::decodeRow(int rowNumber, Ref row) { - return maybeReturnResult(ean13Reader.decodeRow(rowNumber, row)); +Ref UPCAReader::decodeRow(int rowNumber, Ref row, zxing::DecodeHints hints) { + return maybeReturnResult(ean13Reader.decodeRow(rowNumber, row, hints)); } Ref UPCAReader::decodeRow(int rowNumber, diff --git a/src/zxing/zxing/oned/UPCAReader.h b/src/zxing/zxing/oned/UPCAReader.h index 00c02bf..7d80b2d 100644 --- a/src/zxing/zxing/oned/UPCAReader.h +++ b/src/zxing/zxing/oned/UPCAReader.h @@ -37,7 +37,7 @@ public: int decodeMiddle(Ref row, Range const& startRange, std::string& resultString); - Ref decodeRow(int rowNumber, Ref row); + Ref decodeRow(int rowNumber, Ref row, DecodeHints hints); Ref decodeRow(int rowNumber, Ref row, Range const& startGuardRange); Ref decode(Ref image, DecodeHints hints); diff --git a/src/zxing/zxing/oned/UPCEANReader.cpp b/src/zxing/zxing/oned/UPCEANReader.cpp index a1f0074..4812ca1 100644 --- a/src/zxing/zxing/oned/UPCEANReader.cpp +++ b/src/zxing/zxing/oned/UPCEANReader.cpp @@ -118,7 +118,7 @@ UPCEANReader::L_AND_G_PATTERNS (VECTOR_INIT(L_AND_G_PATTERNS_)); UPCEANReader::UPCEANReader() {} -Ref UPCEANReader::decodeRow(int rowNumber, Ref row) { +Ref UPCEANReader::decodeRow(int rowNumber, Ref row, zxing::DecodeHints /*hints*/) { return decodeRow(rowNumber, row, findStartGuardPattern(row)); } diff --git a/src/zxing/zxing/oned/UPCEANReader.h b/src/zxing/zxing/oned/UPCEANReader.h index 6603739..16189ba 100644 --- a/src/zxing/zxing/oned/UPCEANReader.h +++ b/src/zxing/zxing/oned/UPCEANReader.h @@ -66,7 +66,7 @@ public: Range const& startRange, std::string& resultString) = 0; - virtual Ref decodeRow(int rowNumber, Ref row); + virtual Ref decodeRow(int rowNumber, Ref row, DecodeHints hints); virtual Ref decodeRow(int rowNumber, Ref row, Range const& range); static int decodeDigit(Ref row, diff --git a/tests/resources/code128-gs-1/26881461-c0189156-4b97-11e7-8300-caf88e2837e2.png b/tests/resources/code128gs1-1/26881461-c0189156-4b97-11e7-8300-caf88e2837e2.png similarity index 100% rename from tests/resources/code128-gs-1/26881461-c0189156-4b97-11e7-8300-caf88e2837e2.png rename to tests/resources/code128gs1-1/26881461-c0189156-4b97-11e7-8300-caf88e2837e2.png diff --git a/tests/resources/code128-gs-1/big.png b/tests/resources/code128gs1-1/big.png similarity index 100% rename from tests/resources/code128-gs-1/big.png rename to tests/resources/code128gs1-1/big.png diff --git a/tests/resources/code128-gs-1/small.png b/tests/resources/code128gs1-1/small.png similarity index 100% rename from tests/resources/code128-gs-1/small.png rename to tests/resources/code128gs1-1/small.png diff --git a/tests/src/QZXingTests/DecodeValidator.cpp b/tests/src/QZXingTests/DecodeValidator.cpp index 8941533..577d682 100644 --- a/tests/src/QZXingTests/DecodeValidator.cpp +++ b/tests/src/QZXingTests/DecodeValidator.cpp @@ -23,6 +23,7 @@ void DecodeValidator::initializeDecoderCorrelation() decoderCorrelationMap["code39"] = QZXing::DecoderFormat_CODE_39; decoderCorrelationMap["code93"] = QZXing::DecoderFormat_CODE_93; decoderCorrelationMap["code128"] = QZXing::DecoderFormat_CODE_128; + decoderCorrelationMap["code128gs1"] = QZXing::DecoderFormat_CODE_128_GS1; decoderCorrelationMap["datamatrix"] = QZXing::DecoderFormat_DATA_MATRIX; decoderCorrelationMap["ean8"] = QZXing::DecoderFormat_EAN_8; decoderCorrelationMap["ean13"] = QZXing::DecoderFormat_EAN_13;