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_FXBARCODE_DATAMATRIX_BC_SYMBOLINFO_H_ 8 #define XFA_FXBARCODE_DATAMATRIX_BC_SYMBOLINFO_H_ 9 10 #include "core/fxcrt/fx_string.h" 11 #include "core/fxcrt/fx_system.h" 12 #include "xfa/fxbarcode/datamatrix/BC_SymbolShapeHint.h" 13 14 class CBC_Dimension; 15 16 class CBC_SymbolInfo : public CBC_SymbolShapeHint { 17 public: 18 CBC_SymbolInfo(bool rectangular, 19 int32_t dataCapacity, 20 int32_t errorCodewords, 21 int32_t matrixWidth, 22 int32_t matrixHeight, 23 int32_t dataRegions); 24 ~CBC_SymbolInfo() override; 25 26 static void Initialize(); 27 static void Finalize(); 28 static void overrideSymbolSet(CBC_SymbolInfo* override); 29 static CBC_SymbolInfo* lookup(int32_t dataCodewords, int32_t& e); 30 static CBC_SymbolInfo* lookup(int32_t dataCodewords, 31 SymbolShapeHint shape, 32 int32_t& e); 33 static CBC_SymbolInfo* lookup(int32_t dataCodewords, 34 bool allowRectangular, 35 bool fail, 36 int32_t& e); 37 static CBC_SymbolInfo* lookup(int32_t dataCodewords, 38 SymbolShapeHint shape, 39 bool fail, 40 int32_t& e); 41 static CBC_SymbolInfo* lookup(int32_t dataCodewords, 42 SymbolShapeHint shape, 43 CBC_Dimension* minSize, 44 CBC_Dimension* maxSize, 45 bool fail, 46 int32_t& e); 47 int32_t getHorizontalDataRegions(int32_t& e); 48 int32_t getVerticalDataRegions(int32_t& e); 49 int32_t getSymbolDataWidth(int32_t& e); 50 int32_t getSymbolDataHeight(int32_t& e); 51 int32_t getSymbolWidth(int32_t& e); 52 int32_t getSymbolHeight(int32_t& e); 53 int32_t getCodewordCount(); 54 int32_t getInterleavedBlockCount(); 55 int32_t getDataLengthForInterleavedBlock(int32_t index); 56 int32_t getErrorLengthForInterleavedBlock(int32_t index); 57 58 int32_t m_dataCapacity; 59 int32_t m_errorCodewords; 60 int32_t m_matrixWidth; 61 int32_t m_matrixHeight; 62 int32_t m_rsBlockData; 63 int32_t m_rsBlockError; 64 65 private: 66 CBC_SymbolInfo(bool rectangular, 67 int32_t dataCapacity, 68 int32_t errorCodewords, 69 int32_t matrixWidth, 70 int32_t matrixHeight, 71 int32_t dataRegions, 72 int32_t rsBlockData, 73 int32_t rsBlockError); 74 75 bool m_rectangular; 76 int32_t m_dataRegions; 77 }; 78 79 #endif // XFA_FXBARCODE_DATAMATRIX_BC_SYMBOLINFO_H_ 80