Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
nr-filter-primitive.h
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * SVG filters rendering
4 *
5 * Author:
6 * Niko Kiirala <niko@kiirala.com>
7 *
8 * Copyright (C) 2006-2007 Niko Kiirala
9 *
10 * Released under GNU GPL v2+, read the file 'COPYING' for more information.
11 */
12#ifndef SEEN_NR_FILTER_PRIMITIVE_H
13#define SEEN_NR_FILTER_PRIMITIVE_H
14
15#include <memory>
16#include <2geom/forward.h>
17#include <2geom/rect.h>
18
19#include <glibmm/ustring.h>
20
22#include "svg/svg-length.h"
23#include "style-enums.h"
24
25class SPStyle;
26
27namespace Inkscape {
28namespace Filters {
29
30class FilterSlot;
31class FilterUnits;
32
34{
35public:
38
39 virtual void update() {}
40 virtual void render_cairo(FilterSlot &slot) const;
41 virtual void area_enlarge(Geom::IntRect &area, Geom::Affine const &m) const {}
42
52 virtual void set_input(int slot);
53
63 virtual void set_input(int input, int slot);
64
73 virtual void set_output(int slot);
74
75 // returns cache score factor, reflecting the cost of rendering this filter
76 // this should return how many times slower this primitive is that normal rendering
77 virtual double complexity(Geom::Affine const &/*ctm*/) const { return 1.0; }
78
79 virtual bool uses_background() const
80 {
82 }
83
89 void set_x(SVGLength const &length);
90 void set_y(SVGLength const &length);
91 void set_width(SVGLength const &length);
92 void set_height(SVGLength const &length);
93 void set_subregion(SVGLength const &x, SVGLength const &y,
94 SVGLength const &width, SVGLength const &height);
95
100
115 virtual bool can_handle_affine(Geom::Affine const &) const { return false; }
116
120 void setStyle(SPStyle const *style);
121
122 // Useful for debugging
123 virtual Glib::ustring name() const { return "No name"; }
124
125protected:
128
129 /* Filter primitive subregion */
134
136};
137
138} // namespace Filters
139} // namespace Inkscape
140
141#endif // SEEN_NR_FILTER_PRIMITIVE_H
142/*
143 Local Variables:
144 mode:c++
145 c-file-style:"stroustrup"
146 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
147 indent-tabs-mode:nil
148 fill-column:99
149 End:
150*/
151// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :
3x3 matrix representing an affine transformation.
Definition affine.h:70
Axis aligned, non-empty, generic rectangle.
Axis aligned, non-empty rectangle.
Definition rect.h:92
virtual Glib::ustring name() const
virtual bool can_handle_affine(Geom::Affine const &) const
Indicate whether the filter primitive can handle the given affine.
void set_width(SVGLength const &length)
virtual void set_output(int slot)
Sets the slot number 'slot' to be used as output from filter primitive 'primitive' If output slot for...
Geom::Rect filter_primitive_area(FilterUnits const &units) const
Returns the filter primitive area in user coordinate system.
virtual void render_cairo(FilterSlot &slot) const
void setStyle(SPStyle const *style)
Sets style for access to properties used by filter primitives.
void set_subregion(SVGLength const &x, SVGLength const &y, SVGLength const &width, SVGLength const &height)
void set_x(SVGLength const &length)
Sets the filter primitive subregion.
virtual void area_enlarge(Geom::IntRect &area, Geom::Affine const &m) const
virtual double complexity(Geom::Affine const &) const
virtual void set_input(int slot)
Sets the input slot number 'slot' to be used as input in rendering filter primitive 'primitive' For f...
void set_y(SVGLength const &length)
void set_height(SVGLength const &length)
An SVG style object.
Definition style.h:45
SVG length type.
Definition svg-length.h:22
Contains forward declarations of 2geom types.
Helper class to stream background task notifications as a series of messages.
TODO: insert short description here.
Axis-aligned rectangle.
SPStyle enums: named public enums that correspond to SVG property values.
SPColorInterpolation
double height
double width