| 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 | 6 |
| 7 #ifndef _BC_DECODEDBITSTREAMPARSER_H_ | 7 #ifndef _BC_DECODEDBITSTREAMPARSER_H_ |
| 8 #define _BC_DECODEDBITSTREAMPARSER_H_ | 8 #define _BC_DECODEDBITSTREAMPARSER_H_ |
| 9 class CBC_CommonDecoderResult; | 9 class CBC_CommonDecoderResult; |
| 10 class CBC_PDF417ResultMetadata; | 10 class CBC_PDF417ResultMetadata; |
| 11 class CBC_DecodedBitStreamPaser | 11 class CBC_DecodedBitStreamPaser |
| 12 { | 12 { |
| 13 public: | 13 public: |
| 14 CBC_DecodedBitStreamPaser(); | 14 CBC_DecodedBitStreamPaser(); |
| 15 virtual ~CBC_DecodedBitStreamPaser(); | 15 virtual ~CBC_DecodedBitStreamPaser(); |
| 16 static void Initialize(); | 16 static void Initialize(); |
| 17 static void Finalize(); | 17 static void Finalize(); |
| 18 static CBC_CommonDecoderResult* decode(CFX_Int32Array &codewords, CFX_ByteSt
ring ecLevel, FX_INT32 &e); | 18 static CBC_CommonDecoderResult* decode(CFX_Int32Array &codewords, CFX_ByteSt
ring ecLevel, int32_t &e); |
| 19 | 19 |
| 20 private: | 20 private: |
| 21 enum Mode { | 21 enum Mode { |
| 22 ALPHA, | 22 ALPHA, |
| 23 LOWER, | 23 LOWER, |
| 24 MIXED, | 24 MIXED, |
| 25 PUNCT, | 25 PUNCT, |
| 26 ALPHA_SHIFT, | 26 ALPHA_SHIFT, |
| 27 PUNCT_SHIFT | 27 PUNCT_SHIFT |
| 28 }; | 28 }; |
| 29 static FX_INT32 MAX_NUMERIC_CODEWORDS; | 29 static int32_t MAX_NUMERIC_CODEWORDS; |
| 30 static FX_INT32 PL; | 30 static int32_t PL; |
| 31 static FX_INT32 LL; | 31 static int32_t LL; |
| 32 static FX_INT32 AS; | 32 static int32_t AS; |
| 33 static FX_INT32 ML; | 33 static int32_t ML; |
| 34 static FX_INT32 AL; | 34 static int32_t AL; |
| 35 static FX_INT32 PS; | 35 static int32_t PS; |
| 36 static FX_INT32 PAL; | 36 static int32_t PAL; |
| 37 static FX_CHAR PUNCT_CHARS[29]; | 37 static FX_CHAR PUNCT_CHARS[29]; |
| 38 static FX_CHAR MIXED_CHARS[30]; | 38 static FX_CHAR MIXED_CHARS[30]; |
| 39 static FX_INT32 NUMBER_OF_SEQUENCE_CODEWORDS; | 39 static int32_t NUMBER_OF_SEQUENCE_CODEWORDS; |
| 40 static FX_INT32 decodeMacroBlock(CFX_Int32Array &codewords, FX_INT32 codeInd
ex, CBC_PDF417ResultMetadata* resultMetadata, FX_INT32 &e); | 40 static int32_t decodeMacroBlock(CFX_Int32Array &codewords, int32_t codeIndex
, CBC_PDF417ResultMetadata* resultMetadata, int32_t &e); |
| 41 static FX_INT32 textCompaction(CFX_Int32Array &codewords, FX_INT32 codeIndex
, CFX_ByteString &result); | 41 static int32_t textCompaction(CFX_Int32Array &codewords, int32_t codeIndex,
CFX_ByteString &result); |
| 42 static void decodeTextCompaction(CFX_Int32Array &textCompactionData, CFX_Int
32Array &byteCompactionData, FX_INT32 length, CFX_ByteString &result); | 42 static void decodeTextCompaction(CFX_Int32Array &textCompactionData, CFX_Int
32Array &byteCompactionData, int32_t length, CFX_ByteString &result); |
| 43 static FX_INT32 byteCompaction(FX_INT32 mode, CFX_Int32Array &codewords, FX_
INT32 codeIndex, CFX_ByteString &result); | 43 static int32_t byteCompaction(int32_t mode, CFX_Int32Array &codewords, int32
_t codeIndex, CFX_ByteString &result); |
| 44 static FX_INT32 numericCompaction(CFX_Int32Array &codewords, FX_INT32 codeIn
dex, CFX_ByteString &result, FX_INT32 &e); | 44 static int32_t numericCompaction(CFX_Int32Array &codewords, int32_t codeInde
x, CFX_ByteString &result, int32_t &e); |
| 45 static CFX_ByteString decodeBase900toBase10(CFX_Int32Array &codewords, FX_IN
T32 count, FX_INT32 &e); | 45 static CFX_ByteString decodeBase900toBase10(CFX_Int32Array &codewords, int32
_t count, int32_t &e); |
| 46 }; | 46 }; |
| 47 #endif | 47 #endif |
| OLD | NEW |