Anti-Grain Geometry - AGG (libagg)  2.5
agg-2.5/include/agg_trans_warp_magnifier.h
Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 // Anti-Grain Geometry (AGG) - Version 2.5
00003 // A high quality rendering engine for C++
00004 // Copyright (C) 2002-2006 Maxim Shemanarev
00005 // Contact: mcseem@antigrain.com
00006 //          mcseemagg@yahoo.com
00007 //          http://antigrain.com
00008 // 
00009 // AGG is free software; you can redistribute it and/or
00010 // modify it under the terms of the GNU General Public License
00011 // as published by the Free Software Foundation; either version 2
00012 // of the License, or (at your option) any later version.
00013 // 
00014 // AGG is distributed in the hope that it will be useful,
00015 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00016 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017 // GNU General Public License for more details.
00018 // 
00019 // You should have received a copy of the GNU General Public License
00020 // along with AGG; if not, write to the Free Software
00021 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
00022 // MA 02110-1301, USA.
00023 //----------------------------------------------------------------------------
00024 
00025 #ifndef AGG_WARP_MAGNIFIER_INCLUDED
00026 #define AGG_WARP_MAGNIFIER_INCLUDED
00027 
00028 
00029 namespace agg
00030 {
00031 
00032     //----------------------------------------------------trans_warp_magnifier
00033     //
00034     // See Inmplementation agg_trans_warp_magnifier.cpp
00035     //
00036     class trans_warp_magnifier
00037     {
00038     public:
00039         trans_warp_magnifier() : m_xc(0.0), m_yc(0.0), m_magn(1.0), m_radius(1.0) {}
00040  
00041         void center(double x, double y) { m_xc = x; m_yc = y; }
00042         void magnification(double m)    { m_magn = m;         }
00043         void radius(double r)           { m_radius = r;       }
00044 
00045         double xc()            const { return m_xc; }
00046         double yc()            const { return m_yc; }
00047         double magnification() const { return m_magn;   }
00048         double radius()        const { return m_radius; }
00049 
00050         void transform(double* x, double* y) const;
00051         void inverse_transform(double* x, double* y) const;
00052 
00053     private:
00054         double m_xc;
00055         double m_yc;
00056         double m_magn;
00057         double m_radius;
00058     };
00059 
00060 
00061 }
00062 
00063 
00064 #endif
00065 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines