1 //---------------------------------------------------------------------------- 2 // Anti-Grain Geometry (AGG) - Version 2.5 3 // A high quality rendering engine for C++ 4 // Copyright (C) 2002-2006 Maxim Shemanarev 5 // Contact: mcseem@antigrain.com 6 // mcseemagg@yahoo.com 7 // http://antigrain.com 8 // 9 // AGG is free software; you can redistribute it and/or 10 // modify it under the terms of the GNU General Public License 11 // as published by the Free Software Foundation; either version 2 12 // of the License, or (at your option) any later version. 13 // 14 // AGG is distributed in the hope that it will be useful, 15 // but WITHOUT ANY WARRANTY; without even the implied warranty of 16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 // GNU General Public License for more details. 18 // 19 // You should have received a copy of the GNU General Public License 20 // along with AGG; if not, write to the Free Software 21 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 22 // MA 02110-1301, USA. 23 //---------------------------------------------------------------------------- 24 25 #ifndef AGG_WARP_MAGNIFIER_INCLUDED 26 #define AGG_WARP_MAGNIFIER_INCLUDED 27 28 29 namespace agg 30 { 31 32 //----------------------------------------------------trans_warp_magnifier 33 // 34 // See Inmplementation agg_trans_warp_magnifier.cpp 35 // 36 class trans_warp_magnifier 37 { 38 public: trans_warp_magnifier()39 trans_warp_magnifier() : m_xc(0.0), m_yc(0.0), m_magn(1.0), m_radius(1.0) {} 40 center(double x,double y)41 void center(double x, double y) { m_xc = x; m_yc = y; } magnification(double m)42 void magnification(double m) { m_magn = m; } radius(double r)43 void radius(double r) { m_radius = r; } 44 xc()45 double xc() const { return m_xc; } yc()46 double yc() const { return m_yc; } magnification()47 double magnification() const { return m_magn; } radius()48 double radius() const { return m_radius; } 49 50 void transform(double* x, double* y) const; 51 void inverse_transform(double* x, double* y) const; 52 53 private: 54 double m_xc; 55 double m_yc; 56 double m_magn; 57 double m_radius; 58 }; 59 60 61 } 62 63 64 #endif 65 66