KIconThemes

kiconeffect.h
1 /* vi: ts=8 sts=4 sw=4
2 
3  This file is part of the KDE project, module kdecore.
4  SPDX-FileCopyrightText: 2000 Geert Jansen <[email protected]>
5  SPDX-FileCopyrightText: 2007 Daniel M. Duley <[email protected]>
6 
7  with minor additions and based on ideas from
8  SPDX-FileContributor: Torsten Rahn <[email protected]>
9 
10  SPDX-License-Identifier: LGPL-2.0-only
11 */
12 
13 #ifndef KICONEFFECT_H
14 #define KICONEFFECT_H
15 
16 #include <kiconthemes_export.h>
17 
18 #include <QImage>
19 #include <QPixmap>
20 #include <QColor>
21 
22 class KIconEffectPrivate;
23 
37 class KICONTHEMES_EXPORT KIconEffect
38 {
39 public:
47  KIconEffect();
48  ~KIconEffect();
49 
50  KIconEffect(const KIconEffect &) = delete;
51  KIconEffect &operator=(const KIconEffect &) = delete;
52 
65  enum Effects { NoEffect, ToGray, Colorize, ToGamma, DeSaturate,
66  ToMonochrome,
67  LastEffect
68  };
69 
73  void init();
74 
84  bool hasEffect(int group, int state) const;
85 
94  QString fingerprint(int group, int state) const;
95 
104  QImage apply(const QImage &src, int group, int state) const;
105 
115  QImage apply(const QImage &src, int effect, float value, const QColor &rgb, bool trans) const;
116  QImage apply(const QImage &src, int effect, float value, const QColor &rgb, const QColor &rgb2, bool trans) const;
117 
125  QPixmap apply(const QPixmap &src, int group, int state) const;
126 
136  QPixmap apply(const QPixmap &src, int effect, float value, const QColor &rgb, bool trans) const;
137  QPixmap apply(const QPixmap &src, int effect, float value, const QColor &rgb, const QColor &rgb2, bool trans) const;
138 
144  QImage doublePixels(const QImage &src) const;
145 
152  static void toGray(QImage &image, float value);
153 
161  static void colorize(QImage &image, const QColor &col, float value);
162 
171  static void toMonochrome(QImage &image, const QColor &black, const QColor &white, float value);
172 
179  static void deSaturate(QImage &image, float value);
180 
187  static void toGamma(QImage &image, float value);
188 
194  static void semiTransparent(QImage &image);
195 
201  static void semiTransparent(QPixmap &pixmap);
202 
209  static void overlay(QImage &src, QImage &overlay);
210 
211 private:
212  KIconEffectPrivate *const d;
213 };
214 
215 #endif
QCA_EXPORT void init()
Applies effects to icons.
Definition: kiconeffect.h:37
Effects
This is the enumeration of all possible icon effects.
Definition: kiconeffect.h:65
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat Nov 21 2020 22:42:01 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.