00001
00022
00023
00024
00025
00026 #ifndef __SYNFIG_HALFTONE3_H
00027 #define __SYNFIG_HALFTONE3_H
00028
00029
00030
00031 #include <synfig/vector.h>
00032 #include <synfig/valuenode.h>
00033 #include <synfig/layer_composite.h>
00034 #include <synfig/time.h>
00035 #include <synfig/angle.h>
00036 #include "halftone.h"
00037
00038
00039
00040
00041
00042
00043
00044 class Halftone3 : public synfig::Layer_Composite
00045 {
00046 SYNFIG_LAYER_MODULE_EXT
00047
00048 private:
00049
00050 synfig::Vector size;
00051 int type;
00052 Halftone tone[3];
00053 synfig::Color color[3];
00054 float inverse_matrix[3][3];
00055 bool subtractive;
00056
00057 synfig::Color color_func(const synfig::Point &x, float supersample,const synfig::Color &under_color)const;
00058
00059 float calc_supersample(const synfig::Point &x, float pw,float ph)const;
00060
00061
00062
00063 void sync();
00064
00065 public:
00066 Halftone3();
00067
00068 virtual bool set_param(const synfig::String ¶m, const synfig::ValueBase &value);
00069 virtual synfig::ValueBase get_param(const synfig::String ¶m)const;
00070 virtual synfig::Color get_color(synfig::Context context, const synfig::Point &pos)const;
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 virtual Vocab get_param_vocab()const;
00074 virtual bool reads_context()const { return true; }
00075 };
00076
00077
00078
00079 #endif