- Main Page
- Related Pages
- Namespaces
- Classes
- Files

# 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 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     //Parametric Blur
    00076     synfig::Point operator()(const synfig::Point &p) const;
    00077     synfig::Point operator()(synfig::Real x, synfig::Real y) const;
    00078
    00079     //Surface based blur
    00080     //  input surface can be the same as output surface,
    00081     //  though both have to be the same size
    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     //bool operator()(const etl::surface<unsigned char> &surface, const synfig::Vector &resolution, etl::surface<unsigned char> &out) const;
    00086 };
    00087
    00088 /* === E N D =============================================================== */
    00089
    00090 #endif