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_path.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_path.h"
8
9CPDF_Path::CPDF_Path() = default;
10
11CPDF_Path::CPDF_Path(const CPDF_Path& that) = default;
12
13CPDF_Path::~CPDF_Path() = default;
14
16 return m_Ref.GetObject()->GetPoints();
17}
18
20 m_Ref.GetPrivateCopy()->ClosePath();
21}
22
23CFX_PointF CPDF_Path::GetPoint(int index) const {
24 return m_Ref.GetObject()->GetPoint(index);
25}
26
28 return m_Ref.GetObject()->GetBoundingBox();
29}
30
32 float miter_limit) const {
33 return m_Ref.GetObject()->GetBoundingBoxForStrokePath(line_width,
34 miter_limit);
35}
36
37bool CPDF_Path::IsRect() const {
38 return m_Ref.GetObject()->IsRect();
39}
40
41void CPDF_Path::Transform(const CFX_Matrix& matrix) {
42 m_Ref.GetPrivateCopy()->Transform(matrix);
43}
44
45void CPDF_Path::Append(const CFX_Path& path, const CFX_Matrix* pMatrix) {
46 m_Ref.GetPrivateCopy()->Append(path, pMatrix);
47}
48
50 m_Ref.GetPrivateCopy()->AppendFloatRect(rect);
51}
52
53void CPDF_Path::AppendRect(float left, float bottom, float right, float top) {
54 m_Ref.GetPrivateCopy()->AppendRect(left, bottom, right, top);
55}
56
57void CPDF_Path::AppendPoint(const CFX_PointF& point,
58 CFX_Path::Point::Type type) {
59 CFX_Path data;
60 data.AppendPoint(point, type);
61 Append(data, nullptr);
62}
63
64void CPDF_Path::AppendPointAndClose(const CFX_PointF& point,
65 CFX_Path::Point::Type type) {
66 CFX_Path data;
67 data.AppendPointAndClose(point, type);
68 Append(data, nullptr);
69}
void AppendPointAndClose(const CFX_PointF &point, Point::Type type)
Definition cfx_path.cpp:293
void AppendPoint(const CFX_PointF &point, Point::Type type)
Definition cfx_path.cpp:289
void AppendRect(float left, float bottom, float right, float top)
Definition cpdf_path.cpp:53
void Append(const CFX_Path &path, const CFX_Matrix *pMatrix)
Definition cpdf_path.cpp:45
void AppendPoint(const CFX_PointF &point, CFX_Path::Point::Type type)
Definition cpdf_path.cpp:57
void AppendFloatRect(const CFX_FloatRect &rect)
Definition cpdf_path.cpp:49
CFX_FloatRect GetBoundingBoxForStrokePath(float line_width, float miter_limit) const
Definition cpdf_path.cpp:31
CFX_FloatRect GetBoundingBox() const
Definition cpdf_path.cpp:27
const std::vector< CFX_Path::Point > & GetPoints() const
Definition cpdf_path.cpp:15
void ClosePath()
Definition cpdf_path.cpp:19
bool IsRect() const
Definition cpdf_path.cpp:37
void AppendPointAndClose(const CFX_PointF &point, CFX_Path::Point::Type type)
Definition cpdf_path.cpp:64
CFX_PointF GetPoint(int index) const
Definition cpdf_path.cpp:23
void Transform(const CFX_Matrix &matrix)
Definition cpdf_path.cpp:41
CPDF_Path(const CPDF_Path &that)