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 2009 ZXing authors | 8 * Copyright 2009 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"); |
11 * you may not use this file except in compliance with 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 | 12 * You may obtain a copy of the License at |
13 * | 13 * |
14 * http://www.apache.org/licenses/LICENSE-2.0 | 14 * http://www.apache.org/licenses/LICENSE-2.0 |
15 * | 15 * |
16 * Unless required by applicable law or agreed to in writing, software | 16 * Unless required by applicable law or agreed to in writing, software |
17 * distributed under the License is distributed on an "AS IS" BASIS, | 17 * distributed under the License is distributed on an "AS IS" BASIS, |
18 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 18 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
19 * See the License for the specific language governing permissions and | 19 * See the License for the specific language governing permissions and |
20 * limitations under the License. | 20 * limitations under the License. |
21 */ | 21 */ |
22 | 22 |
23 #include "xfa/fxbarcode/pdf417/BC_PDF417Common.h" | 23 #include "xfa/fxbarcode/pdf417/BC_PDF417Common.h" |
24 | 24 |
25 int32_t CBC_PDF417Common::NUMBER_OF_CODEWORDS = 929; | 25 CFX_Int32Array* CBC_PDF417Common::EMPTY_INT_ARRAY = nullptr; |
26 int32_t CBC_PDF417Common::MAX_CODEWORDS_IN_BARCODE = NUMBER_OF_CODEWORDS - 1; | 26 |
27 int32_t CBC_PDF417Common::MIN_ROWS_IN_BARCODE = 3; | 27 const int32_t CBC_PDF417Common::SYMBOL_TABLE[] = { |
28 int32_t CBC_PDF417Common::MAX_ROWS_IN_BARCODE = 90; | |
29 int32_t CBC_PDF417Common::MAX_CODEWORDS_IN_ROW = 32; | |
30 int32_t CBC_PDF417Common::MODULES_IN_CODEWORD = 17; | |
31 int32_t CBC_PDF417Common::MODULES_IN_STOP_PATTERN = 18; | |
32 int32_t CBC_PDF417Common::BARS_IN_MODULE = 8; | |
33 CFX_Int32Array* CBC_PDF417Common::EMPTY_INT_ARRAY = NULL; | |
34 int32_t CBC_PDF417Common::SYMBOL_TABLE[] = { | |
35 0x1025e, 0x1027a, 0x1029e, 0x102bc, 0x102f2, 0x102f4, 0x1032e, 0x1034e, | 28 0x1025e, 0x1027a, 0x1029e, 0x102bc, 0x102f2, 0x102f4, 0x1032e, 0x1034e, |
36 0x1035c, 0x10396, 0x103a6, 0x103ac, 0x10422, 0x10428, 0x10436, 0x10442, | 29 0x1035c, 0x10396, 0x103a6, 0x103ac, 0x10422, 0x10428, 0x10436, 0x10442, |
37 0x10444, 0x10448, 0x10450, 0x1045e, 0x10466, 0x1046c, 0x1047a, 0x10482, | 30 0x10444, 0x10448, 0x10450, 0x1045e, 0x10466, 0x1046c, 0x1047a, 0x10482, |
38 0x1049e, 0x104a0, 0x104bc, 0x104c6, 0x104d8, 0x104ee, 0x104f2, 0x104f4, | 31 0x1049e, 0x104a0, 0x104bc, 0x104c6, 0x104d8, 0x104ee, 0x104f2, 0x104f4, |
39 0x10504, 0x10508, 0x10510, 0x1051e, 0x10520, 0x1053c, 0x10540, 0x10578, | 32 0x10504, 0x10508, 0x10510, 0x1051e, 0x10520, 0x1053c, 0x10540, 0x10578, |
40 0x10586, 0x1058c, 0x10598, 0x105b0, 0x105be, 0x105ce, 0x105dc, 0x105e2, | 33 0x10586, 0x1058c, 0x10598, 0x105b0, 0x105be, 0x105ce, 0x105dc, 0x105e2, |
41 0x105e4, 0x105e8, 0x105f6, 0x1062e, 0x1064e, 0x1065c, 0x1068e, 0x1069c, | 34 0x105e4, 0x105e8, 0x105f6, 0x1062e, 0x1064e, 0x1065c, 0x1068e, 0x1069c, |
42 0x106b8, 0x106de, 0x106fa, 0x10716, 0x10726, 0x1072c, 0x10746, 0x1074c, | 35 0x106b8, 0x106de, 0x106fa, 0x10716, 0x10726, 0x1072c, 0x10746, 0x1074c, |
43 0x10758, 0x1076e, 0x10792, 0x10794, 0x107a2, 0x107a4, 0x107a8, 0x107b6, | 36 0x10758, 0x1076e, 0x10792, 0x10794, 0x107a2, 0x107a4, 0x107a8, 0x107b6, |
44 0x10822, 0x10828, 0x10842, 0x10848, 0x10850, 0x1085e, 0x10866, 0x1086c, | 37 0x10822, 0x10828, 0x10842, 0x10848, 0x10850, 0x1085e, 0x10866, 0x1086c, |
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
374 0x1f732, 0x1f734, 0x1f74e, 0x1f75c, 0x1f762, 0x1f764, 0x1f768, 0x1f776, | 367 0x1f732, 0x1f734, 0x1f74e, 0x1f75c, 0x1f762, 0x1f764, 0x1f768, 0x1f776, |
375 0x1f796, 0x1f7a6, 0x1f7ac, 0x1f7ba, 0x1f7d2, 0x1f7d4, 0x1f89a, 0x1f8ae, | 368 0x1f796, 0x1f7a6, 0x1f7ac, 0x1f7ba, 0x1f7d2, 0x1f7d4, 0x1f89a, 0x1f8ae, |
376 0x1f8b2, 0x1f8b4, 0x1f8d6, 0x1f8ea, 0x1f91a, 0x1f92e, 0x1f932, 0x1f934, | 369 0x1f8b2, 0x1f8b4, 0x1f8d6, 0x1f8ea, 0x1f91a, 0x1f92e, 0x1f932, 0x1f934, |
377 0x1f94e, 0x1f95c, 0x1f962, 0x1f964, 0x1f968, 0x1f976, 0x1f996, 0x1f9a6, | 370 0x1f94e, 0x1f95c, 0x1f962, 0x1f964, 0x1f968, 0x1f976, 0x1f996, 0x1f9a6, |
378 0x1f9ac, 0x1f9ba, 0x1f9ca, 0x1f9d2, 0x1f9d4, 0x1fa1a, 0x1fa2e, 0x1fa32, | 371 0x1f9ac, 0x1f9ba, 0x1f9ca, 0x1f9d2, 0x1f9d4, 0x1fa1a, 0x1fa2e, 0x1fa32, |
379 0x1fa34, 0x1fa4e, 0x1fa5c, 0x1fa62, 0x1fa64, 0x1fa68, 0x1fa76, 0x1fa8e, | 372 0x1fa34, 0x1fa4e, 0x1fa5c, 0x1fa62, 0x1fa64, 0x1fa68, 0x1fa76, 0x1fa8e, |
380 0x1fa9c, 0x1fab8, 0x1fac2, 0x1fac4, 0x1fac8, 0x1fad0, 0x1fade, 0x1fae6, | 373 0x1fa9c, 0x1fab8, 0x1fac2, 0x1fac4, 0x1fac8, 0x1fad0, 0x1fade, 0x1fae6, |
381 0x1faec, 0x1fb16, 0x1fb26, 0x1fb2c, 0x1fb3a, 0x1fb46, 0x1fb4c, 0x1fb58, | 374 0x1faec, 0x1fb16, 0x1fb26, 0x1fb2c, 0x1fb3a, 0x1fb46, 0x1fb4c, 0x1fb58, |
382 0x1fb6e, 0x1fb72, 0x1fb74, 0x1fb8a, 0x1fb92, 0x1fb94, 0x1fba2, 0x1fba4, | 375 0x1fb6e, 0x1fb72, 0x1fb74, 0x1fb8a, 0x1fb92, 0x1fb94, 0x1fba2, 0x1fba4, |
383 0x1fba8, 0x1fbb6, 0x1fbda}; | 376 0x1fba8, 0x1fbb6, 0x1fbda}; |
384 int32_t CBC_PDF417Common::CODEWORD_TABLE[] = { | 377 |
| 378 const uint16_t CBC_PDF417Common::CODEWORD_TABLE[] = { |
385 2627, 1819, 2622, 2621, 1813, 1812, 2729, 2724, 2723, 2779, 2774, 2773, | 379 2627, 1819, 2622, 2621, 1813, 1812, 2729, 2724, 2723, 2779, 2774, 2773, |
386 902, 896, 908, 868, 865, 861, 859, 2511, 873, 871, 1780, 835, | 380 902, 896, 908, 868, 865, 861, 859, 2511, 873, 871, 1780, 835, |
387 2493, 825, 2491, 842, 837, 844, 1764, 1762, 811, 810, 809, 2483, | 381 2493, 825, 2491, 842, 837, 844, 1764, 1762, 811, 810, 809, 2483, |
388 807, 2482, 806, 2480, 815, 814, 813, 812, 2484, 817, 816, 1745, | 382 807, 2482, 806, 2480, 815, 814, 813, 812, 2484, 817, 816, 1745, |
389 1744, 1742, 1746, 2655, 2637, 2635, 2626, 2625, 2623, 2628, 1820, 2752, | 383 1744, 1742, 1746, 2655, 2637, 2635, 2626, 2625, 2623, 2628, 1820, 2752, |
390 2739, 2737, 2728, 2727, 2725, 2730, 2785, 2783, 2778, 2777, 2775, 2780, | 384 2739, 2737, 2728, 2727, 2725, 2730, 2785, 2783, 2778, 2777, 2775, 2780, |
391 787, 781, 747, 739, 736, 2413, 754, 752, 1719, 692, 689, 681, | 385 787, 781, 747, 739, 736, 2413, 754, 752, 1719, 692, 689, 681, |
392 2371, 678, 2369, 700, 697, 694, 703, 1688, 1686, 642, 638, 2343, | 386 2371, 678, 2369, 700, 697, 694, 703, 1688, 1686, 642, 638, 2343, |
393 631, 2341, 627, 2338, 651, 646, 643, 2345, 654, 652, 1652, 1650, | 387 631, 2341, 627, 2338, 651, 646, 643, 2345, 654, 652, 1652, 1650, |
394 1647, 1654, 601, 599, 2322, 596, 2321, 594, 2319, 2317, 611, 610, | 388 1647, 1654, 601, 599, 2322, 596, 2321, 594, 2319, 2317, 611, 610, |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
642 if (symbol < (FX_DWORD)SYMBOL_TABLE[mid]) { | 636 if (symbol < (FX_DWORD)SYMBOL_TABLE[mid]) { |
643 upto = mid; | 637 upto = mid; |
644 } else if (symbol > (FX_DWORD)SYMBOL_TABLE[mid]) { | 638 } else if (symbol > (FX_DWORD)SYMBOL_TABLE[mid]) { |
645 first = mid + 1; | 639 first = mid + 1; |
646 } else { | 640 } else { |
647 return mid; | 641 return mid; |
648 } | 642 } |
649 } | 643 } |
650 return -1; | 644 return -1; |
651 } | 645 } |
OLD | NEW |