Loading...
Searching...
No Matches
Matrix2D.h
Go to the documentation of this file.
1//---------------------------------------------------------------------------------------
2// Copyright (c) 2001-2025 by Apryse Software Inc. All Rights Reserved.
3// Consult legal.txt regarding legal and license information.
4//---------------------------------------------------------------------------------------
5#ifndef PDFTRON_H_CPPCommonMatrix2D
6#define PDFTRON_H_CPPCommonMatrix2D
7
8#include <Common/Common.h>
9#include <C/Common/TRN_Types.h>
10#include <C/Common/TRN_Matrix2D.h>
11#include <PDF/Point.h>
12#include <vector>
13
14
15namespace pdftron {
16 namespace Common {
17
18
103class Matrix2D : public TRN_Matrix2D
104{
105public:
106
120 Matrix2D(double a = 1, double b = 0, double c = 0, double d = 1, double h = 0, double v = 0);
121
126
131
142 void Set (double a, double b, double c, double d, double h, double v);
143
155 void Concat(double a, double b, double c, double d, double h, double v);
156
157#if !defined(SWIG)
165
171 Matrix2D operator* (const Matrix2D& m) const;
172
180 bool operator== (const Matrix2D& m) const;
181
189 bool operator!= (const Matrix2D& m) const {return !(this->operator ==(m));}
190#else // !defined(SWIG)
191 Matrix2D Multiply(const Matrix2D& m);
192 bool IsEquals(const Matrix2D& m) const;
193 bool IsNotEquals(const Matrix2D& m) const
194 {
195 return (!this->IsEquals(m));
196 }
197#endif // !defined(SWIG)
201 PDF::Point Mult(const PDF::Point & pt) const;
202
203#ifndef SWIG
204 void Mult(double& in_out_x, double& in_out_y) const;
205#endif
206
207
212
222 void Translate (double h, double v);
223
231 void PreTranslate(double h, double v);
232
240 void PostTranslate(double h, double v);
241
247 void Scale (double h, double v);
248
253
258
264 static Matrix2D RotationMatrix (const double angle);
265};
266
267
268#include <Impl/Matrix2D.inl>
269
270 }; // namespace Common
271}; // namespace pdftron
272
273#endif // PDFTRON_H_CPPCommonMatrix2D
PDF::Point Mult(const PDF::Point &pt) const
void Set(double a, double b, double c, double d, double h, double v)
void Scale(double h, double v)
void PostTranslate(double h, double v)
bool operator==(const Matrix2D &m) const
Matrix2D(double a=1, double b=0, double c=0, double d=1, double h=0, double v=0)
bool operator!=(const Matrix2D &m) const
Definition Matrix2D.h:189
Matrix2D operator*(const Matrix2D &m) const
static Matrix2D RotationMatrix(const double angle)
Matrix2D & operator*=(const Matrix2D &m)
Matrix2D Inverse() const
void Translate(double h, double v)
void PreTranslate(double h, double v)
Matrix2D(const Matrix2D &m)
static Matrix2D IdentityMatrix()
static Matrix2D ZeroMatrix()
void Mult(double &in_out_x, double &in_out_y) const
void Concat(double a, double b, double c, double d, double h, double v)
Matrix2D & operator=(const Matrix2D &m)