blob: 2ab902bc7a3fea1c493b42d0ff297932c8bc37ba [file] [log] [blame]
// Copyright 2018 PDFium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
#ifndef CORE_FXCODEC_PROGRESSIVE_DECODER_IFACE_H_
#define CORE_FXCODEC_PROGRESSIVE_DECODER_IFACE_H_
#include "core/fxcrt/fx_system.h"
#include "core/fxcrt/retain_ptr.h"
#ifndef PDF_ENABLE_XFA
#error "XFA Only"
#endif
class CFX_CodecMemory;
namespace fxcodec {
class CFX_DIBAttribute;
class ProgressiveDecoderIface {
public:
class Context {
public:
virtual ~Context() = default;
};
virtual ~ProgressiveDecoderIface() = default;
// Returns the number of unprocessed bytes remaining in the input buffer.
virtual FX_FILESIZE GetAvailInput(Context* pContext) const = 0;
// Provides a new input buffer to the codec. Returns true on success,
// setting details about the image extracted from the buffer into |pAttribute|
// (if provided and the codec is capable providing that information).
virtual bool Input(Context* pContext,
RetainPtr<CFX_CodecMemory> codec_memory,
CFX_DIBAttribute* pAttribute) = 0;
};
} // namespace fxcodec
using fxcodec::ProgressiveDecoderIface;
#endif // CORE_FXCODEC_PROGRESSIVE_DECODER_IFACE_H_