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_pathobject.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/page/cpdf_pathobject.h"
8
9
CPDF_PathObject::
CPDF_PathObject
(int32_t content_stream)
10
:
CPDF_PageObject
(
content_stream
)
{}
11
12
CPDF_PathObject::
CPDF_PathObject
() : CPDF_PathObject
(
kNoContentStream
)
{}
13
14
CPDF_PathObject::~
CPDF_PathObject
() =
default
;
15
16
CPDF_PageObject
::
Type
CPDF_PathObject::
GetType
()
const
{
17
return
Type
::
kPath
;
18
}
19
20
void
CPDF_PathObject::
Transform
(
const
CFX_Matrix
& matrix) {
21
m_Matrix
.
Concat
(
matrix
)
;
22
CalcBoundingBox
(
)
;
23
SetDirty
(
true
);
24
}
25
26
bool
CPDF_PathObject::
IsPath
()
const
{
27
return
true
;
28
}
29
30
CPDF_PathObject* CPDF_PathObject::
AsPath
() {
31
return
this
;
32
}
33
34
const
CPDF_PathObject* CPDF_PathObject::
AsPath
()
const
{
35
return
this
;
36
}
37
38
void
CPDF_PathObject::
CalcBoundingBox
() {
39
if
(!m_Path.HasRef())
40
return
;
41
CFX_FloatRect
rect;
42
float
width =
graph_state
().GetLineWidth();
43
if
(m_bStroke && width != 0) {
44
rect = m_Path.GetBoundingBoxForStrokePath(width,
45
graph_state().GetMiterLimit());
46
}
else
{
47
rect = m_Path.GetBoundingBox();
48
}
49
rect
=
m_Matrix
.
TransformRect
(
rect
)
;
50
51
if
(width == 0 && m_bStroke)
52
rect
.
Inflate
(
0.5f
,
0.5f
)
;
53
SetRect
(rect);
54
}
55
56
void
CPDF_PathObject::
SetPathMatrix
(
const
CFX_Matrix
& matrix) {
57
m_Matrix
=
matrix;
58
CalcBoundingBox
(
)
;
59
}
CFX_FloatRect
Definition
fx_coordinates.h:189
CFX_FloatRect::Inflate
void Inflate(float x, float y)
Definition
fx_coordinates.cpp:248
CFX_FloatRect::operator=
CFX_FloatRect & operator=(const CFX_FloatRect &that)=default
CFX_Matrix
Definition
fx_coordinates.h:452
CFX_Matrix::operator=
CFX_Matrix & operator=(const CFX_Matrix &other)=default
CFX_Matrix::TransformRect
CFX_FloatRect TransformRect(const CFX_FloatRect &rect) const
Definition
fx_coordinates.cpp:492
CFX_Matrix::Concat
void Concat(const CFX_Matrix &right)
Definition
fx_coordinates.h:490
CPDF_PageObject
Definition
cpdf_pageobject.h:27
CPDF_PageObject::SetRect
void SetRect(const CFX_FloatRect &rect)
Definition
cpdf_pageobject.h:70
CPDF_PageObject::SetDirty
void SetDirty(bool value)
Definition
cpdf_pageobject.h:63
CPDF_PageObject::CPDF_PageObject
CPDF_PageObject(int32_t content_stream)
Definition
cpdf_pageobject.cpp:13
CPDF_PageObject::Type
Type
Definition
cpdf_pageobject.h:30
CPDF_PageObject::Type::kPath
@ kPath
CPDF_PageObject::kNoContentStream
static constexpr int32_t kNoContentStream
Definition
cpdf_pageobject.h:38
CPDF_PageObject::graph_state
const CFX_GraphState & graph_state() const
Definition
cpdf_pageobject.h:105
CPDF_PathObject::IsPath
bool IsPath() const override
Definition
cpdf_pathobject.cpp:26
CPDF_PathObject::~CPDF_PathObject
~CPDF_PathObject() override
CPDF_PathObject::AsPath
CPDF_PathObject * AsPath() override
Definition
cpdf_pathobject.cpp:30
CPDF_PathObject::CPDF_PathObject
CPDF_PathObject()
Definition
cpdf_pathobject.cpp:12
CPDF_PathObject::SetPathMatrix
void SetPathMatrix(const CFX_Matrix &matrix)
Definition
cpdf_pathobject.cpp:56
CPDF_PathObject::Transform
void Transform(const CFX_Matrix &matrix) override
Definition
cpdf_pathobject.cpp:20
CPDF_PathObject::AsPath
const CPDF_PathObject * AsPath() const override
Definition
cpdf_pathobject.cpp:34
CPDF_PathObject::GetType
Type GetType() const override
Definition
cpdf_pathobject.cpp:16
CPDF_PathObject::CPDF_PathObject
CPDF_PathObject(int32_t content_stream)
Definition
cpdf_pathobject.cpp:9
CPDF_PathObject::CalcBoundingBox
void CalcBoundingBox()
Definition
cpdf_pathobject.cpp:38
qtwebengine
src
3rdparty
chromium
third_party
pdfium
core
fpdfapi
page
cpdf_pathobject.cpp
Generated on Thu Nov 14 2024 00:55:51 for Qt by
1.12.0