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.
23 #include <lib/gwenviewlib_export.h>
36 * A collection of independent painting functions
38 namespace PaintUtils
{
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
);
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
);
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
);
59 * Returns a modified version of @p color, where alpha has been set to @p
62 GWENVIEWLIB_EXPORT QColor
alphaAdjustedF(const QColor
& color
, qreal alphaF
);
65 * Returns the smallest QRect which contains @p rectF
67 GWENVIEWLIB_EXPORT QRect
containingRect(const QRectF
& rectF
);
73 #endif /* PAINTUTILS_H */