Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
cfx_imagetransformer.h
Go to the documentation of this file.
1// Copyright 2017 The PDFium Authors
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6
7#ifndef CORE_FXGE_DIB_CFX_IMAGETRANSFORMER_H_
8#define CORE_FXGE_DIB_CFX_IMAGETRANSFORMER_H_
9
10#include <memory>
11
12#include "core/fxcrt/fx_coordinates.h"
13#include "core/fxcrt/retain_ptr.h"
14#include "core/fxcrt/unowned_ptr_exclusion.h"
15#include "core/fxge/dib/cfx_bitmapstorer.h"
16
17class CFX_DIBBase;
18class CFX_DIBitmap;
21
23 public:
34
35 struct CalcData {
36 UNOWNED_PTR_EXCLUSION CFX_DIBitmap* bitmap; // POD struct.
38 const uint8_t* buf;
39 uint32_t pitch;
40 };
41
43 const CFX_Matrix& matrix,
44 const FXDIB_ResampleOptions& options,
45 const FX_RECT* pClip);
47
48 bool Continue(PauseIndicatorIface* pPause);
49
50 const FX_RECT& result() const { return m_result; }
51 RetainPtr<CFX_DIBitmap> DetachBitmap();
52
53 private:
54 enum class StretchType {
55 kNone,
56 kNormal,
57 kRotate,
58 kOther,
59 };
60
61 void ContinueRotate(PauseIndicatorIface* pPause);
62 void ContinueOther(PauseIndicatorIface* pPause);
63
64 void CalcAlpha(const CalcData& calc_data);
65 void CalcMono(const CalcData& calc_data);
66 void CalcColor(const CalcData& calc_data,
67 FXDIB_Format format,
68 int src_bytes_per_pixel);
69
70 RetainPtr<const CFX_DIBBase> const m_pSrc;
71 const CFX_Matrix m_matrix;
72 FX_RECT m_StretchClip;
73 FX_RECT m_result;
74 CFX_Matrix m_dest2stretch;
75 std::unique_ptr<CFX_ImageStretcher> m_Stretcher;
76 CFX_BitmapStorer m_Storer;
77 const FXDIB_ResampleOptions m_ResampleOptions;
78 StretchType m_type = StretchType::kNone;
79};
80
81#endif // CORE_FXGE_DIB_CFX_IMAGETRANSFORMER_H_
bool Continue(PauseIndicatorIface *pPause)
CFX_AggImageRenderer(const RetainPtr< CFX_DIBitmap > &pDevice, const CFX_AggClipRgn *pClipRgn, RetainPtr< const CFX_DIBBase > source, float alpha, uint32_t mask_color, const CFX_Matrix &matrix, const FXDIB_ResampleOptions &options, bool bRgbByteOrder)
FX_RECT GetOuterRect() const
CFX_ImageTransformer(RetainPtr< const CFX_DIBBase > source, const CFX_Matrix &matrix, const FXDIB_ResampleOptions &options, const FX_RECT *pClip)
RetainPtr< CFX_DIBitmap > DetachBitmap()
bool Continue(PauseIndicatorIface *pPause)
const FX_RECT & result() const
CFX_FloatRect GetUnitRect() const
CFX_Matrix(const CFX_Matrix &other)=default
#define FXARGB_MUL_ALPHA(argb, alpha)
Definition fx_dib.h:200
FXDIB_Format
Definition fx_dib.h:21
int FXSYS_roundf(float f)
UNOWNED_PTR_EXCLUSION CFX_DIBitmap * bitmap
void Offset(int dx, int dy)
FX_RECT & operator=(const FX_RECT &that)=default
int Height() const
int Width() const
int32_t top
FX_RECT SwappedClipBox(int width, int height, bool bFlipX, bool bFlipY) const
int32_t left
void Intersect(const FX_RECT &src)
bool IsEmpty() const
#define UNOWNED_PTR_EXCLUSION