Index: core/src/fxcodec/jbig2/JBig2_HuffmanTable.h |
diff --git a/core/src/fxcodec/jbig2/JBig2_HuffmanTable.h b/core/src/fxcodec/jbig2/JBig2_HuffmanTable.h |
index fe8294dc7eee029ffe4f9a660d7dd217a9476c37..568c49735099c1823cc8a63ead729ceced1897cb 100644 |
--- a/core/src/fxcodec/jbig2/JBig2_HuffmanTable.h |
+++ b/core/src/fxcodec/jbig2/JBig2_HuffmanTable.h |
@@ -4,38 +4,47 @@ |
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
-#ifndef _JBIG2_HUFFMAN_TABLE_H_ |
-#define _JBIG2_HUFFMAN_TABLE_H_ |
+#ifndef CORE_SRC_FXCODEC_JBIG2_JBIG2_HUFFMANTABLE_H_ |
+#define CORE_SRC_FXCODEC_JBIG2_JBIG2_HUFFMANTABLE_H_ |
-#include "JBig2_HuffmanTable_Standard.h" |
-#include "JBig2_BitStream.h" |
+#include <vector> |
+ |
+#include "core/include/fxcrt/fx_system.h" |
+ |
+class CJBig2_BitStream; |
+struct JBig2TableLine; |
class CJBig2_HuffmanTable { |
public: |
- CJBig2_HuffmanTable(const JBig2TableLine* pTable, int nLines, FX_BOOL bHTOOB); |
+ CJBig2_HuffmanTable(const JBig2TableLine* pTable, |
+ FX_DWORD nLines, |
+ bool bHTOOB); |
explicit CJBig2_HuffmanTable(CJBig2_BitStream* pStream); |
~CJBig2_HuffmanTable(); |
- int parseFromStandardTable(const JBig2TableLine* pTable, |
- int nLines, |
- FX_BOOL bHTOOB); |
- |
- int parseFromCodedBuffer(CJBig2_BitStream* pStream); |
- |
- FX_BOOL isOK() const { return m_bOK; } |
+ bool IsHTOOB() const { return HTOOB; } |
+ FX_DWORD Size() const { return NTEMP; } |
+ const std::vector<int>& GetCODES() const { return CODES; } |
+ const std::vector<int>& GetPREFLEN() const { return PREFLEN; } |
+ const std::vector<int>& GetRANGELEN() const { return RANGELEN; } |
+ const std::vector<int>& GetRANGELOW() const { return RANGELOW; } |
+ bool IsOK() const { return m_bOK; } |
private: |
- void init(); |
+ void ParseFromStandardTable(const JBig2TableLine* pTable); |
+ bool ParseFromCodedBuffer(CJBig2_BitStream* pStream); |
+ void InitCodes(); |
+ void ExtendBuffers(bool increment); |
- FX_BOOL HTOOB; |
+ bool m_bOK; |
+ bool HTOOB; |
FX_DWORD NTEMP; |
- int* CODES; |
- int* PREFLEN; |
- int* RANGELEN; |
- int* RANGELOW; |
- FX_BOOL m_bOK; |
- friend class CJBig2_HuffmanDecoder; |
+ std::vector<int> CODES; |
+ std::vector<int> PREFLEN; |
+ std::vector<int> RANGELEN; |
+ std::vector<int> RANGELOW; |
}; |
-#endif |
+ |
+#endif // CORE_SRC_FXCODEC_JBIG2_JBIG2_HUFFMANTABLE_H_ |