Home | History | Annotate | Download | only in datamatrix
      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 FXBARCODE_DATAMATRIX_BC_ERRORCORRECTION_H_
      8 #define FXBARCODE_DATAMATRIX_BC_ERRORCORRECTION_H_
      9 
     10 #include "core/fxcrt/widestring.h"
     11 
     12 class CBC_SymbolInfo;
     13 
     14 class CBC_ErrorCorrection {
     15  public:
     16   CBC_ErrorCorrection();
     17   virtual ~CBC_ErrorCorrection();
     18 
     19   static void Initialize();
     20   static void Finalize();
     21   static WideString encodeECC200(WideString codewords,
     22                                  CBC_SymbolInfo* symbolInfo,
     23                                  int32_t& e);
     24 
     25  private:
     26   static int32_t MODULO_VALUE;
     27   static int32_t LOG[256];
     28   static int32_t ALOG[256];
     29 
     30  private:
     31   static WideString createECCBlock(WideString codewords,
     32                                    int32_t numECWords,
     33                                    int32_t& e);
     34   static WideString createECCBlock(WideString codewords,
     35                                    int32_t start,
     36                                    int32_t len,
     37                                    int32_t numECWords,
     38                                    int32_t& e);
     39 };
     40 
     41 #endif  // FXBARCODE_DATAMATRIX_BC_ERRORCORRECTION_H_
     42