1 #ifndef SEEN_NR_RECT_OPS_H
2 #define SEEN_NR_RECT_OPS_H
4 /*
5 * Rect operators
6 *
7 * Copyright 2004 MenTaLguY <mental@rydia.net>,
8 * bulia byak <buliabyak@users.sf.net>
9 *
10 * This code is licensed under the GNU GPL; see COPYING for more information.
11 */
13 #include <libnr/nr-rect.h>
15 namespace NR {
17 inline Rect expand(Rect const &r, double by) {
18 NR::Point const p(by, by);
19 return Rect(r.min() + p, r.max() - p);
20 }
22 inline Rect expand(Rect const &r, NR::Point by) {
23 return Rect(r.min() + by, r.max() - by);
24 }
26 #if 0
27 inline ConvexHull operator*(Rect const &r, Matrix const &m) {
28 /* FIXME: no mention of m. Should probably be made non-inline. */
29 ConvexHull points(r.corner(0));
30 for ( unsigned i = 1 ; i < 4 ; i++ ) {
31 points.add(r.corner(i));
32 }
33 return points;
34 }
35 #endif
37 } /* namespace NR */
40 #endif /* !SEEN_NR_RECT_OPS_H */
42 /*
43 Local Variables:
44 mode:c++
45 c-file-style:"stroustrup"
46 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
47 indent-tabs-mode:nil
48 fill-column:99
49 End:
50 */
51 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :