GreyscaleRotatedLuminanceSource: implemented getMatrix()
[zxing.git] / cpp / core / src / zxing / oned / Code128Reader.h
1 #ifndef __CODE_128_READER_H__
2 #define __CODE_128_READER_H__
3 /*
4  *  Code128Reader.h
5  *  ZXing
6  *
7  *  Copyright 2010 ZXing authors All rights reserved.
8  *
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  *      http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  */
21
22 #include <zxing/oned/OneDReader.h>
23 #include <zxing/common/BitArray.h>
24 #include <zxing/Result.h>
25
26 namespace zxing {
27         namespace oned {
28                 class Code128Reader : public OneDReader {
29                         
30                 private:
31                         static const unsigned int MAX_AVG_VARIANCE = (unsigned int) (PATTERN_MATCH_RESULT_SCALE_FACTOR * 0.25f);
32                         static const int MAX_INDIVIDUAL_VARIANCE = (int) (PATTERN_MATCH_RESULT_SCALE_FACTOR * 0.7f);
33                         
34                         static const int CODE_SHIFT = 98;
35                         
36                         static const int CODE_CODE_C = 99;
37                         static const int CODE_CODE_B = 100;
38                         static const int CODE_CODE_A = 101;
39                         
40                         static const int CODE_FNC_1 = 102;
41                         static const int CODE_FNC_2 = 97;
42                         static const int CODE_FNC_3 = 96;
43                         static const int CODE_FNC_4_A = 101;
44                         static const int CODE_FNC_4_B = 100;
45                         
46                         static const int CODE_START_A = 103;
47                         static const int CODE_START_B = 104;
48                         static const int CODE_START_C = 105;
49                         static const int CODE_STOP = 106;
50                         
51                         static int* findStartPattern(Ref<BitArray> row);
52                         static int decodeCode(Ref<BitArray> row, int counters[], int countersCount, int rowOffset);
53                         
54                         void append(char* s, char c);
55                 public:
56                         Ref<Result> decodeRow(int rowNumber, Ref<BitArray> row);
57                         Code128Reader();
58                         ~Code128Reader();
59                 };
60         }
61 }
62
63 #endif