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
cpdf_rendercontext.h
Go to the documentation of this file.
1// Copyright 2016 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_FPDFAPI_RENDER_CPDF_RENDERCONTEXT_H_
8#define CORE_FPDFAPI_RENDER_CPDF_RENDERCONTEXT_H_
9
10#include <vector>
11
12#include "build/build_config.h"
13#include "core/fxcrt/fx_coordinates.h"
14#include "core/fxcrt/retain_ptr.h"
15#include "core/fxcrt/unowned_ptr.h"
16
17class CFX_DIBitmap;
18class CFX_Matrix;
20class CPDF_Dictionary;
21class CPDF_Document;
23class CPDF_PageObject;
26
28 public:
29 class Layer {
30 public:
31 Layer(CPDF_PageObjectHolder* pHolder, const CFX_Matrix& matrix);
32 Layer(const Layer& that);
34
35 CPDF_PageObjectHolder* GetObjectHolder() { return m_pObjectHolder; }
36 const CFX_Matrix& GetMatrix() const { return m_Matrix; }
37
38 private:
39 UnownedPtr<CPDF_PageObjectHolder> const m_pObjectHolder;
40 const CFX_Matrix m_Matrix;
41 };
42
44 RetainPtr<CPDF_Dictionary> pPageResources,
45 CPDF_PageImageCache* pPageCache);
47
48 void AppendLayer(CPDF_PageObjectHolder* pObjectHolder,
49 const CFX_Matrix& mtObject2Device);
50
51 void Render(CFX_RenderDevice* pDevice,
52 const CPDF_PageObject* pStopObj,
53 const CPDF_RenderOptions* pOptions,
54 const CFX_Matrix* pLastMatrix);
55
57 const CPDF_PageObject* object,
58 const CPDF_RenderOptions* options,
59 const CFX_Matrix& matrix);
60#if BUILDFLAG(IS_WIN)
63 const CFX_Matrix& matrix);
64#endif
65
66 size_t CountLayers() const { return m_Layers.size(); }
67 Layer* GetLayer(uint32_t index) { return &m_Layers[index]; }
68
69 CPDF_Document* GetDocument() const { return m_pDocument; }
71 return m_pPageResources.Get();
72 }
74 return m_pPageResources;
75 }
76 CPDF_PageImageCache* GetPageCache() const { return m_pPageCache; }
77
78 private:
79 UnownedPtr<CPDF_Document> const m_pDocument;
80 RetainPtr<CPDF_Dictionary> const m_pPageResources;
81 UnownedPtr<CPDF_PageImageCache> const m_pPageCache;
82 std::vector<Layer> m_Layers;
83};
84
85#endif // CORE_FPDFAPI_RENDER_CPDF_RENDERCONTEXT_H_
#define DCHECK
Definition check.h:33
#define CHECK_EQ(x, y)
Definition check_op.h:10
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
void SetOptions(const CPDF_RenderOptions &options)
void SetStdCS(bool bStdCS)
void Initialize(const CPDF_RenderStatus *pParentStatus, const CPDF_GraphicStates *pInitialStates)
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