1 /* Libart_LGPL - library of basic graphic primitives
2 * Copyright (C) 1998 Raph Levien
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
20 #ifndef __ART_AFFINE_H__
21 #define __ART_AFFINE_H__
23 #ifdef LIBART_COMPILATION
24 #include "art_point.h"
26 #include "art_point.h"
31 #endif /* __cplusplus */
34 art_affine_point (ArtPoint *dst, const ArtPoint *src,
35 const double affine[6]);
38 art_affine_invert (double dst_affine[6], const double src_affine[6]);
40 /* flip the matrix, FALSE, FALSE is a simple copy operation, and
41 TRUE, TRUE equals a rotation by 180 degrees */
43 art_affine_flip (double dst_affine[6], const double src_affine[6],
47 art_affine_to_string (char str[128], const double src[6]);
50 art_affine_multiply (double dst[6],
51 const double src1[6], const double src2[6]);
53 /* set up the identity matrix */
55 art_affine_identity (double dst[6]);
57 /* set up a scaling matrix */
59 art_affine_scale (double dst[6], double sx, double sy);
61 /* set up a rotation matrix; theta is given in degrees */
63 art_affine_rotate (double dst[6], double theta);
65 /* set up a shearing matrix; theta is given in degrees */
67 art_affine_shear (double dst[6], double theta);
69 /* set up a translation matrix */
71 art_affine_translate (double dst[6], double tx, double ty);
74 /* find the affine's "expansion factor", i.e. the scale amount */
76 art_affine_expansion (const double src[6]);
78 /* Determine whether the affine transformation is rectilinear,
79 i.e. whether a rectangle aligned to the grid is transformed into
80 another rectangle aligned to the grid. */
82 art_affine_rectilinear (const double src[6]);
84 /* Determine whether two affine transformations are equal within grid allignment */
86 art_affine_equal (double matrix1[6], double matrix2[6]);
91 #endif /* __cplusplus */
93 #endif /* __ART_AFFINE_H__ */