File indexing completed on 2024-05-05 08:25:41
0001 /* 0002 Gwenview: an image viewer 0003 Copyright 2007 Aurélien Gâteau <agateau@kde.org> 0004 0005 This program is free software; you can redistribute it and/or 0006 modify it under the terms of the GNU General Public License 0007 as published by the Free Software Foundation; either version 2 0008 of the License, or (at your option) any later version. 0009 0010 This program is distributed in the hope that it will be useful, 0011 but WITHOUT ANY WARRANTY; without even the implied warranty of 0012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 0013 GNU General Public License for more details. 0014 0015 You should have received a copy of the GNU General Public License 0016 along with this program; if not, write to the Free Software 0017 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 0018 0019 */ 0020 #ifndef PAINTUTILS_H 0021 #define PAINTUTILS_H 0022 0023 #include <QtGlobal> 0024 #include <lib/gwenviewlib_export.h> 0025 class QColor; 0026 class QPainterPath; 0027 class QPixmap; 0028 class QRect; 0029 class QRectF; 0030 class QSize; 0031 0032 namespace Gwenview 0033 { 0034 /** 0035 * A collection of independent painting functions 0036 */ 0037 namespace PaintUtils 0038 { 0039 /** 0040 * Returns a rounded-corner version of @rect. Corner radius is @p radius. 0041 * (Copied from KFileItemDelegate) 0042 */ 0043 GWENVIEWLIB_EXPORT QPainterPath roundedRectangle(const QRectF &rect, qreal radius); 0044 0045 /** 0046 * Generates a pixmap of size @p size, filled with @p color, whose borders have 0047 * been blurred by @p radius pixels. 0048 */ 0049 GWENVIEWLIB_EXPORT QPixmap generateFuzzyRect(const QSize &size, const QColor &color, int radius); 0050 0051 /** 0052 * Returns a modified version of @p color, where hue, saturation and value have 0053 * been adjusted according to @p deltaH, @p deltaS and @p deltaV. 0054 */ 0055 GWENVIEWLIB_EXPORT QColor adjustedHsv(const QColor &color, int deltaH, int deltaS, int deltaV); 0056 0057 /** 0058 * Returns a modified version of @p color, where alpha has been set to @p 0059 * alphaF. 0060 */ 0061 GWENVIEWLIB_EXPORT QColor alphaAdjustedF(const QColor &color, qreal alphaF); 0062 0063 } // namespace 0064 0065 } // namespace 0066 0067 #endif /* PAINTUTILS_H */