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_TIFF_TIFFMODULE_H_
8 #define CORE_FXCODEC_TIFF_TIFFMODULE_H_
9 
10 #include <memory>
11 
12 #include "core/fxcodec/codec_module_iface.h"
13 
14 class CFX_DIBitmap;
15 class IFX_SeekableReadStream;
16 
17 namespace fxcodec {
18 
19 class CFX_DIBAttribute;
20 
21 class TiffModule final : public ModuleIface {
22  public:
23   std::unique_ptr<Context> CreateDecoder(
24       const RetainPtr<IFX_SeekableReadStream>& file_ptr);
25 
26   // ModuleIface:
27   FX_FILESIZE GetAvailInput(Context* pContext) const override;
28   bool Input(Context* pContext,
29              RetainPtr<CFX_CodecMemory> codec_memory,
30              CFX_DIBAttribute* pAttribute) override;
31 
32   bool LoadFrameInfo(Context* ctx,
33                      int32_t frame,
34                      int32_t* width,
35                      int32_t* height,
36                      int32_t* comps,
37                      int32_t* bpc,
38                      CFX_DIBAttribute* pAttribute);
39   bool Decode(Context* ctx, const RetainPtr<CFX_DIBitmap>& pDIBitmap);
40 };
41 
42 }  // namespace fxcodec
43 
44 using TiffModule = fxcodec::TiffModule;
45 
46 #endif  // CORE_FXCODEC_TIFF_TIFFMODULE_H_
47