PoDoFo 1.2.0
Loading...
Searching...
No Matches
Corners.h
1// SPDX-FileCopyrightText: 2025 Francesco Pretto <ceztko@gmail.com>
2// SPDX-License-Identifier: LGPL-2.0-or-later OR MPL-2.0
3
4#ifndef AUX_CORNERS_H
5#define AUX_CORNERS_H
6
7#include "Vector2.h"
8
9namespace PoDoFo {
10
11class PdfArray;
12class Rect;
13
15class PODOFO_API Corners final
16{
17public:
18 double X1;
19 double Y1;
20 double X2;
21 double Y2;
22
23public:
25 Corners();
26
28 Corners(double x1, double y1, double x2, double y2);
29
30 Corners(const Corners& rhs) = default;
31
32public:
33 static Corners FromCorners(const Vector2& corner1, const Vector2& corner2);
34
37 static Corners FromArray(const PdfArray& arr);
38
39 Vector2 GetCorner1() const;
40
41 Vector2 GetCorner2() const;
42
43 double GetWidth() const;
44
45 double GetHeight() const;
46
48 Rect GetNormalized() const;
49
51 void ToArray(PdfArray& arr) const;
52 PdfArray ToArray() const;
53
54public:
55 bool operator==(const Corners& rect) const;
56 bool operator!=(const Corners& rect) const;
57 Corners& operator=(const Corners& rhs) = default;
58 explicit operator Rect() const;
59};
60
61};
62
63#endif // AUX_CORNERS_H
An unoriented rectangle defined by 2 points.
Definition Corners.h:16
This class represents a PdfArray Use it for all arrays that are written to a PDF file.
Definition PdfArray.h:76
An normalized rectangle defined by position (left-bottom) and size.
Definition Rect.h:17
Convenient type for char array storage and/or buffer with std::string compatibility.
Definition basetypes.h:30
All classes, functions, types and enums of PoDoFo are members of these namespace.
Definition basetypes.h:13