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