OLD | NEW |
| (Empty) |
1 // Copyright 2014 PDFium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | |
6 | |
7 #ifndef _BC_PDF417HIGHLEVELENCODER_H_ | |
8 #define _BC_PDF417HIGHLEVELENCODER_H_ | |
9 | |
10 #include "BC_PDF417Compaction.h" | |
11 | |
12 class CBC_PDF417HighLevelEncoder : public CFX_Object | |
13 { | |
14 public: | |
15 static CFX_WideString encodeHighLevel(CFX_WideString msg, Compaction compact
ion, FX_INT32 &e); | |
16 static void Inverse(); | |
17 static void Initialize(); | |
18 static void Finalize(); | |
19 private: | |
20 static FX_INT32 TEXT_COMPACTION; | |
21 static FX_INT32 BYTE_COMPACTION; | |
22 static FX_INT32 NUMERIC_COMPACTION; | |
23 static FX_INT32 SUBMODE_PUNCTUATION; | |
24 static FX_INT32 LATCH_TO_TEXT; | |
25 static FX_INT32 LATCH_TO_BYTE_PADDED; | |
26 static FX_INT32 LATCH_TO_NUMERIC; | |
27 static FX_INT32 SHIFT_TO_BYTE; | |
28 static FX_INT32 LATCH_TO_BYTE; | |
29 static FX_BYTE TEXT_MIXED_RAW[]; | |
30 static FX_BYTE TEXT_PUNCTUATION_RAW[]; | |
31 static FX_INT32 MIXED[128]; | |
32 static FX_INT32 PUNCTUATION[128]; | |
33 static FX_INT32 encodeText(CFX_WideString msg, FX_INT32 startpos, FX_INT32 c
ount, CFX_WideString &sb, FX_INT32 initialSubmode); | |
34 static void encodeBinary(CFX_ByteArray* bytes, FX_INT32 startpos, FX_INT32 c
ount, FX_INT32 startmode, CFX_WideString &sb); | |
35 static void encodeNumeric(CFX_WideString msg, FX_INT32 startpos, FX_INT32 co
unt, CFX_WideString &sb); | |
36 static FX_BOOL isDigit(FX_WCHAR ch); | |
37 static FX_BOOL isAlphaUpper(FX_WCHAR ch); | |
38 static FX_BOOL isAlphaLower(FX_WCHAR ch); | |
39 static FX_BOOL isMixed(FX_WCHAR ch); | |
40 static FX_BOOL isPunctuation(FX_WCHAR ch); | |
41 static FX_BOOL isText(FX_WCHAR ch); | |
42 static FX_INT32 determineConsecutiveDigitCount(CFX_WideString msg, FX_INT32
startpos); | |
43 static FX_INT32 determineConsecutiveTextCount(CFX_WideString msg, FX_INT32 s
tartpos); | |
44 static FX_INT32 determineConsecutiveBinaryCount(CFX_WideString msg, CFX_Byte
Array* bytes, FX_INT32 startpos, FX_INT32 &e); | |
45 | |
46 friend class PDF417HighLevelEncoder_EncodeNumeric_Test; | |
47 friend class PDF417HighLevelEncoder_EncodeBinary_Test; | |
48 friend class PDF417HighLevelEncoder_EncodeText_Test; | |
49 friend class PDF417HighLevelEncoder_ConsecutiveDigitCount_Test; | |
50 friend class PDF417HighLevelEncoder_ConsecutiveTextCount_Test; | |
51 friend class PDF417HighLevelEncoder_ConsecutiveBinaryCount_Test; | |
52 }; | |
53 | |
54 #endif | |
OLD | NEW |