7#ifndef CORE_FXGE_DIB_CSTRETCHENGINE_H_
8#define CORE_FXGE_DIB_CSTRETCHENGINE_H_
12#include "core/fxcrt/check_op.h"
13#include "core/fxcrt/data_vector.h"
14#include "core/fxcrt/fixed_size_data_vector.h"
15#include "core/fxcrt/fx_coordinates.h"
16#include "core/fxcrt/fx_system.h"
17#include "core/fxcrt/raw_span.h"
18#include "core/fxcrt/retain_ptr.h"
19#include "core/fxcrt/unowned_ptr.h"
20#include "core/fxge/dib/fx_dib.h"
48 void SetStartEnd(
int src_start,
int src_end, size_t weight_count) {
49 CHECK_LT(src_end - src_start,
static_cast<
int>(weight_count));
102 size_t m_ItemSizeBytes = 0;
103 size_t m_WeightTablesSizeBytes = 0;
104 DataVector<uint8_t> m_WeightTables;
122 return m_ResampleOptions;
126 enum class State : uint8_t { kInitial, kHorizontal, kVertical };
128 enum class TransformMethod : uint8_t {
134 kManyBpptoManyBppWithAlpha
140 const bool m_bHasAlpha;
142 pdfium::raw_span<
const uint32_t> m_pSrcPalette;
143 const int m_SrcWidth;
144 const int m_SrcHeight;
146 const int m_DestWidth;
147 const int m_DestHeight;
149 DataVector<uint8_t> m_DestScanline;
150 FixedSizeDataVector<uint8_t> m_InterBuf;
153 int m_ExtraMaskPitch;
155 TransformMethod m_TransMethod;
156 State m_State = State::kInitial;
PixelWeight * GetPixelWeight(int pixel)
const PixelWeight * GetPixelWeight(int pixel) const
bool CalculateWeights(int dest_len, int dest_min, int dest_max, int src_len, int src_min, int src_max, const FXDIB_ResampleOptions &options)
bool Continue(PauseIndicatorIface *pPause)
bool ContinueStretchHorz(PauseIndicatorIface *pPause)
static bool UseInterpolateBilinear(const FXDIB_ResampleOptions &options, int dest_width, int dest_height, int src_width, int src_height)
static uint32_t FixedFromDouble(double d)
static uint8_t PixelFromFixed(uint32_t fixed)
CStretchEngine(ScanlineComposerIface *pDestBitmap, FXDIB_Format dest_format, int dest_width, int dest_height, const FX_RECT &clip_rect, const RetainPtr< const CFX_DIBBase > &pSrcBitmap, const FXDIB_ResampleOptions &options)
static constexpr uint32_t kFixedPointOne
const FXDIB_ResampleOptions & GetResampleOptionsForTest() const
static constexpr uint32_t kFixedPointBits
virtual FX_FILESIZE GetAvailInput(Context *pContext) const =0
FXCODEC_STATUS ContinueDecode()
FXCODEC_STATUS StartDecode(RetainPtr< CFX_DIBitmap > bitmap)
FXDIB_Format GetBitmapFormat() const
virtual ~ProgressiveDecoder()
int32_t GetHeight() const
std::pair< FXCODEC_STATUS, size_t > GetFrames()
FXCODEC_STATUS LoadImageInfo(RetainPtr< IFX_SeekableReadStream > pFile, FXCODEC_IMAGE_TYPE imageType, CFX_DIBAttribute *pAttribute, bool bSkipImageTypeCheck)
#define UNSAFE_BUFFERS(...)
UNSAFE_BUFFER_USAGE void * FXSYS_memset(void *ptr1, int val, size_t len)
int FXSYS_round(double d)
#define NOTREACHED_NORETURN()
fxcodec::ProgressiveDecoder ProgressiveDecoder
void RemoveLastWeightAndAdjust(uint32_t weight_change)
uint32_t GetWeightForPosition(int position) const
void SetStartEnd(int src_start, int src_end, size_t weight_count)
void SetWeightForPosition(int position, uint32_t weight)
bool bInterpolateBilinear