C++ port: Make sure #indef/#define/#endif's and copyright information on all header...
[zxing.git] / cpp / core / src / zxing / oned / OneDReader.h
1 #ifndef __ONED_READER_H__
2 #define __ONED_READER_H__
3
4 /*
5  *  OneDReader.h
6  *  ZXing
7  *
8  *  Copyright 2010 ZXing authors All rights reserved.
9  *
10  * Licensed under the Apache License, Version 2.0 (the "License");
11  * you may not use this file except in compliance with the License.
12  * You may obtain a copy of the License at
13  *
14  *      http://www.apache.org/licenses/LICENSE-2.0
15  *
16  * Unless required by applicable law or agreed to in writing, software
17  * distributed under the License is distributed on an "AS IS" BASIS,
18  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19  * See the License for the specific language governing permissions and
20  * limitations under the License.
21  */
22
23 #include <zxing/Reader.h>
24
25 namespace zxing {
26         namespace oned {
27                 class OneDReader : public Reader {
28                 private:
29                         static const int INTEGER_MATH_SHIFT = 8;
30                         
31                         Ref<Result> doDecode(Ref<BinaryBitmap> image, DecodeHints hints);
32                 public:
33                         static const int PATTERN_MATCH_RESULT_SCALE_FACTOR = 1 << INTEGER_MATH_SHIFT;
34                         
35                         OneDReader();
36                         virtual Ref<Result> decode(Ref<BinaryBitmap> image, DecodeHints hints);
37                         virtual Ref<Result> decodeRow(int rowNumber, Ref<BitArray> row) = 0;
38                         
39                         static unsigned int patternMatchVariance(int counters[], int countersSize, const int pattern[], int maxIndividualVariance);
40                         static void recordPattern(Ref<BitArray> row, int start, int counters[], int countersCount);
41                         virtual ~OneDReader();
42                 };
43         }
44 }
45
46 #endif