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 XFA_FXBARCODE_COMMON_REEDSOLOMON_BC_REEDSOLOMON_H_ 8#define XFA_FXBARCODE_COMMON_REEDSOLOMON_BC_REEDSOLOMON_H_ 9 10#include "core/fxcrt/fx_basic.h" 11 12class CBC_ReedSolomonGF256; 13class CBC_ReedSolomonGF256Poly; 14 15class CBC_ReedSolomonEncoder { 16 public: 17 explicit CBC_ReedSolomonEncoder(CBC_ReedSolomonGF256* field); 18 virtual ~CBC_ReedSolomonEncoder(); 19 20 void Encode(CFX_ArrayTemplate<int32_t>* toEncode, 21 int32_t ecBytes, 22 int32_t& e); 23 virtual void Init(); 24 25 private: 26 CBC_ReedSolomonGF256Poly* BuildGenerator(int32_t degree, int32_t& e); 27 28 CBC_ReedSolomonGF256* m_field; 29 CFX_ArrayTemplate<CBC_ReedSolomonGF256Poly*> m_cachedGenerators; 30}; 31 32#endif // XFA_FXBARCODE_COMMON_REEDSOLOMON_BC_REEDSOLOMON_H_ 33