| 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 _BC_DATAMATRIXVERSION_H_ | |
| 8 #define _BC_DATAMATRIXVERSION_H_ | |
| 9 class ECB; | |
| 10 class ECBlocks; | |
| 11 class CBC_DataMatrixVersion; | |
| 12 class ECB : public CFX_Object | |
| 13 { | |
| 14 public: | |
| 15 ECB(FX_INT32 count, FX_INT32 dataCodewords) | |
| 16 { | |
| 17 m_count = count; | |
| 18 m_dataCodewords = dataCodewords; | |
| 19 } | |
| 20 | |
| 21 FX_INT32 GetCount() | |
| 22 { | |
| 23 return m_count; | |
| 24 } | |
| 25 | |
| 26 FX_INT32 GetDataCodewords() | |
| 27 { | |
| 28 return m_dataCodewords; | |
| 29 } | |
| 30 private: | |
| 31 FX_INT32 m_count; | |
| 32 FX_INT32 m_dataCodewords; | |
| 33 }; | |
| 34 class ECBlocks : public CFX_Object | |
| 35 { | |
| 36 public: | |
| 37 ECBlocks(FX_INT32 ecCodewords, ECB *ecBlocks) | |
| 38 { | |
| 39 m_ecCodewords = ecCodewords; | |
| 40 m_ecBlocks.Add(ecBlocks); | |
| 41 } | |
| 42 | |
| 43 ECBlocks(FX_INT32 ecCodewords, ECB *ecBlocks1, ECB *ecBlocks2) | |
| 44 { | |
| 45 m_ecCodewords = ecCodewords; | |
| 46 m_ecBlocks.Add(ecBlocks1); | |
| 47 m_ecBlocks.Add(ecBlocks2); | |
| 48 } | |
| 49 ~ECBlocks() | |
| 50 { | |
| 51 for(FX_INT32 i = 0; i < m_ecBlocks.GetSize(); i++) { | |
| 52 delete (ECB*)m_ecBlocks[i]; | |
| 53 } | |
| 54 m_ecBlocks.RemoveAll(); | |
| 55 } | |
| 56 | |
| 57 FX_INT32 GetECCodewords() | |
| 58 { | |
| 59 return m_ecCodewords; | |
| 60 } | |
| 61 | |
| 62 const CFX_PtrArray &GetECBlocks() | |
| 63 { | |
| 64 return m_ecBlocks; | |
| 65 } | |
| 66 private: | |
| 67 FX_INT32 m_ecCodewords; | |
| 68 CFX_PtrArray m_ecBlocks; | |
| 69 }; | |
| 70 class CBC_DataMatrixVersion : public CFX_Object | |
| 71 { | |
| 72 public: | |
| 73 CBC_DataMatrixVersion(FX_INT32 versionNumber, | |
| 74 FX_INT32 symbolSizeRows, | |
| 75 FX_INT32 symbolSizeColumns, | |
| 76 FX_INT32 dataRegionSizeRows, | |
| 77 FX_INT32 dataRegionSizeColumns, | |
| 78 ECBlocks *ecBlocks); | |
| 79 virtual ~CBC_DataMatrixVersion(); | |
| 80 static void Initialize(); | |
| 81 static void Finalize(); | |
| 82 FX_INT32 GetVersionNumber(); | |
| 83 FX_INT32 GetSymbolSizeRows(); | |
| 84 FX_INT32 GetSymbolSizeColumns(); | |
| 85 FX_INT32 GetDataRegionSizeRows(); | |
| 86 FX_INT32 GetDataRegionSizeColumns(); | |
| 87 FX_INT32 GetTotalCodewords(); | |
| 88 ECBlocks *GetECBlocks(); | |
| 89 static CBC_DataMatrixVersion *GetVersionForDimensions(FX_INT32 numRows, FX_I
NT32 numColumns, FX_INT32 &e); | |
| 90 static void ReleaseAll(); | |
| 91 private: | |
| 92 FX_INT32 m_versionNumber; | |
| 93 FX_INT32 m_symbolSizeRows; | |
| 94 FX_INT32 m_symbolSizeColumns; | |
| 95 FX_INT32 m_dataRegionSizeRows; | |
| 96 FX_INT32 m_dataRegionSizeColumns; | |
| 97 ECBlocks *m_ecBlocks; | |
| 98 FX_INT32 m_totalCodewords; | |
| 99 static CFX_PtrArray* VERSIONS; | |
| 100 }; | |
| 101 #endif | |
| OLD | NEW |