X-Git-Url: http://git.rot13.org/?p=zxing.git;a=blobdiff_plain;f=cpp%2Fcore%2Fsrc%2Fzxing%2Foned%2FOneDReader.h;h=fdd1d023aba8028bfeccb8523e4debc0cb6f485a;hp=bb3b6497995ba41e05357e4e3ef724a692fac6da;hb=588c8db7d6f8794125b9cfa7bd0a3b8884a413b6;hpb=4430403d20762773119a1db47c0a4c2776d778f1 diff --git a/cpp/core/src/zxing/oned/OneDReader.h b/cpp/core/src/zxing/oned/OneDReader.h index bb3b6497..fdd1d023 100644 --- a/cpp/core/src/zxing/oned/OneDReader.h +++ b/cpp/core/src/zxing/oned/OneDReader.h @@ -1,8 +1,10 @@ +#ifndef __ONED_READER_H__ +#define __ONED_READER_H__ + /* * OneDReader.h * ZXing * - * Created by Lukasz Warchol on 10-01-15. * Copyright 2010 ZXing authors All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -18,29 +20,31 @@ * limitations under the License. */ -#pragma once - #include -#include -#include namespace zxing { namespace oned { class OneDReader : public Reader { private: static const int INTEGER_MATH_SHIFT = 8; - - Ref doDecode(Ref image); + + Ref doDecode(Ref image, DecodeHints hints); public: static const int PATTERN_MATCH_RESULT_SCALE_FACTOR = 1 << INTEGER_MATH_SHIFT; - + OneDReader(); - virtual Ref decode(Ref image); + 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; - - static unsigned int patternMatchVariance(int counters[], int countersSize, const int pattern[], int maxIndividualVariance); - static void recordPattern(Ref row, int start, int counters[], int countersCount); + + static unsigned int patternMatchVariance(int counters[], int countersSize, + const int pattern[], int maxIndividualVariance); + static bool recordPattern(Ref row, int start, int counters[], int countersCount); virtual ~OneDReader(); }; } } + +#endif