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_BMPMODULE_H_
8 #define CORE_FXCODEC_CODEC_CCODEC_BMPMODULE_H_
9 
10 #include "core/fxcodec/codec/icodec_bmpmodule.h"
11 #include "core/fxcrt/fx_system.h"
12 
13 class CCodec_BmpModule : public ICodec_BmpModule {
14  public:
15   CCodec_BmpModule();
16   ~CCodec_BmpModule() override;
17 
18   FXBMP_Context* Start() override;
19   void Finish(FXBMP_Context* pContext) override;
20   uint32_t GetAvailInput(FXBMP_Context* pContext,
21                          uint8_t** avail_buf_ptr) override;
22   void Input(FXBMP_Context* pContext,
23              const uint8_t* src_buf,
24              uint32_t src_size) override;
25   int32_t ReadHeader(FXBMP_Context* pContext,
26                      int32_t* width,
27                      int32_t* height,
28                      bool* tb_flag,
29                      int32_t* components,
30                      int32_t* pal_num,
31                      uint32_t** pal_pp,
32                      CFX_DIBAttribute* pAttribute) override;
33   int32_t LoadImage(FXBMP_Context* pContext) override;
34 
35  protected:
36   FX_CHAR m_szLastError[256];
37 };
38 
39 #endif  // CORE_FXCODEC_CODEC_CCODEC_BMPMODULE_H_
40