00001
00021
00022
00023
00024
00025 #ifndef __SYNFIG_CONICALGRADIENT_H
00026 #define __SYNFIG_CONICALGRADIENT_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 #include <synfig/angle.h>
00036
00037
00038
00039
00040
00041
00042
00043 class ConicalGradient : public synfig::Layer_Composite, public synfig::Layer_NoDeform
00044 {
00045 SYNFIG_LAYER_MODULE_EXT
00046
00047 private:
00048
00049 synfig::Gradient gradient;
00050
00051 synfig::Point center;
00052
00053 synfig::Angle angle;
00054
00055 bool symmetric;
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 ConicalGradient();
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