cheshirekow  v0.1.0
Matrix.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012 Josh Bialkowski (jbialk@mit.edu)
3  *
4  * This file is part of cppfontconfig.
5  *
6  * cppfontconfig is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * cppfontconfig is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with cppfontconfig. If not, see <http://www.gnu.org/licenses/>.
18  */
27 #ifndef FONTCONFIG_MATRIX_H_
28 #define FONTCONFIG_MATRIX_H_
29 
30 #include <fontconfig/fontconfig.h>
31 
32 namespace fontconfig
33 {
34 
36 
42 struct Matrix:
43  public FcMatrix
44 {
45  public:
47  Matrix(){}
48 
50 
53  Matrix( const Matrix& other );
54 
56  Matrix& operator=( const Matrix& other );
57 
59  void init();
60 
62  bool equal( const Matrix& other ) const;
63 
65  void rotate(double c, double s);
66 
68  void scale(double sx, double sy);
69 
71  void shear(double sh, double sv);
72 };
73 
75 Matrix operator*( const Matrix& a, const Matrix& b );
76 
78 bool operator==( const Matrix& a, const Matrix& b );
79 
80 
81 } // namespace fontconfig
82 
83 #endif // MATRIX_H_
Matrix operator*(const Matrix &a, const Matrix &b)
multiply matricies
Matrix & operator=(const Matrix &other)
assignment operator, copies the values of the matrix in other
void init()
initializes the matrix to be the identity matrix
bool operator==(const Matrix &a, const Matrix &b)
test for equality
wraps FcMatrix with it's member methods
Definition: Matrix.h:42
bool equal(const Matrix &other) const
returns true if the two matrices are equal
void rotate(double c, double s)
rotate a matrix
void shear(double sh, double sv)
shear a matrix
BinaryKey other(const BinaryKey &key)
Definition: BinaryKey.h:44
void scale(double sx, double sy)
scale a matrix
Matrix()
Default constructor, uninitialized memory.
Definition: Matrix.h:47