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 CORE_FXCODEC_JBIG2_JBIG2_SYMBOLDICT_H_ 8 #define CORE_FXCODEC_JBIG2_JBIG2_SYMBOLDICT_H_ 9 10 #include <memory> 11 #include <utility> 12 #include <vector> 13 14 #include "core/fxcodec/jbig2/JBig2_ArithDecoder.h" 15 16 class CJBig2_Image; 17 18 class CJBig2_SymbolDict { 19 public: 20 CJBig2_SymbolDict(); 21 ~CJBig2_SymbolDict(); 22 23 std::unique_ptr<CJBig2_SymbolDict> DeepCopy() const; 24 AddImage(std::unique_ptr<CJBig2_Image> image)25 void AddImage(std::unique_ptr<CJBig2_Image> image) { 26 m_SDEXSYMS.push_back(std::move(image)); 27 } 28 NumImages()29 size_t NumImages() const { return m_SDEXSYMS.size(); } GetImage(size_t index)30 CJBig2_Image* GetImage(size_t index) const { return m_SDEXSYMS[index].get(); } 31 GbContext()32 const std::vector<JBig2ArithCtx>& GbContext() const { return m_gbContext; } GrContext()33 const std::vector<JBig2ArithCtx>& GrContext() const { return m_grContext; } 34 SetGbContext(std::vector<JBig2ArithCtx> gbContext)35 void SetGbContext(std::vector<JBig2ArithCtx> gbContext) { 36 m_gbContext = std::move(gbContext); 37 } SetGrContext(std::vector<JBig2ArithCtx> grContext)38 void SetGrContext(std::vector<JBig2ArithCtx> grContext) { 39 m_grContext = std::move(grContext); 40 } 41 42 private: 43 std::vector<JBig2ArithCtx> m_gbContext; 44 std::vector<JBig2ArithCtx> m_grContext; 45 std::vector<std::unique_ptr<CJBig2_Image>> m_SDEXSYMS; 46 }; 47 48 #endif // CORE_FXCODEC_JBIG2_JBIG2_SYMBOLDICT_H_ 49