diff options
Diffstat (limited to 'core/src/fxcodec/jbig2/JBig2_Context.h')
-rw-r--r-- | core/src/fxcodec/jbig2/JBig2_Context.h | 38 |
1 files changed, 17 insertions, 21 deletions
diff --git a/core/src/fxcodec/jbig2/JBig2_Context.h b/core/src/fxcodec/jbig2/JBig2_Context.h index eb0ceb0eb9..0590fd157b 100644 --- a/core/src/fxcodec/jbig2/JBig2_Context.h +++ b/core/src/fxcodec/jbig2/JBig2_Context.h @@ -10,18 +10,16 @@ #include <list> #include <utility> -#include "JBig2_Module.h" +#include "../../../../third_party/base/nonstd_unique_ptr.h" +#include "../../../include/fxcodec/fx_codec_def.h" +#include "JBig2_GeneralDecoder.h" #include "JBig2_List.h" -#include "JBig2_Segment.h" +#include "JBig2_Module.h" #include "JBig2_Page.h" -#include "JBig2_GeneralDecoder.h" -#include "../../../include/fxcodec/fx_codec_def.h" +#include "JBig2_Segment.h" + +using CJBig2_CachePair = std::pair<uint8_t*, CJBig2_SymbolDict*>; -typedef std::pair<uint8_t*, CJBig2_SymbolDict*> CJBig2_CachePair; -typedef enum { - JBIG2_OUT_OF_PAGE = 0, - JBIG2_IN_PAGE, -} JBig2State; #define JBIG2_SUCCESS 0 #define JBIG2_FAILED -1 #define JBIG2_ERROR_TOO_SHORT -2 @@ -36,6 +34,7 @@ typedef enum { #define JBIG2_RANDOM_STREAM 2 #define JBIG2_EMBED_STREAM 3 #define JBIG2_MIN_SEGMENT_SIZE 11 + class CJBig2_Context : public CJBig2_Object { public: static CJBig2_Context* CreateContext( @@ -62,6 +61,11 @@ class CJBig2_Context : public CJBig2_Object { FXCODEC_STATUS GetProcessiveStatus() { return m_ProcessiveStatus; } private: + enum JBig2State { + JBIG2_OUT_OF_PAGE = 0, + JBIG2_IN_PAGE, + }; + CJBig2_Context(uint8_t* pGlobalData, FX_DWORD dwGlobalLength, uint8_t* pData, @@ -119,22 +123,14 @@ class CJBig2_Context : public CJBig2_Object { private: CJBig2_Context* m_pGlobalContext; - int32_t m_nStreamType; - CJBig2_BitStream* m_pStream; - int32_t m_nState; - - CJBig2_List<CJBig2_Segment>* m_pSegmentList; - - CJBig2_List<JBig2PageInfo>* m_pPageInfoList; - + CJBig2_List<CJBig2_Segment> m_SegmentList; + CJBig2_List<JBig2PageInfo> m_PageInfoList; CJBig2_Image* m_pPage; - FX_BOOL m_bBufSpecified; - - int32_t m_nSegmentDecoded; + size_t m_nSegmentDecoded; IFX_Pause* m_pPause; int32_t m_PauseStep; FXCODEC_STATUS m_ProcessiveStatus; @@ -142,7 +138,7 @@ class CJBig2_Context : public CJBig2_Object { CJBig2_ArithDecoder* m_pArithDecoder; CJBig2_GRDProc* m_pGRD; JBig2ArithCtx* m_gbContext; - CJBig2_Segment* m_pSegment; + nonstd::unique_ptr<CJBig2_Segment> m_pSegment; FX_DWORD m_dwOffset; JBig2RegionInfo m_ri; std::list<CJBig2_CachePair>* m_pSymbolDictCache; |