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_agg_bitmapcomposer.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_AGG_CFX_AGG_BITMAPCOMPOSER_H_
8#define CORE_FXGE_AGG_CFX_AGG_BITMAPCOMPOSER_H_
9
10#include <stdint.h>
11
12#include "core/fxcrt/data_vector.h"
13#include "core/fxcrt/retain_ptr.h"
14#include "core/fxcrt/unowned_ptr.h"
15#include "core/fxge/dib/cfx_scanlinecompositor.h"
16#include "core/fxge/dib/fx_dib.h"
17#include "core/fxge/dib/scanlinecomposer_iface.h"
18
19class CFX_AggClipRgn;
20class CFX_DIBitmap;
21struct FX_RECT;
22
23class CFX_AggBitmapComposer final : public ScanlineComposerIface {
24 public:
27
28 void Compose(const RetainPtr<CFX_DIBitmap>& pDest,
29 const CFX_AggClipRgn* pClipRgn,
30 float alpha,
31 uint32_t mask_color,
32 const FX_RECT& dest_rect,
33 bool bVertical,
34 bool bFlipX,
35 bool bFlipY,
36 bool bRgbByteOrder,
37 BlendMode blend_mode);
38
39 // ScanlineComposerIface:
40 bool SetInfo(int width,
41 int height,
42 FXDIB_Format src_format,
43 DataVector<uint32_t> src_palette) override;
44 void ComposeScanline(int line, pdfium::span<const uint8_t> scanline) override;
45
46 private:
47 void DoCompose(pdfium::span<uint8_t> dest_scan,
48 pdfium::span<const uint8_t> src_scan,
49 int dest_width,
50 pdfium::span<const uint8_t> clip_scan);
51 void ComposeScanlineV(int line, pdfium::span<const uint8_t> scanline);
52
53 RetainPtr<CFX_DIBitmap> m_pBitmap;
54 UnownedPtr<const CFX_AggClipRgn> m_pClipRgn;
55 FXDIB_Format m_SrcFormat;
56 int m_DestLeft;
57 int m_DestTop;
58 int m_DestWidth;
59 int m_DestHeight;
60 float m_Alpha;
61 uint32_t m_MaskColor;
62 RetainPtr<CFX_DIBitmap> m_pClipMask;
63 CFX_ScanlineCompositor m_Compositor;
64 bool m_bVertical;
65 bool m_bFlipX;
66 bool m_bFlipY;
67 bool m_bRgbByteOrder = false;
68 BlendMode m_BlendMode = BlendMode::kNormal;
69 DataVector<uint8_t> m_pScanlineV;
70 DataVector<uint8_t> m_pClipScanV;
71 DataVector<uint8_t> m_pAddClipScan;
72};
73
74#endif // CORE_FXGE_AGG_CFX_AGG_BITMAPCOMPOSER_H_
#define DCHECK
Definition check.h:33
#define CHECK_EQ(x, y)
Definition check_op.h:10
void ComposeScanline(int line, pdfium::span< const uint8_t > scanline) override
bool SetInfo(int width, int height, FXDIB_Format src_format, DataVector< uint32_t > src_palette) override
~CFX_AggBitmapComposer() override
void Compose(const RetainPtr< CFX_DIBitmap > &pDest, const CFX_AggClipRgn *pClipRgn, float alpha, uint32_t mask_color, const FX_RECT &dest_rect, bool bVertical, bool bFlipX, bool bFlipY, bool bRgbByteOrder, BlendMode blend_mode)
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)
bool Attach(RetainPtr< CFX_DIBitmap > pBitmap)
bool Create(int width, int height, FXDIB_Format format)
FX_RECT GetOuterRect() const
CFX_Matrix & operator=(const CFX_Matrix &other)=default
void Translate(int32_t x, int32_t y)
CFX_FloatRect GetUnitRect() const
void Transform(const CFX_Matrix &matrix)
Definition cfx_path.cpp:393
void AppendRect(float left, float bottom, float right, float top)
Definition cfx_path.cpp:310
bool IsPattern() const
std::map< ByteString, RetainPtr< CPDF_Object >, std::less<> > DictMap
static CPDF_DocPageData * FromDocument(const CPDF_Document *pDoc)
float GetStrokeAlpha() const
BlendMode GetBlendType() const
CPDF_ImageRenderer(CPDF_RenderStatus *pStatus)
bool Start(RetainPtr< CFX_DIBBase > pDIBBase, FX_ARGB bitmap_argb, const CFX_Matrix &mtImage2Device, const FXDIB_ResampleOptions &options, bool bStdCS)
bool Start(CPDF_ImageObject *pImageObject, const CFX_Matrix &mtObj2Device, bool bStdCS)
bool Continue(PauseIndicatorIface *pPause)
CPDF_Document * GetDocument() const override
Definition cpdf_page.cpp:51
const CFX_Matrix & GetMatrix() const
Layer(const Layer &that)
CPDF_PageObjectHolder * GetObjectHolder()
Layer(CPDF_PageObjectHolder *pHolder, const CFX_Matrix &matrix)
void AppendLayer(CPDF_PageObjectHolder *pObjectHolder, const CFX_Matrix &mtObject2Device)
CPDF_PageImageCache * GetPageCache() const
const CPDF_Dictionary * GetPageResources() const
CPDF_RenderContext(CPDF_Document *pDoc, RetainPtr< CPDF_Dictionary > pPageResources, CPDF_PageImageCache *pPageCache)
void GetBackgroundToDevice(CFX_RenderDevice *device, const CPDF_PageObject *object, const CPDF_RenderOptions *options, const CFX_Matrix &matrix)
CPDF_Document * GetDocument() const
Layer * GetLayer(uint32_t index)
RetainPtr< CPDF_Dictionary > GetMutablePageResources()
size_t CountLayers() const
void Render(CFX_RenderDevice *pDevice, const CPDF_PageObject *pStopObj, const CPDF_RenderOptions *pOptions, const CFX_Matrix *pLastMatrix)
const Options & GetOptions() const
bool CheckOCGDictVisible(const CPDF_Dictionary *pOC) const
bool ColorModeIs(Type mode) const
bool GetLoadMask() const
void SetDropObjects(bool bDropObjects)
const CPDF_RenderOptions & GetRenderOptions() const
void SetType3Char(CPDF_Type3Char *pType3Char)
RetainPtr< CPDF_TransferFunc > GetTransferFunc(RetainPtr< const CPDF_Object > pObject) const
void SetDeviceMatrix(const CFX_Matrix &matrix)
CPDF_RenderStatus(CPDF_RenderContext *pContext, CFX_RenderDevice *pDevice)
void SetFillColor(FX_ARGB color)
CPDF_RenderContext * GetContext() const
void SetOptions(const CPDF_RenderOptions &options)
void RenderSingleObject(CPDF_PageObject *pObj, const CFX_Matrix &mtObj2Device)
const CPDF_Dictionary * GetPageResource() const
bool ContinueSingleObject(CPDF_PageObject *pObj, const CFX_Matrix &mtObj2Device, PauseIndicatorIface *pPause)
CPDF_ColorSpace::Family GetGroupFamily() const
void SetTransparency(const CPDF_Transparency &transparency)
void RenderObjectList(const CPDF_PageObjectHolder *pObjectHolder, const CFX_Matrix &mtObj2Device)
void SetStdCS(bool bStdCS)
FX_ARGB GetFillArgbForType3(CPDF_PageObject *pObj) const
CFX_RenderDevice * GetRenderDevice() const
void SetGroupFamily(CPDF_ColorSpace::Family family)
void DrawShadingPattern(CPDF_ShadingPattern *pattern, const CPDF_PageObject *pPageObj, const CFX_Matrix &mtObj2Device, bool stroke)
void Initialize(const CPDF_RenderStatus *pParentStatus, const CPDF_GraphicStates *pInitialStates)
void DrawTilingPattern(CPDF_TilingPattern *pattern, CPDF_PageObject *pPageObj, const CFX_Matrix &mtObj2Device, bool stroke)
void SetInGroup(bool bInGroup)
static std::unique_ptr< CPDF_GraphicStates > CloneObjStates(const CPDF_GraphicStates *pSrcStates, bool stroke)
void SetFormResource(RetainPtr< const CPDF_Dictionary > pRes)
FX_ARGB GetFillArgb(CPDF_PageObject *pObj) const
void CompositeDIBitmap(RetainPtr< CFX_DIBitmap > bitmap, int left, int top, FX_ARGB mask_argb, float alpha, BlendMode blend_mode, const CPDF_Transparency &transparency)
void SetLoadMask(bool bLoadMask)
bool GetDropObjects() const
const CPDF_Dictionary * GetFormResource() const
void SetStopObject(const CPDF_PageObject *pStopObj)
void ProcessClipPath(const CPDF_ClipPath &ClipPath, const CFX_Matrix &mtObj2Device)
CPDF_Transparency & operator=(const CPDF_Transparency &other)
uint32_t FX_ARGB
Definition fx_dib.h:36
BlendMode
Definition fx_dib.h:119
@ kNormal
Definition fx_dib.h:120
@ kDarken
Definition fx_dib.h:124
#define FXARGB_B(argb)
Definition fx_dib.h:199
#define FXARGB_G(argb)
Definition fx_dib.h:198
constexpr FX_ARGB ArgbEncode(uint32_t a, uint32_t r, uint32_t g, uint32_t b)
Definition fx_dib.h:188
#define FXARGB_R(argb)
Definition fx_dib.h:197
FXDIB_Format
Definition fx_dib.h:21
pdfium::CheckedNumeric< int32_t > FX_SAFE_INT32
int FXSYS_roundf(float f)
#define CHECK(cvref)
int Height() const
int32_t bottom
bool Valid() const
int32_t right
int Width() const
int32_t top
int32_t left
bool IsEmpty() const