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