5#ifndef CORE_FXCODEC_CFX_CODEC_MEMORY_H_
6#define CORE_FXCODEC_CFX_CODEC_MEMORY_H_
10#include "core/fxcrt/fx_memory_wrappers.h"
11#include "core/fxcrt/retain_ptr.h"
12#include "third_party/base/containers/span.h"
20 return GetBufferSpan().subspan(pos_);
23 pdfium::span<uint8_t>
GetBufferSpan() {
return {buffer_.get(), size_}; }
26 bool IsEOF()
const {
return pos_ >= size_; }
30 bool Seek(size_t pos);
39 explicit CFX_CodecMemory(size_t buffer_size);
bool TryResize(size_t new_buffer_size)
pdfium::span< uint8_t > GetBufferSpan()
~CFX_CodecMemory() override
size_t ReadBlock(pdfium::span< uint8_t > buffer)
pdfium::span< uint8_t > GetUnconsumedSpan()
size_t GetPosition() const
void Consume(size_t consumed)
virtual void BmpReadScanline(uint32_t row_num, pdfium::span< const uint8_t > row_buf)=0
virtual bool BmpInputImagePositionBuf(uint32_t rcd_pos)=0
static bool Input(ProgressiveDecoderIface::Context *pContext, RetainPtr< CFX_CodecMemory > codec_memory)
static Status ReadHeader(ProgressiveDecoderIface::Context *pContext, int32_t *width, int32_t *height, bool *tb_flag, int32_t *components, int32_t *pal_num, const std::vector< uint32_t > **palette, CFX_DIBAttribute *pAttribute)
BmpDecoder(const BmpDecoder &)=delete
static Status LoadImage(ProgressiveDecoderIface::Context *pContext)
static std::unique_ptr< ProgressiveDecoderIface::Context > StartDecode(Delegate *pDelegate)
static FX_FILESIZE GetAvailInput(ProgressiveDecoderIface::Context *pContext)
BmpDecoder & operator=(const BmpDecoder &)=delete
UnownedPtr< BmpDecoder::Delegate > const m_pDelegate
~CFX_BmpContext() override
CFX_BmpContext(BmpDecoder::Delegate *pDelegate)
CFX_BmpDecompressor m_Bmp
FX_FILESIZE GetAvailInput() const
BmpDecoder::Status DecodeImage()
CFX_BmpDecompressor(const CFX_BmpContext *context)
const std::vector< uint32_t > * palette() const
BmpDecoder::Status ReadHeader()
int32_t components() const
void SetInputBuffer(RetainPtr< CFX_CodecMemory > codec_memory)
virtual ~Context()=default
virtual FX_FILESIZE GetAvailInput(Context *pContext) const =0
virtual bool Input(Context *pContext, RetainPtr< CFX_CodecMemory > codec_memory)=0
virtual ~ProgressiveDecoderIface()=default
#define CONSTRUCT_VIA_MAKE_RETAIN