| 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_SRC_FXBARCODE_DATAMATRIX_BC_DATAMATRIXVERSION_H_ |   7 #ifndef XFA_SRC_FXBARCODE_DATAMATRIX_BC_DATAMATRIXVERSION_H_ | 
|   8 #define XFA_SRC_FXBARCODE_DATAMATRIX_BC_DATAMATRIXVERSION_H_ |   8 #define XFA_SRC_FXBARCODE_DATAMATRIX_BC_DATAMATRIXVERSION_H_ | 
|   9  |   9  | 
|  10 class ECBlocks; |  10 #include "core/include/fxcrt/fx_basic.h" | 
 |  11  | 
|  11 class CBC_DataMatrixVersion; |  12 class CBC_DataMatrixVersion; | 
 |  13  | 
|  12 class ECB { |  14 class ECB { | 
|  13  public: |  15  public: | 
|  14   ECB(int32_t count, int32_t dataCodewords) { |  16   ECB(int32_t count, int32_t dataCodewords) { | 
|  15     m_count = count; |  17     m_count = count; | 
|  16     m_dataCodewords = dataCodewords; |  18     m_dataCodewords = dataCodewords; | 
|  17   } |  19   } | 
|  18  |  20  | 
|  19   int32_t GetCount() { return m_count; } |  21   int32_t GetCount() { return m_count; } | 
|  20  |  22  | 
|  21   int32_t GetDataCodewords() { return m_dataCodewords; } |  23   int32_t GetDataCodewords() { return m_dataCodewords; } | 
|  22  |  24  | 
|  23  private: |  25  private: | 
|  24   int32_t m_count; |  26   int32_t m_count; | 
|  25   int32_t m_dataCodewords; |  27   int32_t m_dataCodewords; | 
|  26 }; |  28 }; | 
 |  29  | 
|  27 class ECBlocks { |  30 class ECBlocks { | 
|  28  public: |  31  public: | 
|  29   ECBlocks(int32_t ecCodewords, ECB* ecBlocks) { |  32   ECBlocks(int32_t ecCodewords, ECB* ecBlocks) { | 
|  30     m_ecCodewords = ecCodewords; |  33     m_ecCodewords = ecCodewords; | 
|  31     m_ecBlocks.Add(ecBlocks); |  34     m_ecBlocks.Add(ecBlocks); | 
|  32   } |  35   } | 
|  33  |  36  | 
|  34   ECBlocks(int32_t ecCodewords, ECB* ecBlocks1, ECB* ecBlocks2) { |  37   ECBlocks(int32_t ecCodewords, ECB* ecBlocks1, ECB* ecBlocks2) { | 
|  35     m_ecCodewords = ecCodewords; |  38     m_ecCodewords = ecCodewords; | 
|  36     m_ecBlocks.Add(ecBlocks1); |  39     m_ecBlocks.Add(ecBlocks1); | 
|  37     m_ecBlocks.Add(ecBlocks2); |  40     m_ecBlocks.Add(ecBlocks2); | 
|  38   } |  41   } | 
|  39   ~ECBlocks() { |  42   ~ECBlocks() { | 
|  40     for (int32_t i = 0; i < m_ecBlocks.GetSize(); i++) { |  43     for (int32_t i = 0; i < m_ecBlocks.GetSize(); i++) { | 
|  41       delete (ECB*)m_ecBlocks[i]; |  44       delete (ECB*)m_ecBlocks[i]; | 
|  42     } |  45     } | 
|  43     m_ecBlocks.RemoveAll(); |  46     m_ecBlocks.RemoveAll(); | 
|  44   } |  47   } | 
|  45  |  48  | 
|  46   int32_t GetECCodewords() { return m_ecCodewords; } |  49   int32_t GetECCodewords() { return m_ecCodewords; } | 
|  47  |  50  | 
|  48   const CFX_PtrArray& GetECBlocks() { return m_ecBlocks; } |  51   const CFX_PtrArray& GetECBlocks() { return m_ecBlocks; } | 
|  49  |  52  | 
|  50  private: |  53  private: | 
|  51   int32_t m_ecCodewords; |  54   int32_t m_ecCodewords; | 
|  52   CFX_PtrArray m_ecBlocks; |  55   CFX_PtrArray m_ecBlocks; | 
|  53 }; |  56 }; | 
 |  57  | 
|  54 class CBC_DataMatrixVersion { |  58 class CBC_DataMatrixVersion { | 
|  55  public: |  59  public: | 
|  56   CBC_DataMatrixVersion(int32_t versionNumber, |  60   CBC_DataMatrixVersion(int32_t versionNumber, | 
|  57                         int32_t symbolSizeRows, |  61                         int32_t symbolSizeRows, | 
|  58                         int32_t symbolSizeColumns, |  62                         int32_t symbolSizeColumns, | 
|  59                         int32_t dataRegionSizeRows, |  63                         int32_t dataRegionSizeRows, | 
|  60                         int32_t dataRegionSizeColumns, |  64                         int32_t dataRegionSizeColumns, | 
|  61                         ECBlocks* ecBlocks); |  65                         ECBlocks* ecBlocks); | 
|  62   virtual ~CBC_DataMatrixVersion(); |  66   virtual ~CBC_DataMatrixVersion(); | 
|  63   static void Initialize(); |  67   static void Initialize(); | 
| (...skipping 15 matching lines...) Expand all  Loading... | 
|  79   int32_t m_symbolSizeRows; |  83   int32_t m_symbolSizeRows; | 
|  80   int32_t m_symbolSizeColumns; |  84   int32_t m_symbolSizeColumns; | 
|  81   int32_t m_dataRegionSizeRows; |  85   int32_t m_dataRegionSizeRows; | 
|  82   int32_t m_dataRegionSizeColumns; |  86   int32_t m_dataRegionSizeColumns; | 
|  83   ECBlocks* m_ecBlocks; |  87   ECBlocks* m_ecBlocks; | 
|  84   int32_t m_totalCodewords; |  88   int32_t m_totalCodewords; | 
|  85   static CFX_PtrArray* VERSIONS; |  89   static CFX_PtrArray* VERSIONS; | 
|  86 }; |  90 }; | 
|  87  |  91  | 
|  88 #endif  // XFA_SRC_FXBARCODE_DATAMATRIX_BC_DATAMATRIXVERSION_H_ |  92 #endif  // XFA_SRC_FXBARCODE_DATAMATRIX_BC_DATAMATRIXVERSION_H_ | 
| OLD | NEW |