00001 /* === S Y N F I G ========================================================= */ 00022 /* ========================================================================= */ 00023 00024 /* === S T A R T =========================================================== */ 00025 00026 #ifndef __SYNFIG_SPHERE_DISTORT_H 00027 #define __SYNFIG_SPHERE_DISTORT_H 00028 00029 /* === H E A D E R S ======================================================= */ 00030 00031 #include <synfig/layer_composite.h> 00032 #include <synfig/vector.h> 00033 #include <synfig/rect.h> 00034 00035 /* === M A C R O S ========================================================= */ 00036 00037 /* === T Y P E D E F S ===================================================== */ 00038 00039 /* === C L A S S E S & S T R U C T S ======================================= */ 00040 namespace synfig 00041 { 00042 class Spherize_Trans; 00043 00044 class Layer_SphereDistort : public Layer 00045 { 00046 SYNFIG_LAYER_MODULE_EXT 00047 friend class Spherize_Trans; 00048 00049 private: 00050 00051 Vector center; 00052 double radius; 00053 00054 double percent; 00055 00056 int type; 00057 00058 // static Point sphtrans(const Point &xoff, const Point ¢er, const Real &radius, const Real &percent, int type); 00059 00060 // static double spherify(double xoff); 00061 // static double unspherify(double xoff); 00062 00063 bool clip; 00064 00065 synfig::Rect bounds; 00066 00067 void sync(); 00068 00069 public: 00070 00071 Layer_SphereDistort(); 00072 00073 virtual bool set_param(const String & param, const synfig::ValueBase &value); 00074 00075 virtual ValueBase get_param(const String & param)const; 00076 00077 virtual Color get_color(Context context, const Point &pos)const; 00078 00079 virtual bool accelerated_render(Context context,Surface *surface,int quality, const RendDesc &renddesc, ProgressCallback *cb)const; 00080 synfig::Layer::Handle hit_check(synfig::Context context, const synfig::Point &point)const; 00081 00082 virtual Rect get_bounding_rect()const; 00083 00084 virtual Vocab get_param_vocab()const; 00085 virtual etl::handle<synfig::Transform> get_transform()const; 00086 }; // END of class Layer_SphereDistort 00087 00088 } 00089 00090 /* === E N D =============================================================== */ 00091 00092 #endif