┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/kitemviews/private/kpixmapmodifier.h
blob: 0d86b01571c18e5502fe24988691ac9b76fb6af8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*
 * SPDX-FileCopyrightText: 2011 Peter Penz <[email protected]>
 *
 * SPDX-License-Identifier: GPL-2.0-or-later
 */

#ifndef KPIXMAPMODIFIER_H
#define KPIXMAPMODIFIER_H

#include "dolphin_export.h"

class QPixmap;
class QSize;

class DOLPHIN_EXPORT KPixmapModifier
{
public:
    /**
     * 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);

    /**
     * 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