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 class synfig::ProgressCallback;
00039
00040 class Blur
00041 {
00042 public:
00043 enum Type
00044 {
00045 BOX =0,
00046 FASTGAUSSIAN =1,
00047 CROSS =2,
00048 GAUSSIAN =3,
00049 DISC =4,
00050
00051 FORCE_DWORD = 0x8fffffff
00052 };
00053
00054 private:
00055 synfig::Point size;
00056 int type;
00057
00058 synfig::ProgressCallback *cb;
00059
00060 public:
00061 synfig::Point & set_size(const synfig::Point &v) { return (size = v); }
00062 const synfig::Point & get_size() const { return size; }
00063 synfig::Point & get_size() { return size; }
00064
00065 int & set_type(const int &t) { return (type = t); }
00066 const int & get_type() const { return type; }
00067 int & get_type() { return type; }
00068
00069 Blur() {}
00070 Blur(const synfig::Point &s, int t, synfig::ProgressCallback *callb=0):size(s), type(t), cb(callb) {}
00071 Blur(synfig::Real sx, synfig::Real sy, int t, synfig::ProgressCallback *callb = 0): size(sx,sy), type(t), cb(callb) {}
00072
00073
00074 synfig::Point operator ()(const synfig::Point &p) const;
00075 synfig::Point operator ()(synfig::Real x, synfig::Real y) const;
00076
00077
00078
00079
00080 bool operator ()(const synfig::Surface &surface, const synfig::Vector &resolution, synfig::Surface &out) const;
00081
00082 bool operator ()(const etl::surface<float> &surface, const synfig::Vector &resolution, etl::surface<float> &out) const;
00083
00084 };
00085
00086
00087
00088 #endif