d4f6c942c373b1e88f132645470b5c42e25ca285
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 "libnr/nr-pixblock.h"
20 #include "libnr/nr-matrix.h"
21 #include "libnr/nr-rect-l.h"
23 enum {
24 BLUR_QUALITY_BEST = 2,
25 BLUR_QUALITY_BETTER = 1,
26 BLUR_QUALITY_NORMAL = 0,
27 BLUR_QUALITY_WORSE = -1,
28 BLUR_QUALITY_WORST = -2
29 };
31 namespace NR {
33 class FilterGaussian : public FilterPrimitive {
34 public:
35 FilterGaussian();
36 static FilterPrimitive *create();
37 virtual ~FilterGaussian();
39 virtual int render(FilterSlot &slot, Matrix const &trans);
40 virtual void area_enlarge(NRRectL &area, Matrix const &m);
42 /**
43 * Set the standard deviation value for gaussian blur. Deviation along
44 * both axis is set to the provided value.
45 * Negative value, NaN and infinity are considered an error and no
46 * changes to filter state are made. If not set, default value of zero
47 * is used, which means the filter results in transparent black image.
48 */
49 void set_deviation(double deviation);
50 /**
51 * Set the standard deviation value for gaussian blur. First parameter
52 * sets the deviation alogn x-axis, second along y-axis.
53 * Negative value, NaN and infinity are considered an error and no
54 * changes to filter state are made. If not set, default value of zero
55 * is used, which means the filter results in transparent black image.
56 */
57 void set_deviation(double x, double y);
59 private:
60 double _deviation_x;
61 double _deviation_y;
62 };
65 } /* namespace NR */
70 #endif /* __NR_FILTER_GAUSSIAN_H__ */
71 /*
72 Local Variables:
73 mode:c++
74 c-file-style:"stroustrup"
75 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
76 indent-tabs-mode:nil
77 fill-column:99
78 End:
79 */
80 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :