libkipi from trunk (KDE 4.3) : add support of kipi host settings "file timestamp...
[kdegraphics.git] / gwenview / lib / paintutils.h
blob3c47a909f355350f2457950248b567f0a213b80d
1 /*
2 Gwenview: an image viewer
3 Copyright 2007 Aurélien Gâteau <aurelien.gateau@free.fr>
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License
7 as published by the Free Software Foundation; either version 2
8 of the License, or (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 #ifndef PAINTUTILS_H
21 #define PAINTUTILS_H
23 #include <lib/gwenviewlib_export.h>
26 class QColor;
27 class QPainterPath;
28 class QPixmap;
29 class QRect;
30 class QRectF;
31 class QSize;
33 namespace Gwenview {
35 /**
36 * A collection of independent painting functions
38 namespace PaintUtils {
40 /**
41 * Returns a rounded-corner version of @rect. Corner radius is @p radius.
42 * (Copied from KFileItemDelegate)
44 GWENVIEWLIB_EXPORT QPainterPath roundedRectangle(const QRectF& rect, qreal radius);
46 /**
47 * Generates a pixmap of size @p size, filled with @p color, whose borders have
48 * been blurred by @p radius pixels.
50 GWENVIEWLIB_EXPORT QPixmap generateFuzzyRect(const QSize& size, const QColor& color, int radius);
52 /**
53 * Returns a modified version of @p color, where hue, saturation and value have
54 * been adjusted according to @p deltaH, @p deltaS and @p deltaV.
56 GWENVIEWLIB_EXPORT QColor adjustedHsv(const QColor& color, int deltaH, int deltaS, int deltaV);
58 /**
59 * Returns a modified version of @p color, where alpha has been set to @p
60 * alphaF.
62 GWENVIEWLIB_EXPORT QColor alphaAdjustedF(const QColor& color, qreal alphaF);
64 /**
65 * Returns the smallest QRect which contains @p rectF
67 GWENVIEWLIB_EXPORT QRect containingRect(const QRectF& rectF);
69 } // namespace
71 } // namespace
73 #endif /* PAINTUTILS_H */