• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • KDE Home
  • Contact Us
 

KHTML

  • sources
  • kde-4.12
  • kdelibs
  • khtml
  • platform
  • graphics
AffineTransform.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005, 2006 Apple Computer, Inc. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  * 1. Redistributions of source code must retain the above copyright
8  * notice, this list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright
10  * notice, this list of conditions and the following disclaimer in the
11  * documentation and/or other materials provided with the distribution.
12  *
13  * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
14  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
17  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24  */
25 
26 #ifndef AffineTransform_h
27 #define AffineTransform_h
28 
29 #if PLATFORM(CG)
30 #include <CoreGraphics/CGAffineTransform.h>
31 #elif PLATFORM(QT)
32 #include <QMatrix>
33 #elif PLATFORM(CAIRO)
34 #include <cairo.h>
35 #elif PLATFORM(WX) && USE(WXGC)
36 #include <wx/defs.h>
37 #include <wx/graphics.h>
38 #endif
39 
40 namespace WebCore {
41 
42 class IntPoint;
43 class IntRect;
44 class FloatPoint;
45 class FloatRect;
46 
47 class AffineTransform {
48 public:
49  AffineTransform();
50  AffineTransform(double a, double b, double c, double d, double e, double f);
51 #if PLATFORM(CG)
52  AffineTransform(CGAffineTransform transform);
53 #elif PLATFORM(QT)
54  AffineTransform(const QMatrix &matrix);
55 #elif PLATFORM(CAIRO)
56  AffineTransform(const cairo_matrix_t &matrix);
57 #elif PLATFORM(WX) && USE(WXGC)
58  AffineTransform(const wxGraphicsMatrix &matrix);
59 #endif
60 
61  void setMatrix(double a, double b, double c, double d, double e, double f);
62  void map(double x, double y, double *x2, double *y2) const;
63  IntPoint mapPoint(const IntPoint&) const;
64  FloatPoint mapPoint(const FloatPoint&) const;
65  IntRect mapRect(const IntRect&) const;
66  FloatRect mapRect(const FloatRect&) const;
67 
68  bool isIdentity() const;
69 
70  double a() const;
71  void setA(double a);
72 
73  double b() const;
74  void setB(double b);
75 
76  double c() const;
77  void setC(double c);
78 
79  double d() const;
80  void setD(double d);
81 
82  double e() const;
83  void setE(double e);
84 
85  double f() const;
86  void setF(double f);
87 
88  void reset();
89 
90  AffineTransform& multiply(const AffineTransform&);
91  AffineTransform& scale(double);
92  AffineTransform& scale(double sx, double sy);
93  AffineTransform& scaleNonUniform(double sx, double sy);
94  AffineTransform& rotate(double d);
95  AffineTransform& rotateFromVector(double x, double y);
96  AffineTransform& translate(double tx, double ty);
97  AffineTransform& shear(double sx, double sy);
98  AffineTransform& flipX();
99  AffineTransform& flipY();
100  AffineTransform& skew(double angleX, double angleY);
101  AffineTransform& skewX(double angle);
102  AffineTransform& skewY(double angle);
103 
104  double det() const;
105  bool isInvertible() const;
106  AffineTransform inverse() const;
107 
108 #if PLATFORM(CG)
109  operator CGAffineTransform() const;
110 #elif PLATFORM(QT)
111  operator QMatrix() const;
112 #elif PLATFORM(CAIRO)
113  operator cairo_matrix_t() const;
114 #elif PLATFORM(WX) && USE(WXGC)
115  operator wxGraphicsMatrix() const;
116 #endif
117 
118  bool operator==(const AffineTransform&) const;
119  bool operator!=(const AffineTransform& other) const { return !(*this == other); }
120  AffineTransform& operator*=(const AffineTransform&);
121  AffineTransform operator*(const AffineTransform&);
122 
123 private:
124 #if PLATFORM(CG)
125  CGAffineTransform m_transform;
126 #elif PLATFORM(QT)
127  QMatrix m_transform;
128 #elif PLATFORM(CAIRO)
129  cairo_matrix_t m_transform;
130 #elif PLATFORM(WX) && USE(WXGC)
131  wxGraphicsMatrix m_transform;
132 #endif
133 };
134 
135 } // namespace WebCore
136 
137 #endif // AffineTransform_h
WebCore::FloatRect
Definition: FloatRect.h:59
WebCore::IntRect
Definition: IntRect.h:65
WebCore::AffineTransform::map
void map(double x, double y, double *x2, double *y2) const
Definition: AffineTransformQt.cpp:55
WebCore::AffineTransform::skewX
AffineTransform & skewX(double angle)
Definition: AffineTransform.cpp:77
WebCore::AffineTransform::shear
AffineTransform & shear(double sx, double sy)
Definition: AffineTransformQt.cpp:161
WebCore::AffineTransform::scale
AffineTransform & scale(double)
Definition: AffineTransform.cpp:47
WebCore::AffineTransform::translate
AffineTransform & translate(double tx, double ty)
Definition: AffineTransformQt.cpp:155
WebCore::AffineTransform::c
double c() const
Definition: AffineTransformQt.cpp:98
WebCore::AffineTransform::operator*
AffineTransform operator*(const AffineTransform &)
Definition: AffineTransformQt.cpp:196
WebCore::AffineTransform::setE
void setE(double e)
Definition: AffineTransformQt.cpp:123
WebCore::AffineTransform::rotate
AffineTransform & rotate(double d)
Definition: AffineTransformQt.cpp:149
WebCore::AffineTransform::f
double f() const
Definition: AffineTransformQt.cpp:128
WebCore::AffineTransform::e
double e() const
Definition: AffineTransformQt.cpp:118
WebCore::AffineTransform::b
double b() const
Definition: AffineTransformQt.cpp:88
WebCore::AffineTransform::isInvertible
bool isInvertible() const
Definition: AffineTransform.cpp:37
WebCore::AffineTransform::AffineTransform
AffineTransform()
Definition: AffineTransformQt.cpp:35
WebCore::AffineTransform::flipY
AffineTransform & flipY()
Definition: AffineTransform.cpp:67
WebCore::AffineTransform::setMatrix
void setMatrix(double a, double b, double c, double d, double e, double f)
Definition: AffineTransformQt.cpp:50
WebCore::AffineTransform::reset
void reset()
Definition: AffineTransformQt.cpp:138
WebCore::AffineTransform::setF
void setF(double f)
Definition: AffineTransformQt.cpp:133
WebCore::AffineTransform::operator*=
AffineTransform & operator*=(const AffineTransform &)
Definition: AffineTransformQt.cpp:190
WebCore::AffineTransform::setC
void setC(double c)
Definition: AffineTransformQt.cpp:103
WebCore::AffineTransform::d
double d() const
Definition: AffineTransformQt.cpp:108
WebCore::FloatPoint
Definition: FloatPoint.h:61
WebCore::AffineTransform
Definition: AffineTransform.h:47
WebCore::AffineTransform::mapPoint
IntPoint mapPoint(const IntPoint &) const
Definition: AffineTransform.cpp:87
WebCore::AffineTransform::mapRect
IntRect mapRect(const IntRect &) const
Definition: AffineTransformQt.cpp:63
WebCore::AffineTransform::flipX
AffineTransform & flipX()
Definition: AffineTransform.cpp:62
WebCore::AffineTransform::isIdentity
bool isIdentity() const
Definition: AffineTransformQt.cpp:73
WebCore::AffineTransform::setA
void setA(double a)
Definition: AffineTransformQt.cpp:83
WebCore::AffineTransform::scaleNonUniform
AffineTransform & scaleNonUniform(double sx, double sy)
Definition: AffineTransform.cpp:52
WebCore::AffineTransform::multiply
AffineTransform & multiply(const AffineTransform &)
Definition: AffineTransform.cpp:42
WebCore::AffineTransform::det
double det() const
Definition: AffineTransformQt.cpp:167
WebCore::AffineTransform::rotateFromVector
AffineTransform & rotateFromVector(double x, double y)
Definition: AffineTransform.cpp:57
WebCore::AffineTransform::inverse
AffineTransform inverse() const
Definition: AffineTransformQt.cpp:172
WebCore::AffineTransform::operator!=
bool operator!=(const AffineTransform &other) const
Definition: AffineTransform.h:119
WebCore::IntPoint
Definition: IntPoint.h:64
WebCore::AffineTransform::setD
void setD(double d)
Definition: AffineTransformQt.cpp:113
WebCore::AffineTransform::skew
AffineTransform & skew(double angleX, double angleY)
Definition: AffineTransform.cpp:72
WebCore::AffineTransform::setB
void setB(double b)
Definition: AffineTransformQt.cpp:93
WebCore::AffineTransform::operator==
bool operator==(const AffineTransform &) const
Definition: AffineTransformQt.cpp:185
WebCore::AffineTransform::a
double a() const
Definition: AffineTransformQt.cpp:78
WebCore::AffineTransform::skewY
AffineTransform & skewY(double angle)
Definition: AffineTransform.cpp:82
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:51:20 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KHTML

Skip menu "KHTML"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal