00001
00021
00022
00023
00024
00025 #ifndef __SYNFIG_RADIALGRADIENT_H
00026 #define __SYNFIG_RADIALGRADIENT_H
00027
00028
00029
00030 #include <synfig/layer_composite.h>
00031 #include <synfig/color.h>
00032 #include <synfig/vector.h>
00033 #include <synfig/value.h>
00034 #include <synfig/gradient.h>
00035
00036
00037
00038
00039
00040
00041
00042 class RadialGradient : public synfig::Layer_Composite, public synfig::Layer_NoDeform
00043 {
00044 SYNFIG_LAYER_MODULE_EXT
00045
00046 private:
00047
00048 synfig::Gradient gradient;
00049
00050 synfig::Point center;
00051
00052 synfig::Real radius;
00053
00054 bool loop;
00055 bool zigzag;
00056
00057 synfig::Color color_func(const synfig::Point &x, float supersample=0)const;
00058
00059 float calc_supersample(const synfig::Point &x, float pw,float ph)const;
00060
00061 public:
00062
00063 RadialGradient();
00064
00065 virtual bool set_param(const synfig::String & param, const synfig::ValueBase &value);
00066
00067 virtual synfig::ValueBase get_param(const synfig::String & param)const;
00068
00069 virtual synfig::Color get_color(synfig::Context context, const synfig::Point &pos)const;
00070
00071 virtual bool accelerated_render(synfig::Context context,synfig::Surface *surface,int quality, const synfig::RendDesc &renddesc, synfig::ProgressCallback *cb)const;
00072 synfig::Layer::Handle hit_check(synfig::Context context, const synfig::Point &point)const;
00073
00074 virtual Vocab get_param_vocab()const;
00075 };
00076
00077
00078
00079 #endif