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_PDF417HIGHLEVELENCODER_H_ | 7 #ifndef _BC_PDF417HIGHLEVELENCODER_H_ |
8 #define _BC_PDF417HIGHLEVELENCODER_H_ | 8 #define _BC_PDF417HIGHLEVELENCODER_H_ |
9 | 9 |
10 #include "BC_PDF417Compaction.h" | 10 #include "BC_PDF417Compaction.h" |
11 | 11 |
12 class CBC_PDF417HighLevelEncoder | 12 class CBC_PDF417HighLevelEncoder |
13 { | 13 { |
14 public: | 14 public: |
15 static CFX_WideString encodeHighLevel(CFX_WideString msg, Compaction compact
ion, FX_INT32 &e); | 15 static CFX_WideString encodeHighLevel(CFX_WideString msg, Compaction compact
ion, int32_t &e); |
16 static void Inverse(); | 16 static void Inverse(); |
17 static void Initialize(); | 17 static void Initialize(); |
18 static void Finalize(); | 18 static void Finalize(); |
19 private: | 19 private: |
20 static FX_INT32 TEXT_COMPACTION; | 20 static int32_t TEXT_COMPACTION; |
21 static FX_INT32 BYTE_COMPACTION; | 21 static int32_t BYTE_COMPACTION; |
22 static FX_INT32 NUMERIC_COMPACTION; | 22 static int32_t NUMERIC_COMPACTION; |
23 static FX_INT32 SUBMODE_PUNCTUATION; | 23 static int32_t SUBMODE_PUNCTUATION; |
24 static FX_INT32 LATCH_TO_TEXT; | 24 static int32_t LATCH_TO_TEXT; |
25 static FX_INT32 LATCH_TO_BYTE_PADDED; | 25 static int32_t LATCH_TO_BYTE_PADDED; |
26 static FX_INT32 LATCH_TO_NUMERIC; | 26 static int32_t LATCH_TO_NUMERIC; |
27 static FX_INT32 SHIFT_TO_BYTE; | 27 static int32_t SHIFT_TO_BYTE; |
28 static FX_INT32 LATCH_TO_BYTE; | 28 static int32_t LATCH_TO_BYTE; |
29 static FX_BYTE TEXT_MIXED_RAW[]; | 29 static uint8_t TEXT_MIXED_RAW[]; |
30 static FX_BYTE TEXT_PUNCTUATION_RAW[]; | 30 static uint8_t TEXT_PUNCTUATION_RAW[]; |
31 static FX_INT32 MIXED[128]; | 31 static int32_t MIXED[128]; |
32 static FX_INT32 PUNCTUATION[128]; | 32 static int32_t PUNCTUATION[128]; |
33 static FX_INT32 encodeText(CFX_WideString msg, FX_INT32 startpos, FX_INT32 c
ount, CFX_WideString &sb, FX_INT32 initialSubmode); | 33 static int32_t encodeText(CFX_WideString msg, int32_t startpos, int32_t coun
t, CFX_WideString &sb, int32_t initialSubmode); |
34 static void encodeBinary(CFX_ByteArray* bytes, FX_INT32 startpos, FX_INT32 c
ount, FX_INT32 startmode, CFX_WideString &sb); | 34 static void encodeBinary(CFX_ByteArray* bytes, int32_t startpos, int32_t cou
nt, int32_t startmode, CFX_WideString &sb); |
35 static void encodeNumeric(CFX_WideString msg, FX_INT32 startpos, FX_INT32 co
unt, CFX_WideString &sb); | 35 static void encodeNumeric(CFX_WideString msg, int32_t startpos, int32_t coun
t, CFX_WideString &sb); |
36 static FX_BOOL isDigit(FX_WCHAR ch); | 36 static FX_BOOL isDigit(FX_WCHAR ch); |
37 static FX_BOOL isAlphaUpper(FX_WCHAR ch); | 37 static FX_BOOL isAlphaUpper(FX_WCHAR ch); |
38 static FX_BOOL isAlphaLower(FX_WCHAR ch); | 38 static FX_BOOL isAlphaLower(FX_WCHAR ch); |
39 static FX_BOOL isMixed(FX_WCHAR ch); | 39 static FX_BOOL isMixed(FX_WCHAR ch); |
40 static FX_BOOL isPunctuation(FX_WCHAR ch); | 40 static FX_BOOL isPunctuation(FX_WCHAR ch); |
41 static FX_BOOL isText(FX_WCHAR ch); | 41 static FX_BOOL isText(FX_WCHAR ch); |
42 static FX_INT32 determineConsecutiveDigitCount(CFX_WideString msg, FX_INT32
startpos); | 42 static int32_t determineConsecutiveDigitCount(CFX_WideString msg, int32_t st
artpos); |
43 static FX_INT32 determineConsecutiveTextCount(CFX_WideString msg, FX_INT32 s
tartpos); | 43 static int32_t determineConsecutiveTextCount(CFX_WideString msg, int32_t sta
rtpos); |
44 static FX_INT32 determineConsecutiveBinaryCount(CFX_WideString msg, CFX_Byte
Array* bytes, FX_INT32 startpos, FX_INT32 &e); | 44 static int32_t determineConsecutiveBinaryCount(CFX_WideString msg, CFX_ByteA
rray* bytes, int32_t startpos, int32_t &e); |
45 | 45 |
46 friend class PDF417HighLevelEncoder_EncodeNumeric_Test; | 46 friend class PDF417HighLevelEncoder_EncodeNumeric_Test; |
47 friend class PDF417HighLevelEncoder_EncodeBinary_Test; | 47 friend class PDF417HighLevelEncoder_EncodeBinary_Test; |
48 friend class PDF417HighLevelEncoder_EncodeText_Test; | 48 friend class PDF417HighLevelEncoder_EncodeText_Test; |
49 friend class PDF417HighLevelEncoder_ConsecutiveDigitCount_Test; | 49 friend class PDF417HighLevelEncoder_ConsecutiveDigitCount_Test; |
50 friend class PDF417HighLevelEncoder_ConsecutiveTextCount_Test; | 50 friend class PDF417HighLevelEncoder_ConsecutiveTextCount_Test; |
51 friend class PDF417HighLevelEncoder_ConsecutiveBinaryCount_Test; | 51 friend class PDF417HighLevelEncoder_ConsecutiveBinaryCount_Test; |
52 }; | 52 }; |
53 | 53 |
54 #endif | 54 #endif |
OLD | NEW |