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 "core/fxcrt/fx_coordinates.h"
13#include "core/fxcrt/retain_ptr.h"
14#include "core/fxcrt/unowned_ptr.h"
15
16class CFX_DIBitmap;
17class CFX_Matrix;
19class CPDF_Dictionary;
20class CPDF_Document;
22class CPDF_PageObject;
25
27 public:
28 class Layer {
29 public:
30 Layer(CPDF_PageObjectHolder* pHolder, const CFX_Matrix& matrix);
31 Layer(const Layer& that);
33
34 CPDF_PageObjectHolder* GetObjectHolder() { return m_pObjectHolder; }
35 const CFX_Matrix& GetMatrix() const { return m_Matrix; }
36
37 private:
38 UnownedPtr<CPDF_PageObjectHolder> const m_pObjectHolder;
39 const CFX_Matrix m_Matrix;
40 };
41
43 RetainPtr<CPDF_Dictionary> pPageResources,
44 CPDF_PageImageCache* pPageCache);
46
47 void AppendLayer(CPDF_PageObjectHolder* pObjectHolder,
48 const CFX_Matrix& mtObject2Device);
49
50 void Render(CFX_RenderDevice* pDevice,
51 const CPDF_PageObject* pStopObj,
52 const CPDF_RenderOptions* pOptions,
53 const CFX_Matrix* pLastMatrix);
54
56 const CPDF_PageObject* object,
57 const CPDF_RenderOptions* options,
58 const CFX_Matrix& matrix);
59 void GetBackgroundToBitmap(RetainPtr<CFX_DIBitmap> bitmap,
60 const CPDF_PageObject* object,
61 const CFX_Matrix& matrix);
62
63 size_t CountLayers() const { return m_Layers.size(); }
64 Layer* GetLayer(uint32_t index) { return &m_Layers[index]; }
65
66 CPDF_Document* GetDocument() const { return m_pDocument; }
67 const CPDF_Dictionary* GetPageResources() const {
68 return m_pPageResources.Get();
69 }
71 return m_pPageResources;
72 }
73 CPDF_PageImageCache* GetPageCache() const { return m_pPageCache; }
74
75 private:
76 UnownedPtr<CPDF_Document> const m_pDocument;
77 RetainPtr<CPDF_Dictionary> const m_pPageResources;
78 UnownedPtr<CPDF_PageImageCache> const m_pPageCache;
79 std::vector<Layer> m_Layers;
80};
81
82#endif // CORE_FPDFAPI_RENDER_CPDF_RENDERCONTEXT_H_
CFX_FloatRect(const FX_RECT &rect)
FX_RECT GetOuterRect() const
CFX_FloatRect TransformRect(const CFX_FloatRect &rect) const
void Translate(int32_t x, int32_t y)
void Scale(float sx, float sy)
int GetDeviceCaps(int id) const
CPDF_DeviceBuffer(CPDF_RenderContext *pContext, CFX_RenderDevice *pDevice, const FX_RECT &rect, const CPDF_PageObject *pObj, int max_dpi)
const CFX_Matrix & GetMatrix() const
static CFX_Matrix CalculateMatrix(CFX_RenderDevice *pDevice, const FX_RECT &rect, int max_dpi, bool scale)
RetainPtr< CFX_DIBitmap > Initialize()
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 GetBackgroundToBitmap(RetainPtr< CFX_DIBitmap > bitmap, const CPDF_PageObject *object, const CFX_Matrix &matrix)
void Render(CFX_RenderDevice *pDevice, const CPDF_PageObject *pStopObj, const CPDF_RenderOptions *pOptions, const CFX_Matrix *pLastMatrix)
#define FXDC_RENDER_CAPS
#define FXDC_PIXEL_WIDTH
#define FXDC_VERT_SIZE
#define FXDC_PIXEL_HEIGHT
#define FXDC_HORZ_SIZE
#define FXRC_GET_BITS
FX_RECT(const FX_RECT &that)=default
int32_t top
int32_t left