1 #define __NR_FILTER_PRIMITIVE_CPP__
3 /*
4 * SVG filters rendering
5 *
6 * Author:
7 * Niko Kiirala <niko@kiirala.com>
8 *
9 * Copyright (C) 2006 Niko Kiirala
10 *
11 * Released under GNU GPL, read the file 'COPYING' for more information
12 */
14 #include "display/nr-filter-primitive.h"
15 #include "display/nr-filter-types.h"
16 #include "libnr/nr-pixblock.h"
17 #include "svg/svg-length.h"
19 namespace NR {
21 FilterPrimitive::FilterPrimitive()
22 {
23 _input = NR_FILTER_SLOT_NOT_SET;
24 _output = NR_FILTER_SLOT_NOT_SET;
26 _region_x.set(SVGLength::PERCENT, 0, 0);
27 _region_y.set(SVGLength::PERCENT, 0, 0);
28 _region_width.set(SVGLength::PERCENT, 100, 0);
29 _region_height.set(SVGLength::PERCENT, 100, 0);
30 }
32 int FilterPrimitive::render(NRPixBlock **pb, NRMatrix const *trans) {
33 if(trans) {
34 return this->render(pb, *trans);
35 } else {
36 Matrix tmp;
37 tmp.set_identity();
38 return this->render(pb, tmp);
39 }
40 }
42 int FilterPrimitive::get_enlarge(Matrix const &m)
43 {
44 return 0;
45 }
47 void FilterPrimitive::set_input(int slot) {
48 set_input(0, slot);
49 }
51 void FilterPrimitive::set_input(int input, int slot) {
52 if (slot == 0) _input = slot;
53 }
55 void FilterPrimitive::set_output(int slot) {
56 if (slot >= 0) _output = slot;
57 }
59 } /* namespace NR */
61 /*
62 Local Variables:
63 mode:c++
64 c-file-style:"stroustrup"
65 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
66 indent-tabs-mode:nil
67 fill-column:99
68 End:
69 */
70 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :