Code

User message context in extensions
[inkscape.git] / src / display / nr-filter-gaussian.h
1 #ifndef __NR_FILTER_GAUSSIAN_H__
2 #define __NR_FILTER_GAUSSIAN_H__
4 /*
5  * Gaussian blur renderer
6  *
7  * Authors:
8  *   Niko Kiirala <niko@kiirala.com>
9  *   bulia byak
10  *   Jasper van de Gronde <th.v.d.gronde@hccnet.nl>
11  *
12  * Copyright (C) 2006 authors
13  *
14  * Released under GNU GPL, read the file 'COPYING' for more information
15  */
17 #include "display/nr-filter-primitive.h"
18 #include "display/nr-filter-slot.h"
19 #include "display/nr-filter-units.h"
20 #include "libnr/nr-pixblock.h"
21 #include <2geom/forward.h>
22 #include "libnr/nr-rect-l.h"
24 enum {
25     BLUR_QUALITY_BEST = 2,
26     BLUR_QUALITY_BETTER = 1,
27     BLUR_QUALITY_NORMAL = 0,
28     BLUR_QUALITY_WORSE = -1,
29     BLUR_QUALITY_WORST = -2
30 };
32 namespace Inkscape {
33 namespace Filters {
35 class FilterGaussian : public FilterPrimitive {
36 public:
37     FilterGaussian();
38     static FilterPrimitive *create();
39     virtual ~FilterGaussian();
41     virtual int render(FilterSlot &slot, FilterUnits const &units);
42     virtual void area_enlarge(NRRectL &area, Geom::Matrix const &m);
43     virtual FilterTraits get_input_traits();
45     /**
46      * Set the standard deviation value for gaussian blur. Deviation along
47      * both axis is set to the provided value.
48      * Negative value, NaN and infinity are considered an error and no
49      * changes to filter state are made. If not set, default value of zero
50      * is used, which means the filter results in transparent black image.
51      */
52     void set_deviation(double deviation);
53     /**
54      * Set the standard deviation value for gaussian blur. First parameter
55      * sets the deviation alogn x-axis, second along y-axis.
56      * Negative value, NaN and infinity are considered an error and no
57      * changes to filter state are made. If not set, default value of zero
58      * is used, which means the filter results in transparent black image.
59      */
60     void set_deviation(double x, double y);
62 private:
63     double _deviation_x;
64     double _deviation_y;
65 };
68 } /* namespace Filters */
69 } /* namespace Inkscape */
74 #endif /* __NR_FILTER_GAUSSIAN_H__ */
75 /*
76   Local Variables:
77   mode:c++
78   c-file-style:"stroustrup"
79   c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
80   indent-tabs-mode:nil
81   fill-column:99
82   End:
83 */
84 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :