Merge XFA to PDFium master at 4dc95e7 on 10/28/2014
[pdfium.git] / xfa / src / fxbarcode / src / include / BC_PDF417DecodedBitStreamParser.h
1 // Copyright 2014 PDFium Authors. All rights reserved.\r
2 // Use of this source code is governed by a BSD-style license that can be\r
3 // found in the LICENSE file.\r
4 \r
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com\r
6 \r
7 #ifndef _BC_DECODEDBITSTREAMPARSER_H_\r
8 #define _BC_DECODEDBITSTREAMPARSER_H_\r
9 class CBC_CommonDecoderResult;\r
10 class CBC_PDF417ResultMetadata;\r
11 class CBC_DecodedBitStreamPaser;\r
12 class CBC_DecodedBitStreamPaser : public CFX_Object\r
13 {\r
14 public:\r
15     CBC_DecodedBitStreamPaser();\r
16     virtual ~CBC_DecodedBitStreamPaser();\r
17     static void Initialize();\r
18     static void Finalize();\r
19     static CBC_CommonDecoderResult* decode(CFX_Int32Array &codewords, CFX_ByteString ecLevel, FX_INT32 &e);\r
20 \r
21 private:\r
22     enum Mode {\r
23         ALPHA,\r
24         LOWER,\r
25         MIXED,\r
26         PUNCT,\r
27         ALPHA_SHIFT,\r
28         PUNCT_SHIFT\r
29     };\r
30     static FX_INT32 MAX_NUMERIC_CODEWORDS;\r
31     static FX_INT32 PL;\r
32     static FX_INT32 LL;\r
33     static FX_INT32 AS;\r
34     static FX_INT32 ML;\r
35     static FX_INT32 AL;\r
36     static FX_INT32 PS;\r
37     static FX_INT32 PAL;\r
38     static FX_CHAR PUNCT_CHARS[29];\r
39     static FX_CHAR MIXED_CHARS[30];\r
40     static FX_INT32 EXP900[16];\r
41     static FX_INT32 NUMBER_OF_SEQUENCE_CODEWORDS;\r
42     static FX_INT32 decodeMacroBlock(CFX_Int32Array &codewords, FX_INT32 codeIndex, CBC_PDF417ResultMetadata* resultMetadata, FX_INT32 &e);\r
43     static FX_INT32 textCompaction(CFX_Int32Array &codewords, FX_INT32 codeIndex, CFX_ByteString &result);\r
44     static void decodeTextCompaction(CFX_Int32Array &textCompactionData, CFX_Int32Array &byteCompactionData, FX_INT32 length, CFX_ByteString &result);\r
45     static FX_INT32 byteCompaction(FX_INT32 mode, CFX_Int32Array &codewords, FX_INT32 codeIndex, CFX_ByteString &result);\r
46     static FX_INT32 numericCompaction(CFX_Int32Array &codewords, FX_INT32 codeIndex, CFX_ByteString &result, FX_INT32 &e);\r
47     static CFX_ByteString decodeBase900toBase10(CFX_Int32Array &codewords, FX_INT32 count, FX_INT32 &e);\r
48 };\r
49 #endif\r