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_QRCODERVERSION_H_ 8#define _BC_QRCODERVERSION_H_ 9class CBC_QRCoderECBlocks; 10class CBC_CommonBitMatrix; 11class CBC_QRCoderErrorCorrectionLevel; 12class CBC_QRCoderVersion { 13 private: 14 const static int32_t VERSION_DECODE_INFO[34]; 15 static CFX_PtrArray* VERSION; 16 int32_t m_versionNumber; 17 int32_t m_totalCodeWords; 18 CFX_Int32Array m_alignmentPatternCenters; 19 CFX_PtrArray m_ecBlocks; 20 21 CBC_QRCoderVersion(); 22 CBC_QRCoderVersion(int32_t versionNumber, 23 CBC_QRCoderECBlocks* ecBlocks1, 24 CBC_QRCoderECBlocks* ecBlocks2, 25 CBC_QRCoderECBlocks* ecBlocks3, 26 CBC_QRCoderECBlocks* ecBlocks4); 27 28 public: 29 virtual ~CBC_QRCoderVersion(); 30 static void Initialize(); 31 static void Finalize(); 32 33 int32_t GetVersionNumber(); 34 int32_t GetTotalCodeWords(); 35 int32_t GetDimensionForVersion(); 36 CBC_CommonBitMatrix* BuildFunctionPattern(int32_t& e); 37 CFX_Int32Array* GetAlignmentPatternCenters(); 38 CBC_QRCoderECBlocks* GetECBlocksForLevel( 39 CBC_QRCoderErrorCorrectionLevel* ecLevel); 40 static CBC_QRCoderVersion* GetVersionForNumber(int32_t versionNumber, 41 int32_t& e); 42 static CBC_QRCoderVersion* GetProvisionalVersionForDimension( 43 int32_t dimension, 44 int32_t& e); 45 static CBC_QRCoderVersion* DecodeVersionInformation(int32_t versionBits, 46 int32_t& e); 47 static void Destroy(); 48}; 49#endif 50