blob: c61a7c333db520828d849b2df693de06cd1a26cd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
|
// Copyright 2016 PDFium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
#include "core/fpdfapi/page/cpdf_pageobject.h"
constexpr int32_t CPDF_PageObject::kNoContentStream;
CPDF_PageObject::CPDF_PageObject(int32_t content_stream)
: m_ContentStream(content_stream) {}
CPDF_PageObject::CPDF_PageObject() : CPDF_PageObject(kNoContentStream) {}
CPDF_PageObject::~CPDF_PageObject() = default;
bool CPDF_PageObject::IsText() const {
return false;
}
bool CPDF_PageObject::IsPath() const {
return false;
}
bool CPDF_PageObject::IsImage() const {
return false;
}
bool CPDF_PageObject::IsShading() const {
return false;
}
bool CPDF_PageObject::IsForm() const {
return false;
}
CPDF_TextObject* CPDF_PageObject::AsText() {
return nullptr;
}
const CPDF_TextObject* CPDF_PageObject::AsText() const {
return nullptr;
}
CPDF_PathObject* CPDF_PageObject::AsPath() {
return nullptr;
}
const CPDF_PathObject* CPDF_PageObject::AsPath() const {
return nullptr;
}
CPDF_ImageObject* CPDF_PageObject::AsImage() {
return nullptr;
}
const CPDF_ImageObject* CPDF_PageObject::AsImage() const {
return nullptr;
}
CPDF_ShadingObject* CPDF_PageObject::AsShading() {
return nullptr;
}
const CPDF_ShadingObject* CPDF_PageObject::AsShading() const {
return nullptr;
}
CPDF_FormObject* CPDF_PageObject::AsForm() {
return nullptr;
}
const CPDF_FormObject* CPDF_PageObject::AsForm() const {
return nullptr;
}
void CPDF_PageObject::CopyData(const CPDF_PageObject* pSrc) {
CopyStates(*pSrc);
m_Rect = pSrc->m_Rect;
m_bDirty = true;
}
void CPDF_PageObject::TransformClipPath(const CFX_Matrix& matrix) {
if (!m_ClipPath.HasRef())
return;
m_ClipPath.Transform(matrix);
SetDirty(true);
}
void CPDF_PageObject::TransformGeneralState(const CFX_Matrix& matrix) {
if (!m_GeneralState.HasRef())
return;
m_GeneralState.GetMutableMatrix()->Concat(matrix);
SetDirty(true);
}
FX_RECT CPDF_PageObject::GetBBox() const {
return GetRect().GetOuterRect();
}
FX_RECT CPDF_PageObject::GetTransformedBBox(const CFX_Matrix& matrix) const {
return matrix.TransformRect(GetRect()).GetOuterRect();
}
|