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_PDF417_BC_PDF417_H_ | 7 #ifndef XFA_FXBARCODE_PDF417_BC_PDF417_H_ |
8 #define XFA_FXBARCODE_PDF417_BC_PDF417_H_ | 8 #define XFA_FXBARCODE_PDF417_BC_PDF417_H_ |
9 | 9 |
10 #include "core/include/fxcrt/fx_basic.h" | 10 #include "core/include/fxcrt/fx_basic.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 int32_t errorCorrectionLevel, | 23 int32_t errorCorrectionLevel, |
24 int32_t& e); | 24 int32_t& e); |
25 void setDimensions(int32_t maxCols, | 25 void setDimensions(int32_t maxCols, |
26 int32_t minCols, | 26 int32_t minCols, |
27 int32_t maxRows, | 27 int32_t maxRows, |
28 int32_t minRows); | 28 int32_t minRows); |
29 void setCompaction(Compaction compaction); | 29 void setCompaction(Compaction compaction); |
30 void setCompact(FX_BOOL compact); | 30 void setCompact(FX_BOOL compact); |
31 | 31 |
32 private: | 32 private: |
33 static int32_t START_PATTERN; | 33 static const int32_t START_PATTERN = 0x1fea8; |
34 static int32_t STOP_PATTERN; | 34 static const int32_t STOP_PATTERN = 0x3fa29; |
35 static int32_t CODEWORD_TABLE[][1000]; | 35 static const int32_t CODEWORD_TABLE[][929]; |
36 static FX_FLOAT PREFERRED_RATIO; | 36 static FX_FLOAT PREFERRED_RATIO; |
37 static FX_FLOAT DEFAULT_MODULE_WIDTH; | 37 static FX_FLOAT DEFAULT_MODULE_WIDTH; |
38 static FX_FLOAT HEIGHT; | 38 static FX_FLOAT HEIGHT; |
39 CBC_BarcodeMatrix* m_barcodeMatrix; | 39 CBC_BarcodeMatrix* m_barcodeMatrix; |
40 FX_BOOL m_compact; | 40 FX_BOOL m_compact; |
41 Compaction m_compaction; | 41 Compaction m_compaction; |
42 int32_t m_minCols; | 42 int32_t m_minCols; |
43 int32_t m_maxCols; | 43 int32_t m_maxCols; |
44 int32_t m_maxRows; | 44 int32_t m_maxRows; |
45 int32_t m_minRows; | 45 int32_t m_minRows; |
46 | 46 |
47 private: | 47 private: |
48 static int32_t calculateNumberOfRows(int32_t m, int32_t k, int32_t c); | 48 static int32_t calculateNumberOfRows(int32_t m, int32_t k, int32_t c); |
49 static int32_t getNumberOfPadCodewords(int32_t m, | 49 static int32_t getNumberOfPadCodewords(int32_t m, |
50 int32_t k, | 50 int32_t k, |
51 int32_t c, | 51 int32_t c, |
52 int32_t r); | 52 int32_t r); |
53 static void encodeChar(int32_t pattern, int32_t len, CBC_BarcodeRow* logic); | 53 static void encodeChar(int32_t pattern, int32_t len, CBC_BarcodeRow* logic); |
54 void encodeLowLevel(CFX_WideString fullCodewords, | 54 void encodeLowLevel(CFX_WideString fullCodewords, |
55 int32_t c, | 55 int32_t c, |
56 int32_t r, | 56 int32_t r, |
57 int32_t errorCorrectionLevel, | 57 int32_t errorCorrectionLevel, |
58 CBC_BarcodeMatrix* logic); | 58 CBC_BarcodeMatrix* logic); |
59 CFX_Int32Array* determineDimensions(int32_t sourceCodeWords, | 59 CFX_Int32Array* determineDimensions(int32_t sourceCodeWords, |
60 int32_t errorCorrectionCodeWords, | 60 int32_t errorCorrectionCodeWords, |
61 int32_t& e); | 61 int32_t& e); |
62 }; | 62 }; |
63 | 63 |
64 #endif // XFA_FXBARCODE_PDF417_BC_PDF417_H_ | 64 #endif // XFA_FXBARCODE_PDF417_BC_PDF417_H_ |
OLD | NEW |