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_renderoptions.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_RENDEROPTIONS_H_
8#define CORE_FPDFAPI_RENDER_CPDF_RENDEROPTIONS_H_
9
10#include <stdint.h>
11
12#include "core/fpdfapi/page/cpdf_occontext.h"
13#include "core/fpdfapi/page/cpdf_pageobject.h"
14#include "core/fxcrt/retain_ptr.h"
15#include "core/fxge/dib/fx_dib.h"
16
17class CPDF_Dictionary;
18
20 public:
22
23 struct Options {
25 Options(const Options& rhs);
26 Options& operator=(const Options& rhs);
27
28 bool bClearType = false;
29 bool bNoNativeText = false;
30 bool bForceHalftone = false;
31 bool bRectAA = false;
32 bool bBreakForMasks = false;
33 bool bNoTextSmooth = false;
34 bool bNoPathSmooth = false;
35 bool bNoImageSmooth = false;
36 bool bLimitedImageCache = false;
38 };
39
46
50
51 FX_ARGB TranslateColor(FX_ARGB argb) const;
52 FX_ARGB TranslateObjectFillColor(FX_ARGB argb,
53 CPDF_PageObject::Type object_type) const;
54 FX_ARGB TranslateObjectStrokeColor(FX_ARGB argb,
55 CPDF_PageObject::Type object_type) const;
56
57 void SetColorScheme(const ColorScheme& color_scheme) {
58 m_ColorScheme = color_scheme;
59 }
60
61 void SetColorMode(Type mode) { m_ColorMode = mode; }
62 bool ColorModeIs(Type mode) const { return m_ColorMode == mode; }
63
64 const Options& GetOptions() const { return m_Options; }
65 Options& GetOptions() { return m_Options; }
66
67 uint32_t GetCacheSizeLimit() const;
68 bool CheckOCGDictVisible(const CPDF_Dictionary* pOC) const;
69 bool CheckPageObjectVisible(const CPDF_PageObject* pPageObj) const;
70
71 void SetDrawAnnots(bool draw) { m_bDrawAnnots = draw; }
72 bool GetDrawAnnots() const { return m_bDrawAnnots; }
73
74 void SetOCContext(RetainPtr<CPDF_OCContext> context) {
75 m_pOCContext = context;
76 }
77
78 private:
79 Type m_ColorMode = kNormal;
80 bool m_bDrawAnnots = false;
81 Options m_Options;
82 ColorScheme m_ColorScheme = {};
83 RetainPtr<CPDF_OCContext> m_pOCContext;
84};
85
86#endif // CORE_FPDFAPI_RENDER_CPDF_RENDEROPTIONS_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)
FX_ARGB TranslateColor(FX_ARGB argb) const
uint32_t GetCacheSizeLimit() const
const Options & GetOptions() const
bool CheckPageObjectVisible(const CPDF_PageObject *pPageObj) const
bool CheckOCGDictVisible(const CPDF_Dictionary *pOC) const
void SetColorScheme(const ColorScheme &color_scheme)
CPDF_RenderOptions(const CPDF_RenderOptions &rhs)
FX_ARGB TranslateObjectStrokeColor(FX_ARGB argb, CPDF_PageObject::Type object_type) const
void SetOCContext(RetainPtr< CPDF_OCContext > context)
bool ColorModeIs(Type mode) const
void SetDrawAnnots(bool draw)
FX_ARGB TranslateObjectFillColor(FX_ARGB argb, CPDF_PageObject::Type object_type) const
void SetColorMode(Type mode)
#define FXDC_RENDER_CAPS
#define FXDC_PIXEL_WIDTH
#define FXDC_VERT_SIZE
#define FXDC_PIXEL_HEIGHT
#define FXDC_HORZ_SIZE
#define FXRC_GET_BITS
Options(const Options &rhs)
Options & operator=(const Options &rhs)
FX_RECT(const FX_RECT &that)=default
int32_t top
int32_t left