OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 // Original code is licensed as follows: | 6 // Original code is licensed as follows: |
7 /* | 7 /* |
8 * Copyright 2008 ZXing authors | 8 * Copyright 2008 ZXing authors |
9 * | 9 * |
10 * Licensed under the Apache License, Version 2.0 (the "License"); | 10 * Licensed under the Apache License, Version 2.0 (the "License"); |
(...skipping 20 matching lines...) Expand all Loading... |
31 #include "xfa/src/fxbarcode/oned/BC_OneDReader.h" | 31 #include "xfa/src/fxbarcode/oned/BC_OneDReader.h" |
32 #include "xfa/src/fxbarcode/oned/BC_OnedCode39Reader.h" | 32 #include "xfa/src/fxbarcode/oned/BC_OnedCode39Reader.h" |
33 #include "xfa/src/fxbarcode/utils.h" | 33 #include "xfa/src/fxbarcode/utils.h" |
34 | 34 |
35 const FX_CHAR* CBC_OnedCodaBarReader::ALPHABET_STRING = | 35 const FX_CHAR* CBC_OnedCodaBarReader::ALPHABET_STRING = |
36 "0123456789-$:/.+ABCDTN"; | 36 "0123456789-$:/.+ABCDTN"; |
37 const int32_t CBC_OnedCodaBarReader::CHARACTER_ENCODINGS[22] = { | 37 const int32_t CBC_OnedCodaBarReader::CHARACTER_ENCODINGS[22] = { |
38 0x003, 0x006, 0x009, 0x060, 0x012, 0x042, 0x021, 0x024, | 38 0x003, 0x006, 0x009, 0x060, 0x012, 0x042, 0x021, 0x024, |
39 0x030, 0x048, 0x00c, 0x018, 0x045, 0x051, 0x054, 0x015, | 39 0x030, 0x048, 0x00c, 0x018, 0x045, 0x051, 0x054, 0x015, |
40 0x01A, 0x029, 0x00B, 0x00E, 0x01A, 0x029}; | 40 0x01A, 0x029, 0x00B, 0x00E, 0x01A, 0x029}; |
41 const int32_t CBC_OnedCodaBarReader::minCharacterLength = 3; | |
42 const FX_CHAR CBC_OnedCodaBarReader::STARTEND_ENCODING[8] = { | 41 const FX_CHAR CBC_OnedCodaBarReader::STARTEND_ENCODING[8] = { |
43 'E', '*', 'A', 'B', 'C', 'D', 'T', 'N'}; | 42 'E', '*', 'A', 'B', 'C', 'D', 'T', 'N'}; |
44 | 43 |
45 CBC_OnedCodaBarReader::CBC_OnedCodaBarReader() {} | 44 CBC_OnedCodaBarReader::CBC_OnedCodaBarReader() {} |
46 CBC_OnedCodaBarReader::~CBC_OnedCodaBarReader() {} | 45 CBC_OnedCodaBarReader::~CBC_OnedCodaBarReader() {} |
47 CFX_ByteString CBC_OnedCodaBarReader::DecodeRow(int32_t rowNumber, | 46 CFX_ByteString CBC_OnedCodaBarReader::DecodeRow(int32_t rowNumber, |
48 CBC_CommonBitArray* row, | 47 CBC_CommonBitArray* row, |
49 int32_t hints, | 48 int32_t hints, |
50 int32_t& e) { | 49 int32_t& e) { |
51 std::unique_ptr<CFX_Int32Array> start(FindAsteriskPattern(row, e)); | 50 std::unique_ptr<CFX_Int32Array> start(FindAsteriskPattern(row, e)); |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 } | 203 } |
205 if ((wideCounters == 2) || (wideCounters == 3)) { | 204 if ((wideCounters == 2) || (wideCounters == 3)) { |
206 for (int32_t k = 0; k < 22; k++) { | 205 for (int32_t k = 0; k < 22; k++) { |
207 if (CHARACTER_ENCODINGS[k] == pattern) { | 206 if (CHARACTER_ENCODINGS[k] == pattern) { |
208 return (ALPHABET_STRING)[k]; | 207 return (ALPHABET_STRING)[k]; |
209 } | 208 } |
210 } | 209 } |
211 } | 210 } |
212 return '!'; | 211 return '!'; |
213 } | 212 } |
OLD | NEW |