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.cpp
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#include "core/fpdfapi/render/cpdf_renderoptions.h"
8
9namespace {
10
11constexpr uint32_t kCacheSizeLimitBytes = 100 * 1024 * 1024;
12
13} // namespace
14
16
18 default;
19
21 const CPDF_RenderOptions::Options& rhs) = default;
22
24 // TODO(thestig): Make constexpr to initialize |m_Options| once C++14 is
25 // available.
26 m_Options.bClearType = true;
27}
28
30
32
35 return argb;
37 return argb;
38
39 const FX_BGRA_STRUCT<uint8_t> bgra = ArgbToBGRAStruct(argb);
40 const int gray = FXRGB2GRAY(bgra.red, bgra.green, bgra.blue);
41 return ArgbEncode(bgra.alpha, gray, gray, gray);
42}
43
45 FX_ARGB argb,
46 CPDF_PageObject::Type object_type) const {
48 return TranslateColor(argb);
49 }
50 switch (object_type) {
52 return m_ColorScheme.path_fill_color;
54 return m_ColorScheme.text_fill_color;
55 default:
56 return argb;
57 }
58}
59
61 FX_ARGB argb,
62 CPDF_PageObject::Type object_type) const {
64 return TranslateColor(argb);
65 }
66 switch (object_type) {
68 return m_ColorScheme.path_stroke_color;
70 return m_ColorScheme.text_stroke_color;
71 default:
72 return argb;
73 }
74}
75
77 return kCacheSizeLimitBytes;
78}
79
81 return !m_pOCContext || m_pOCContext->CheckOCGDictVisible(pOC);
82}
83
85 const CPDF_PageObject* pPageObj) const {
86 return !m_pOCContext || m_pOCContext->CheckPageObjectVisible(pPageObj);
87}
std::map< ByteString, RetainPtr< CPDF_Object >, std::less<> > DictMap
FX_ARGB TranslateColor(FX_ARGB argb) const
uint32_t GetCacheSizeLimit() const
bool CheckPageObjectVisible(const CPDF_PageObject *pPageObj) const
bool CheckOCGDictVisible(const CPDF_Dictionary *pOC) const
CPDF_RenderOptions(const CPDF_RenderOptions &rhs)
FX_ARGB TranslateObjectStrokeColor(FX_ARGB argb, CPDF_PageObject::Type object_type) const
bool ColorModeIs(Type mode) const
FX_ARGB TranslateObjectFillColor(FX_ARGB argb, CPDF_PageObject::Type object_type) const
uint32_t FX_ARGB
Definition fx_dib.h:36
#define FXRGB2GRAY(r, g, b)
Definition fx_dib.h:203
Options(const Options &rhs)
Options & operator=(const Options &rhs)