blur.h

Go to the documentation of this file.
00001 /* === S Y N F I G ========================================================= */
00021 /* ========================================================================= */
00022 
00023 /* === S T A R T =========================================================== */
00024 
00025 #ifndef __SYNFIG_BLUR_HELPER_H
00026 #define __SYNFIG_BLUR_HELPER_H
00027 
00028 /* === H E A D E R S ======================================================= */
00029 #include <synfig/surface.h>
00030 #include <synfig/color.h>
00031 #include <synfig/vector.h>
00032 
00033 /* === M A C R O S ========================================================= */
00034 
00035 /* === T Y P E D E F S ===================================================== */
00036 
00037 /* === C L A S S E S & S T R U C T S ======================================= */
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     //Parametric Blur
00074     synfig::Point operator ()(const synfig::Point &p) const;
00075     synfig::Point operator ()(synfig::Real x, synfig::Real y) const;
00076 
00077     //Surface based blur
00078     //  input surface can be the same as output surface,
00079     //  though both have to be the same size
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     //bool operator ()(const etl::surface<unsigned char> &surface, const synfig::Vector &resolution, etl::surface<unsigned char> &out) const;
00084 };
00085 
00086 /* === E N D =============================================================== */
00087 
00088 #endif

Generated on Wed Dec 12 03:11:41 2007 for synfig by  doxygen 1.5.4