Anti-Grain Geometry Tutorial
agg_trans_warp_magnifier.h
1 //----------------------------------------------------------------------------
2 // Anti-Grain Geometry - Version 2.4
3 // Copyright (C) 2002-2005 Maxim Shemanarev (http://www.antigrain.com)
4 //
5 // Permission to copy, use, modify, sell and distribute this software
6 // is granted provided this copyright notice appears in all copies.
7 // This software is provided "as is" without express or implied
8 // warranty, and with no claim as to its suitability for any purpose.
9 //
10 //----------------------------------------------------------------------------
11 // Contact: mcseem@antigrain.com
12 // mcseemagg@yahoo.com
13 // http://www.antigrain.com
14 //----------------------------------------------------------------------------
15 
16 #ifndef AGG_WARP_MAGNIFIER_INCLUDED
17 #define AGG_WARP_MAGNIFIER_INCLUDED
18 
19 
20 namespace agg
21 {
22 
23  //----------------------------------------------------trans_warp_magnifier
24  //
25  // See Inmplementation agg_trans_warp_magnifier.cpp
26  //
28  {
29  public:
30  trans_warp_magnifier() : m_xc(0.0), m_yc(0.0), m_magn(1.0), m_radius(1.0) {}
31 
32  void center(double x, double y) { m_xc = x; m_yc = y; }
33  void magnification(double m) { m_magn = m; }
34  void radius(double r) { m_radius = r; }
35 
36  double xc() const { return m_xc; }
37  double yc() const { return m_yc; }
38  double magnification() const { return m_magn; }
39  double radius() const { return m_radius; }
40 
41  void transform(double* x, double* y) const;
42  void inverse_transform(double* x, double* y) const;
43 
44  private:
45  double m_xc;
46  double m_yc;
47  double m_magn;
48  double m_radius;
49  };
50 
51 
52 }
53 
54 
55 #endif
56 
Definition: agg_arc.cpp:24