]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/kitemviews/private/kpixmapmodifier.h
GIT_SILENT Sync po/docbooks with svn
[dolphin.git] / src / kitemviews / private / kpixmapmodifier.h
index e8ca11ac1bf03ca2f3cd5adbbb8014be8d84e8cf..0d86b01571c18e5502fe24988691ac9b76fb6af8 100644 (file)
@@ -1,21 +1,8 @@
-/***************************************************************************
- *   Copyright (C) 2011 by Peter Penz <peter.penz19@gmail.com>             *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; if not, write to the                         *
- *   Free Software Foundation, Inc.,                                       *
- *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA            *
- ***************************************************************************/
+/*
+ * SPDX-FileCopyrightText: 2011 Peter Penz <peter.penz19@gmail.com>
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
 
 #ifndef KPIXMAPMODIFIER_H
 #define KPIXMAPMODIFIER_H
@@ -28,11 +15,27 @@ class QSize;
 class DOLPHIN_EXPORT KPixmapModifier
 {
 public:
-    static void scale(QPixmap& pixmap, const QSize& scaledSize);
-    static void applyFrame(QPixmap& icon, const QSize& scaledSize);
-    static QSize sizeInsideFrame(const QSize& frameSize);
-};
+    /**
+     * Scale a pixmap to a given size.
+     * @arg scaledSize is assumed to be the scaled to the same device pixel ratio as the source pixmap
+     * @arg scaledSize is in device pixels
+     */
+    static void scale(QPixmap &pixmap, const QSize &scaledSize);
 
-#endif
+    /**
+     * Resize and paint a frame round an icon
+     * @arg scaledSize is in device-independent pixels
+     * The returned image will be scaled by the application devicePixelRatio
+     */
+    static void applyFrame(QPixmap &icon, const QSize &scaledSize);
 
+    /**
+     * return and paint a frame round an icon
+     * @arg framesize is in device-independent pixels
+     * @return is in device-independent pixels
+     */
 
+    static QSize sizeInsideFrame(const QSize &frameSize);
+};
+
+#endif