00001
00022
00023
00024
00025
00026 #ifndef __SYNFIG_NOISE_DISTORT_H
00027 #define __SYNFIG_NOISE_DISTORT_H
00028
00029
00030
00031 #include <synfig/vector.h>
00032 #include <synfig/valuenode.h>
00033 #include <synfig/layer_composite.h>
00034 #include <synfig/gradient.h>
00035 #include <synfig/time.h>
00036 #include "random_noise.h"
00037
00038
00039
00040
00041
00042
00043
00044 class NoiseDistort : public synfig::Layer_Composite
00045 {
00046 SYNFIG_LAYER_MODULE_EXT
00047
00048 private:
00049
00050 synfig::Vector size;
00051
00052 RandomNoise random;
00053 RandomNoise::SmoothType smooth;
00054 int detail;
00055 synfig::Real speed;
00056 bool turbulent;
00057 synfig::Vector displacement;
00058
00059
00060 mutable synfig::Time curr_time;
00061
00062 synfig::Color color_func(const synfig::Point &x, float supersample,synfig::Context context)const;
00063
00064 float calc_supersample(const synfig::Point &x, float pw,float ph)const;
00065
00066 public:
00067 NoiseDistort();
00068
00069 virtual bool set_param(const synfig::String ¶m, const synfig::ValueBase &value);
00070 virtual synfig::ValueBase get_param(const synfig::String ¶m)const;
00071 virtual synfig::Color get_color(synfig::Context context, const synfig::Point &pos)const;
00072
00073 synfig::Layer::Handle hit_check(synfig::Context context, const synfig::Point &point)const;
00074 virtual void set_time(synfig::Context context, synfig::Time time)const;
00075 virtual void set_time(synfig::Context context, synfig::Time time, const synfig::Point &point)const;
00076 virtual synfig::Rect get_bounding_rect(synfig::Context context)const;
00077 virtual Vocab get_param_vocab()const;
00078 virtual bool reads_context()const { return true; }
00079 };
00080
00081
00082
00083 #endif