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 _JBIG2_HUFFMAN_TABLE_H_ 8 #define _JBIG2_HUFFMAN_TABLE_H_ 9 #include "JBig2_Module.h" 10 #include "JBig2_HuffmanTable_Standard.h" 11 #include "JBig2_BitStream.h" 12 class CJBig2_HuffmanTable : public CJBig2_Object 13 { 14 public: 15 16 CJBig2_HuffmanTable(const JBig2TableLine *pTable, int nLines, FX_BOOL bHTOOB); 17 18 CJBig2_HuffmanTable(CJBig2_BitStream *pStream); 19 20 ~CJBig2_HuffmanTable(); 21 22 void init(); 23 24 int parseFromStandardTable(const JBig2TableLine *pTable, int nLines, FX_BOOL bHTOOB); 25 26 int parseFromCodedBuffer(CJBig2_BitStream *pStream); 27 isOK()28 FX_BOOL isOK() 29 { 30 return m_bOK; 31 } 32 private: 33 FX_BOOL HTOOB; 34 int NTEMP; 35 int *CODES; 36 int *PREFLEN; 37 int *RANGELEN; 38 int *RANGELOW; 39 FX_BOOL m_bOK; 40 friend class CJBig2_HuffmanDecoder; 41 }; 42 #endif 43