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 XFA_FXBARCODE_QRCODE_BC_QRCODERENCODER_H_ | 7 #ifndef XFA_FXBARCODE_QRCODE_BC_QRCODERENCODER_H_ |
8 #define XFA_FXBARCODE_QRCODE_BC_QRCODERENCODER_H_ | 8 #define XFA_FXBARCODE_QRCODE_BC_QRCODERENCODER_H_ |
9 | 9 |
10 #include "core/fxcrt/include/fx_basic.h" | 10 #include "core/fxcrt/include/fx_basic.h" |
11 #include "core/fxcrt/include/fx_string.h" | 11 #include "core/fxcrt/include/fx_string.h" |
12 | 12 |
13 class CBC_QRCoder; | 13 class CBC_QRCoder; |
14 class CBC_QRCoderErrorCorrectionLevel; | 14 class CBC_QRCoderErrorCorrectionLevel; |
15 class CBC_QRCoderMode; | 15 class CBC_QRCoderMode; |
16 class CBC_QRCoderBitVector; | 16 class CBC_QRCoderBitVector; |
17 class CBC_CommonByteArray; | 17 class CBC_CommonByteArray; |
18 class CBC_CommonByteMatrix; | 18 class CBC_CommonByteMatrix; |
| 19 class Make_Pair; |
19 | 20 |
20 class CBC_QRCoderEncoder { | 21 class CBC_QRCoderEncoder { |
21 private: | 22 private: |
22 static const int32_t m_alphaNumbericTable[96]; | 23 static const int32_t m_alphaNumbericTable[96]; |
23 | 24 |
24 public: | 25 public: |
25 CBC_QRCoderEncoder(); | 26 CBC_QRCoderEncoder(); |
26 virtual ~CBC_QRCoderEncoder(); | 27 virtual ~CBC_QRCoderEncoder(); |
27 | 28 |
28 static void Encode(const CFX_ByteString& content, | 29 static void Encode(const CFX_ByteString& content, |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 CBC_CommonByteMatrix* matrix, | 114 CBC_CommonByteMatrix* matrix, |
114 int32_t& e); | 115 int32_t& e); |
115 static int32_t CalculateMaskPenalty(CBC_CommonByteMatrix* matrix); | 116 static int32_t CalculateMaskPenalty(CBC_CommonByteMatrix* matrix); |
116 static void TerminateBits(int32_t numDataBytes, | 117 static void TerminateBits(int32_t numDataBytes, |
117 CBC_QRCoderBitVector* bits, | 118 CBC_QRCoderBitVector* bits, |
118 int32_t& e); | 119 int32_t& e); |
119 static int32_t GetSpanByVersion(CBC_QRCoderMode* modeFirst, | 120 static int32_t GetSpanByVersion(CBC_QRCoderMode* modeFirst, |
120 CBC_QRCoderMode* modeSecond, | 121 CBC_QRCoderMode* modeSecond, |
121 int32_t versionNum, | 122 int32_t versionNum, |
122 int32_t& e); | 123 int32_t& e); |
123 static void MergeString(CFX_PtrArray& result, int32_t versionNum, int32_t& e); | 124 static void MergeString(CFX_ArrayTemplate<Make_Pair*>* result, |
124 static void SplitString(const CFX_ByteString& content, CFX_PtrArray& result); | 125 int32_t versionNum, |
125 static void AppendDataModeLenghInfo(CFX_PtrArray& splitResult, | 126 int32_t& e); |
126 CBC_QRCoderBitVector& headerAndDataBits, | 127 static void SplitString(const CFX_ByteString& content, |
127 CBC_QRCoderMode* tempMode, | 128 CFX_ArrayTemplate<Make_Pair*>* result); |
128 CBC_QRCoder* qrCode, | 129 static void AppendDataModeLenghInfo( |
129 CFX_ByteString& encoding, | 130 const CFX_ArrayTemplate<Make_Pair*>& splitResult, |
130 int32_t& e); | 131 CBC_QRCoderBitVector& headerAndDataBits, |
| 132 CBC_QRCoderMode* tempMode, |
| 133 CBC_QRCoder* qrCode, |
| 134 CFX_ByteString& encoding, |
| 135 int32_t& e); |
131 }; | 136 }; |
132 | 137 |
133 #endif // XFA_FXBARCODE_QRCODE_BC_QRCODERENCODER_H_ | 138 #endif // XFA_FXBARCODE_QRCODE_BC_QRCODERENCODER_H_ |
OLD | NEW |