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