1 // Copyright 2018 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_MODULE_IFACE_H_ 8 #define CORE_FXCODEC_CODEC_MODULE_IFACE_H_ 9 10 #include "core/fxcrt/fx_system.h" 11 #include "core/fxcrt/retain_ptr.h" 12 13 class CFX_CodecMemory; 14 15 namespace fxcodec { 16 17 class CFX_DIBAttribute; 18 19 class ModuleIface { 20 public: 21 class Context { 22 public: 23 virtual ~Context() = default; 24 }; 25 26 virtual ~ModuleIface() = default; 27 28 // Returns the number of unprocessed bytes remaining in the input buffer. 29 virtual FX_FILESIZE GetAvailInput(Context* pContext) const = 0; 30 31 // Provides a new input buffer to the codec. Returns true on success, 32 // setting details about the image extracted from the buffer into |pAttribute| 33 // (if provided and the codec is capable providing that information). 34 virtual bool Input(Context* pContext, 35 RetainPtr<CFX_CodecMemory> codec_memory, 36 CFX_DIBAttribute* pAttribute) = 0; 37 }; 38 39 } // namespace fxcodec 40 41 using fxcodec::ModuleIface; 42 43 #endif // CORE_FXCODEC_CODEC_MODULE_IFACE_H_ 44