00001
00021
00022
00023
00024
00025 #ifndef __SYNFIG_BLUR_HELPER_H
00026 #define __SYNFIG_BLUR_HELPER_H
00027
00028
00029 #include <synfig/surface.h>
00030 #include <synfig/color.h>
00031 #include <synfig/vector.h>
00032
00033
00034
00035
00036
00037
00038 namespace synfig {
00039 class ProgressCallback;
00040 }
00041
00042 class Blur
00043 {
00044 public:
00045 enum Type
00046 {
00047 BOX =0,
00048 FASTGAUSSIAN =1,
00049 CROSS =2,
00050 GAUSSIAN =3,
00051 DISC =4,
00052
00053 FORCE_DWORD = 0x8fffffff
00054 };
00055
00056 private:
00057 synfig::Point size;
00058 int type;
00059
00060 synfig::ProgressCallback *cb;
00061
00062 public:
00063 synfig::Point & set_size(const synfig::Point &v) { return (size = v); }
00064 const synfig::Point & get_size() const { return size; }
00065 synfig::Point & get_size() { return size; }
00066
00067 int & set_type(const int &t) { return (type = t); }
00068 const int & get_type() const { return type; }
00069 int & get_type() { return type; }
00070
00071 Blur() {}
00072 Blur(const synfig::Point &s, int t, synfig::ProgressCallback *callb=0):size(s), type(t), cb(callb) {}
00073 Blur(synfig::Real sx, synfig::Real sy, int t, synfig::ProgressCallback *callb = 0): size(sx,sy), type(t), cb(callb) {}
00074
00075
00076 synfig::Point operator()(const synfig::Point &p) const;
00077 synfig::Point operator()(synfig::Real x, synfig::Real y) const;
00078
00079
00080
00081
00082 bool operator()(const synfig::Surface &surface, const synfig::Vector &resolution, synfig::Surface &out) const;
00083
00084 bool operator()(const etl::surface<float> &surface, const synfig::Vector &resolution, etl::surface<float> &out) const;
00085
00086 };
00087
00088
00089
00090 #endif