7#ifndef CORE_FXGE_DIB_CSTRETCHENGINE_H_
8#define CORE_FXGE_DIB_CSTRETCHENGINE_H_
12#include "core/fxcrt/data_vector.h"
13#include "core/fxcrt/fixed_size_data_vector.h"
14#include "core/fxcrt/fx_coordinates.h"
15#include "core/fxcrt/fx_system.h"
16#include "core/fxcrt/retain_ptr.h"
17#include "core/fxcrt/unowned_ptr.h"
18#include "core/fxge/dib/fx_dib.h"
19#include "third_party/base/check_op.h"
20#include "third_party/base/containers/span.h"
54 void SetStartEnd(
int src_start,
int src_end, size_t weight_count) {
55 CHECK_LT(src_end - src_start,
static_cast<
int>(weight_count));
105 size_t m_ItemSizeBytes = 0;
106 size_t m_WeightTablesSizeBytes = 0;
107 DataVector<uint8_t> m_WeightTables;
125 return m_ResampleOptions;
129 enum class State : uint8_t { kInitial, kHorizontal, kVertical };
131 enum class TransformMethod : uint8_t {
137 kManyBpptoManyBppWithAlpha
143 const bool m_bHasAlpha;
145 pdfium::span<
const uint32_t> m_pSrcPalette;
146 const int m_SrcWidth;
147 const int m_SrcHeight;
149 const int m_DestWidth;
150 const int m_DestHeight;
152 DataVector<uint8_t> m_DestScanline;
156 int m_ExtraMaskPitch;
158 TransformMethod m_TransMethod;
159 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 uint32_t FixedFromFloat(float f)
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
FXCODEC_IMAGE_TYPE GetType() const
FXCODEC_STATUS ContinueDecode()
void SetClipBox(FX_RECT *clip)
virtual ~ProgressiveDecoder()
int32_t GetHeight() const
std::pair< FXCODEC_STATUS, size_t > GetFrames()
int32_t GetBitsPerPixel() const
FXCODEC_STATUS LoadImageInfo(RetainPtr< IFX_SeekableReadStream > pFile, FXCODEC_IMAGE_TYPE imageType, CFX_DIBAttribute *pAttribute, bool bSkipImageTypeCheck)
FXCODEC_STATUS StartDecode(const RetainPtr< CFX_DIBitmap > &pDIBitmap, int start_x, int start_y, int size_x, int size_y)
#define FXRGB2GRAY(r, g, b)
int FXSYS_roundf(float f)
int FXSYS_round(double d)
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)
static size_t TotalBytesForWeightCount(size_t weight_count)
bool bInterpolateBilinear
FX_RECT & operator=(const FX_RECT &that)=default
constexpr FX_RECT()=default
constexpr FX_RECT(int l, int t, int r, int b)