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 XFA_SRC_FXBARCODE_PDF417_BC_PDF417_H_ | |
8 #define XFA_SRC_FXBARCODE_PDF417_BC_PDF417_H_ | |
9 | |
10 #include "core/include/fxcrt/fx_basic.h" | |
11 #include "xfa/src/fxbarcode/pdf417/BC_PDF417Compaction.h" | |
12 | |
13 class CBC_BarcodeRow; | |
14 class CBC_BarcodeMatrix; | |
15 | |
16 class CBC_PDF417 { | |
17 public: | |
18 CBC_PDF417(); | |
19 CBC_PDF417(FX_BOOL compact); | |
20 virtual ~CBC_PDF417(); | |
21 CBC_BarcodeMatrix* getBarcodeMatrix(); | |
22 void generateBarcodeLogic(CFX_WideString msg, | |
23 int32_t errorCorrectionLevel, | |
24 int32_t& e); | |
25 void setDimensions(int32_t maxCols, | |
26 int32_t minCols, | |
27 int32_t maxRows, | |
28 int32_t minRows); | |
29 void setCompaction(Compaction compaction); | |
30 void setCompact(FX_BOOL compact); | |
31 | |
32 private: | |
33 static int32_t START_PATTERN; | |
34 static int32_t STOP_PATTERN; | |
35 static int32_t CODEWORD_TABLE[][1000]; | |
36 static FX_FLOAT PREFERRED_RATIO; | |
37 static FX_FLOAT DEFAULT_MODULE_WIDTH; | |
38 static FX_FLOAT HEIGHT; | |
39 CBC_BarcodeMatrix* m_barcodeMatrix; | |
40 FX_BOOL m_compact; | |
41 Compaction m_compaction; | |
42 int32_t m_minCols; | |
43 int32_t m_maxCols; | |
44 int32_t m_maxRows; | |
45 int32_t m_minRows; | |
46 | |
47 private: | |
48 static int32_t calculateNumberOfRows(int32_t m, int32_t k, int32_t c); | |
49 static int32_t getNumberOfPadCodewords(int32_t m, | |
50 int32_t k, | |
51 int32_t c, | |
52 int32_t r); | |
53 static void encodeChar(int32_t pattern, int32_t len, CBC_BarcodeRow* logic); | |
54 void encodeLowLevel(CFX_WideString fullCodewords, | |
55 int32_t c, | |
56 int32_t r, | |
57 int32_t errorCorrectionLevel, | |
58 CBC_BarcodeMatrix* logic); | |
59 CFX_Int32Array* determineDimensions(int32_t sourceCodeWords, | |
60 int32_t errorCorrectionCodeWords, | |
61 int32_t& e); | |
62 }; | |
63 | |
64 #endif // XFA_SRC_FXBARCODE_PDF417_BC_PDF417_H_ | |
OLD | NEW |