00001
00026
00027
00028 #ifndef __SYNFIG_CURVEGRADIENT_H
00029 #define __SYNFIG_CURVEGRADIENT_H
00030
00031
00032
00033 #include <synfig/vector.h>
00034 #include <synfig/layer_composite.h>
00035 #include <synfig/gradient.h>
00036 #include <synfig/blinepoint.h>
00037
00038
00039
00040
00041
00042
00043
00044 using namespace synfig;
00045 using namespace std;
00046 using namespace etl;
00047
00048 class CurveGradient : public Layer_Composite, public Layer_NoDeform
00049 {
00050 SYNFIG_LAYER_MODULE_EXT
00051
00052 private:
00053 std::vector<synfig::BLinePoint> bline;
00054
00055 Point origin;
00056 Real width;
00057 Gradient gradient;
00058 Real curve_length_;
00059
00060 bool loop;
00061 bool zigzag;
00062 bool bline_loop;
00063 bool perpendicular;
00064 bool fast;
00065
00066 void sync();
00067
00068 synfig::Color color_func(const synfig::Point &x, int quality=10, float supersample=0)const;
00069
00070 float calc_supersample(const synfig::Point &x, float pw,float ph)const;
00071
00072 public:
00073 CurveGradient();
00074
00075 virtual bool set_param(const String ¶m, const ValueBase &value);
00076 virtual ValueBase get_param(const String ¶m)const;
00077 virtual Color get_color(Context context, const Point &pos)const;
00078 virtual bool accelerated_render(Context context,Surface *surface,int quality, const RendDesc &renddesc, ProgressCallback *cb)const;
00079 synfig::Layer::Handle hit_check(synfig::Context context, const synfig::Point &point)const;
00080
00081 virtual Vocab get_param_vocab()const;
00082 };
00083
00084
00085
00086 #endif