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 18 matching lines...) Expand all Loading... |
29 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', | 29 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', |
30 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'}; | 30 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'}; |
31 const FX_CHAR CBC_DataMatrixDecodedBitStreamParser::C40_SHIFT2_SET_CHARS[] = { | 31 const FX_CHAR CBC_DataMatrixDecodedBitStreamParser::C40_SHIFT2_SET_CHARS[] = { |
32 '!', '"', '#', '$', '%', '&', '\'', '(', ')', '*', '+', ',', '-', '.', | 32 '!', '"', '#', '$', '%', '&', '\'', '(', ')', '*', '+', ',', '-', '.', |
33 '/', ':', ';', '<', '=', '>', '?', '@', '[', '\\', ']', '^', '_'}; | 33 '/', ':', ';', '<', '=', '>', '?', '@', '[', '\\', ']', '^', '_'}; |
34 const FX_CHAR CBC_DataMatrixDecodedBitStreamParser::TEXT_BASIC_SET_CHARS[] = { | 34 const FX_CHAR CBC_DataMatrixDecodedBitStreamParser::TEXT_BASIC_SET_CHARS[] = { |
35 '*', '*', '*', ' ', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', | 35 '*', '*', '*', ' ', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', |
36 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', | 36 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', |
37 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'}; | 37 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'}; |
38 const FX_CHAR CBC_DataMatrixDecodedBitStreamParser::TEXT_SHIFT3_SET_CHARS[] = { | 38 const FX_CHAR CBC_DataMatrixDecodedBitStreamParser::TEXT_SHIFT3_SET_CHARS[] = { |
39 '\'', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', | 39 '\'', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', |
40 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', | 40 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', |
41 'V', 'W', 'X', 'Y', 'Z', '{', '|', '}', '~', (FX_CHAR)127}; | 41 'V', 'W', 'X', 'Y', 'Z', '{', '|', '}', '~', 127}; |
42 const int32_t CBC_DataMatrixDecodedBitStreamParser::PAD_ENCODE = 0; | 42 const int32_t CBC_DataMatrixDecodedBitStreamParser::PAD_ENCODE = 0; |
43 const int32_t CBC_DataMatrixDecodedBitStreamParser::ASCII_ENCODE = 1; | 43 const int32_t CBC_DataMatrixDecodedBitStreamParser::ASCII_ENCODE = 1; |
44 const int32_t CBC_DataMatrixDecodedBitStreamParser::C40_ENCODE = 2; | 44 const int32_t CBC_DataMatrixDecodedBitStreamParser::C40_ENCODE = 2; |
45 const int32_t CBC_DataMatrixDecodedBitStreamParser::TEXT_ENCODE = 3; | 45 const int32_t CBC_DataMatrixDecodedBitStreamParser::TEXT_ENCODE = 3; |
46 const int32_t CBC_DataMatrixDecodedBitStreamParser::ANSIX12_ENCODE = 4; | 46 const int32_t CBC_DataMatrixDecodedBitStreamParser::ANSIX12_ENCODE = 4; |
47 const int32_t CBC_DataMatrixDecodedBitStreamParser::EDIFACT_ENCODE = 5; | 47 const int32_t CBC_DataMatrixDecodedBitStreamParser::EDIFACT_ENCODE = 5; |
48 const int32_t CBC_DataMatrixDecodedBitStreamParser::BASE256_ENCODE = 6; | 48 const int32_t CBC_DataMatrixDecodedBitStreamParser::BASE256_ENCODE = 6; |
49 CBC_DataMatrixDecodedBitStreamParser::CBC_DataMatrixDecodedBitStreamParser() {} | 49 CBC_DataMatrixDecodedBitStreamParser::CBC_DataMatrixDecodedBitStreamParser() {} |
50 CBC_DataMatrixDecodedBitStreamParser::~CBC_DataMatrixDecodedBitStreamParser() {} | 50 CBC_DataMatrixDecodedBitStreamParser::~CBC_DataMatrixDecodedBitStreamParser() {} |
51 | 51 |
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
464 BC_FX_ByteString_Append(result, *bytes); | 464 BC_FX_ByteString_Append(result, *bytes); |
465 delete bytes; | 465 delete bytes; |
466 } | 466 } |
467 uint8_t CBC_DataMatrixDecodedBitStreamParser::Unrandomize255State( | 467 uint8_t CBC_DataMatrixDecodedBitStreamParser::Unrandomize255State( |
468 int32_t randomizedBase256Codeword, | 468 int32_t randomizedBase256Codeword, |
469 int32_t base256CodewordPosition) { | 469 int32_t base256CodewordPosition) { |
470 int32_t pseudoRandomNumber = ((149 * base256CodewordPosition) % 255) + 1; | 470 int32_t pseudoRandomNumber = ((149 * base256CodewordPosition) % 255) + 1; |
471 int32_t tempVariable = randomizedBase256Codeword - pseudoRandomNumber; | 471 int32_t tempVariable = randomizedBase256Codeword - pseudoRandomNumber; |
472 return (uint8_t)(tempVariable >= 0 ? tempVariable : tempVariable + 256); | 472 return (uint8_t)(tempVariable >= 0 ? tempVariable : tempVariable + 256); |
473 } | 473 } |
OLD | NEW |