• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2016 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_CODEC_CCODEC_JBIG2MODULE_H_
8 #define CORE_FXCODEC_CODEC_CCODEC_JBIG2MODULE_H_
9 
10 #include <memory>
11 
12 #include "core/fxcodec/fx_codec_def.h"
13 #include "core/fxcrt/fx_basic.h"
14 
15 class CJBig2_Context;
16 class CJBig2_Image;
17 class CPDF_StreamAcc;
18 class IFX_Pause;
19 class JBig2_DocumentContext;
20 
21 class CCodec_Jbig2Context {
22  public:
23   CCodec_Jbig2Context();
24   ~CCodec_Jbig2Context();
25 
26   uint32_t m_width;
27   uint32_t m_height;
28   CPDF_StreamAcc* m_pGlobalStream;
29   CPDF_StreamAcc* m_pSrcStream;
30   uint8_t* m_dest_buf;
31   uint32_t m_dest_pitch;
32   IFX_Pause* m_pPause;
33   std::unique_ptr<CJBig2_Context> m_pContext;
34 };
35 
36 class CCodec_Jbig2Module {
37  public:
CCodec_Jbig2Module()38   CCodec_Jbig2Module() {}
39   ~CCodec_Jbig2Module();
40 
41   FXCODEC_STATUS StartDecode(
42       CCodec_Jbig2Context* pJbig2Context,
43       std::unique_ptr<JBig2_DocumentContext>* pContextHolder,
44       uint32_t width,
45       uint32_t height,
46       CPDF_StreamAcc* src_stream,
47       CPDF_StreamAcc* global_stream,
48       uint8_t* dest_buf,
49       uint32_t dest_pitch,
50       IFX_Pause* pPause);
51   FXCODEC_STATUS ContinueDecode(CCodec_Jbig2Context* pJbig2Context,
52                                 IFX_Pause* pPause);
53 };
54 
55 #endif  // CORE_FXCODEC_CODEC_CCODEC_JBIG2MODULE_H_
56