#include "core/fxge/dib/cfx_imagetransformer.h"
#include <math.h>
#include <array>
#include <iterator>
#include <memory>
#include <utility>
#include "core/fxcrt/check.h"
#include "core/fxcrt/compiler_specific.h"
#include "core/fxcrt/fx_system.h"
#include "core/fxcrt/notreached.h"
#include "core/fxcrt/numerics/safe_conversions.h"
#include "core/fxcrt/stl_util.h"
#include "core/fxge/dib/cfx_dibitmap.h"
#include "core/fxge/dib/cfx_imagestretcher.h"
#include "core/fxge/dib/fx_dib.h"
namespace {
constexpr int kBase = …;
constexpr float kFix16 = …;
constexpr uint8_t kOpaqueAlpha = …;
uint8_t BilinearInterpolate(const uint8_t* buf,
const CFX_ImageTransformer::BilinearData& data,
int bytes_per_pixel,
int c_offset) { … }
class CFX_BilinearMatrix { … };
bool InStretchBounds(const FX_RECT& clip_rect, int col, int row) { … }
void AdjustCoords(const FX_RECT& clip_rect, int* col, int* row) { … }
template <typename F>
void DoBilinearLoop(const CFX_ImageTransformer::CalcData& calc_data,
const FX_RECT& result_rect,
const FX_RECT& clip_rect,
int increment,
const F& func) { … }
}
CFX_ImageTransformer::CFX_ImageTransformer(RetainPtr<const CFX_DIBBase> source,
const CFX_Matrix& matrix,
const FXDIB_ResampleOptions& options,
const FX_RECT* pClip)
: … { … }
CFX_ImageTransformer::~CFX_ImageTransformer() = default;
bool CFX_ImageTransformer::Continue(PauseIndicatorIface* pPause) { … }
void CFX_ImageTransformer::ContinueRotate(PauseIndicatorIface* pPause) { … }
void CFX_ImageTransformer::ContinueOther(PauseIndicatorIface* pPause) { … }
RetainPtr<CFX_DIBitmap> CFX_ImageTransformer::DetachBitmap() { … }
void CFX_ImageTransformer::CalcAlpha(const CalcData& calc_data) { … }
void CFX_ImageTransformer::CalcMono(const CalcData& calc_data) { … }
void CFX_ImageTransformer::CalcColor(const CalcData& calc_data,
FXDIB_Format dest_format,
int src_bytes_per_pixel) { … }