Bump for 3.6-28
[LibreOffice.git] / offapi / com / sun / star / geometry / AffineMatrix2D.idl
blobb52be39639f9e7c2e58c9e1159ded90272a26b30
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
28 #ifndef __com_sun_star_geometry_AffineMatrix2D_idl__
29 #define __com_sun_star_geometry_AffineMatrix2D_idl__
31 module com { module sun { module star { module geometry {
33 /** This structure defines a 2 by 3 affine matrix.<p>
35 The matrix defined by this structure constitutes an affine mapping
36 of a point in 2D to another point in 2D. The last line of a
37 complete 3 by 3 matrix is omitted, since it is implicitly assumed
38 to be [0,0,1].<p>
40 An affine mapping, as performed by this matrix, can be written out
41 as follows, where <code>xs</code> and <code>ys</code> are the source, and
42 <code>xd</code> and <code>yd</code> the corresponding result coordinates:
44 <code>
45 xd = m00*xs + m01*ys + m02;
46 yd = m10*xs + m11*ys + m12;
47 </code><p>
49 Thus, in common matrix language, with M being the
50 <type>AffineMatrix2D</type> and vs=[xs,ys]^T, vd=[xd,yd]^T two 2D
51 vectors, the affine transformation is written as
52 vd=M*vs. Concatenation of transformations amounts to
53 multiplication of matrices, i.e. a translation, given by T,
54 followed by a rotation, given by R, is expressed as vd=R*(T*vs) in
55 the above notation. Since matrix multiplication is associative,
56 this can be shortened to vd=(R*T)*vs=M'*vs. Therefore, a set of
57 consecutive transformations can be accumulated into a single
58 AffineMatrix2D, by multiplying the current transformation with the
59 additional transformation from the left.<p>
61 Due to this transformational approach, all geometry data types are
62 points in abstract integer or real coordinate spaces, without any
63 physical dimensions attached to them. This physical measurement
64 units are typically only added when using these data types to
65 render something onto a physical output device, like a screen or a
66 printer, Then, the total transformation matrix and the device
67 resolution determine the actual measurement unit.<p>
69 @since OOo 2.0
71 struct AffineMatrix2D
73 /// The top, left matrix entry.
74 double m00;
76 /// The top, middle matrix entry.
77 double m01;
79 /// The top, right matrix entry.
80 double m02;
82 /// The bottom, left matrix entry.
83 double m10;
85 /// The bottom, middle matrix entry.
86 double m11;
88 /// The bottom, right matrix entry.
89 double m12;
92 }; }; }; };
94 #endif
96 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */