Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
nr-filter-units.h
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-2.0-or-later
2#ifndef SEEN_NR_FILTER_UNITS_H
3#define SEEN_NR_FILTER_UNITS_H
4
5/*
6 * Utilities for handling coordinate system transformations in filters
7 *
8 * Author:
9 * Niko Kiirala <niko@kiirala.com>
10 *
11 * Copyright (C) 2007 Niko Kiirala
12 *
13 * Released under GNU GPL v2+, read the file 'COPYING' for more information.
14 */
15
17#include <2geom/affine.h>
18#include <2geom/rect.h>
19
20namespace Inkscape {
21namespace Filters {
22
23/* Notes:
24 * - "filter units" is a coordinate system where the filter region is contained
25 * between (0,0) and (1,1). Do not confuse this with the filterUnits property
26 * - "primitive units" is the coordinate system in which all lengths and distances
27 * in the filter definition should be interpreted. They are affected by the value
28 * of the primitiveUnits attribute
29 * - "pb" is the coordinate system in which filter rendering happens.
30 * It might be aligned with user or screen coordinates depending on
31 * the filter primitives used in the filter.
32 * - "display" are world coordinates of the canvas - pixel grid coordinates
33 * of the drawing area translated so that (0,0) corresponds to the document origin
34 */
36public:
39
44 void set_ctm(Geom::Affine const &ctm);
45
49 void set_resolution(double const x_res, double const y_res);
50
54 void set_item_bbox(Geom::OptRect const &bbox);
55
59 void set_filter_area(Geom::OptRect const &area);
60
65 void set_paraller(bool const paraller);
66
72 void set_automatic_resolution(bool const automatic);
73
78
83
88
93
98
103
108
114
120
125
130
137
139
140private:
143
151};
152
153} // namespace Filters
154} // namespace Inkscape
155
156#endif /* SEEN_INKSCAPE_NR_FILTER_UNITS_H */
157/*
158 Local Variables:
159 mode:c++
160 c-file-style:"stroustrup"
161 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
162 indent-tabs-mode:nil
163 fill-column:99
164 End:
165*/
166// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :
3x3 affine transformation matrix.
3x3 matrix representing an affine transformation.
Definition affine.h:70
Axis aligned, non-empty, generic rectangle.
Axis-aligned rectangle that can be empty.
Definition rect.h:203
SPFilterUnits get_primitive_units() const
Gets Primitive Units (userSpaceOnUse or objectBoundingBox)
Geom::Affine get_matrix_user2primitiveunits() const
Gets the user coordinates to primitiveUnits transformation matrix.
void set_automatic_resolution(bool const automatic)
Sets, if filter resolution is automatic.
Geom::Affine get_matrix_user2filterunits() const
Gets the user coordinates to filterUnits transformation matrix.
Geom::Affine get_matrix_primitiveunits2pb() const
Gets the primitiveUnits to pixblock coordinates transformation matrix.
Geom::Affine get_matrix_display2pb() const
Gets the display coordinates to pixblock coordinates transformation matrix.
Geom::Affine get_matrix_units2pb(SPFilterUnits units) const
Geom::Affine get_matrix_pb2display() const
Gets the pixblock coordinates to display coordinates transformation matrix.
SPFilterUnits get_filter_units() const
Gets Filter Units (userSpaceOnUse or objectBoundingBox)
void set_paraller(bool const paraller)
Sets, if x and y axis in pixblock coordinates should be paraller to x and y of user coordinates.
Geom::OptRect get_filter_area() const
Gets the filter effects area in user coordinates.
FilterUnits & operator=(FilterUnits const &other)
void set_filter_area(Geom::OptRect const &area)
Sets the filter effects area in user coordinates.
void set_item_bbox(Geom::OptRect const &bbox)
Sets the item bounding box in user coordinates.
Geom::OptRect get_item_bbox() const
Gets the item bounding box in user coordinates.
void set_ctm(Geom::Affine const &ctm)
Sets the current transformation matrix, i.e.
Geom::Affine get_matrix_user2pb() const
Gets the user coordinates to pixblock coordinates transformation matrix.
Geom::IntRect get_pixblock_filterarea_paraller() const
Returns the filter area in pixblock coordinates.
void set_resolution(double const x_res, double const y_res)
Sets the resolution, the filter should be rendered with.
Geom::Affine get_matrix_filterunits2pb() const
Gets the filterUnits to pixblock coordinates transformation matrix.
Geom::Affine get_matrix_user2units(SPFilterUnits units) const
Helper class to stream background task notifications as a series of messages.
Axis-aligned rectangle.
TODO: insert short description here.
SPFilterUnits