aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/qpdf/QPDFMatrix.hh
blob: 81bc51f1deebf9a3e8467fc5b583778e5389e078 (plain) (blame)
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
#ifndef QPDFMATRIX_HH
#define QPDFMATRIX_HH

#include <qpdf/QPDFObjectHandle.hh>
#include <qpdf/DLL.h>
#include <string>

class QPDFMatrix
{
  public:
    QPDF_DLL
    QPDFMatrix();
    QPDF_DLL
    QPDFMatrix(double a, double b, double c,
               double d, double e, double f);
    QPDF_DLL
    QPDFMatrix(QPDFObjectHandle::Matrix const&);

    QPDF_DLL
    std::string unparse() const;

    // This is not part of the public API. Just provide the methods we
    // need as we need them.
    QPDF_DLL
    void concat(QPDFMatrix const& other);
    QPDF_DLL
    void scale(double sx, double sy);
    QPDF_DLL
    void translate(double tx, double ty);
    // Any value other than 90, 180, or 270 is ignored
    QPDF_DLL
    void rotatex90(int angle);

    QPDF_DLL
    void transform(double x, double y, double& xp, double& yp);

  private:
    double a;
    double b;
    double c;
    double d;
    double e;
    double f;
};

#endif // QPDFMATRIX_HH