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