00001
00025
00026
00027 #ifndef __SYNFIG_WARP_H
00028 #define __SYNFIG_WARP_H
00029
00030
00031
00032 #include <synfig/vector.h>
00033 #include <synfig/angle.h>
00034 #include <synfig/layer.h>
00035 #include <synfig/rect.h>
00036
00037
00038
00039
00040
00041
00042
00043 using namespace synfig;
00044 using namespace std;
00045 using namespace etl;
00046 class Warp_Trans;
00047
00048 class Warp : public Layer
00049 {
00050 SYNFIG_LAYER_MODULE_EXT
00051 friend class Warp_Trans;
00052 private:
00053
00054 Point src_tl,src_br,dest_tl,dest_tr,dest_bl,dest_br;
00055
00056 Real horizon;
00057
00058 Real cache_a,cache_b,cache_c,cache_d,cache_e,cache_f,cache_i,cache_j;
00059
00060 Real matrix[3][3];
00061 Real inv_matrix[3][3];
00062
00063 Point transform_forward(const Point& p)const;
00064 Point transform_backward(const Point& p)const;
00065
00066 Real transform_forward_z(const Point& p)const;
00067 Real transform_backward_z(const Point& p)const;
00068
00069 bool clip;
00070
00071 public:
00072 void sync();
00073
00074 Warp();
00075 ~Warp();
00076
00077 virtual synfig::Rect get_full_bounding_rect(synfig::Context context)const;
00078 virtual synfig::Rect get_bounding_rect()const;
00079
00080 virtual bool set_param(const synfig::String & param, const synfig::ValueBase &value);
00081 virtual ValueBase get_param(const synfig::String & param)const;
00082 virtual Color get_color(Context context, const Point &pos)const;
00083 virtual bool accelerated_render(Context context,Surface *surface,int quality, const RendDesc &renddesc, ProgressCallback *cb)const;
00084 synfig::Layer::Handle hit_check(synfig::Context context, const synfig::Point &point)const;
00085 virtual Vocab get_param_vocab()const;
00086 virtual etl::handle<synfig::Transform> get_transform()const;
00087 };
00088
00089
00090
00091 #endif