• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

KDEUI

  • kdeui
  • icons
kiconeffect.h
Go to the documentation of this file.
1/* vi: ts=8 sts=4 sw=4
2 *
3 * This file is part of the KDE project, module kdecore.
4 * Copyright (C) 2000 Geert Jansen <jansen@kde.org>
5 * Copyright (C) 2007 Daniel M. Duley <daniel.duley@verizon.net>
6 * with minor additions and based on ideas from
7 * Torsten Rahn <torsten@kde.org>
8 *
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public
11 * License version 2 as published by the Free Software Foundation.
12 *
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Library General Public License for more details.
17 *
18 * You should have received a copy of the GNU Library General Public License
19 * along with this library; see the file COPYING.LIB. If not, write to
20 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 * Boston, MA 02110-1301, USA.
22 */
23
24#ifndef KICONEFFECT_H
25#define KICONEFFECT_H
26
27#include <kdeui_export.h>
28
29#include <QtGui/QImage>
30#include <QtGui/QPixmap>
31#include <QtGui/QColor>
32#include <QtCore/QRect>
33
34class KIconEffectPrivate;
35
47class KDEUI_EXPORT KIconEffect
48{
49public:
57 KIconEffect();
58 ~KIconEffect();
59
72 enum Effects { NoEffect, ToGray, Colorize, ToGamma, DeSaturate,
73 ToMonochrome,
74 LastEffect };
75
79 void init();
80
90 bool hasEffect(int group, int state) const;
91
100 QString fingerprint(int group, int state) const;
101
110 QImage apply(const QImage &src, int group, int state) const;
111
121 QImage apply(const QImage &src, int effect, float value, const QColor &rgb, bool trans) const;
122 QImage apply(const QImage &src, int effect, float value, const QColor &rgb, const QColor &rgb2, bool trans) const;
123
131 QPixmap apply(const QPixmap &src, int group, int state) const;
132
142 QPixmap apply(const QPixmap &src, int effect, float value, const QColor &rgb, bool trans) const;
143 QPixmap apply(const QPixmap &src, int effect, float value, const QColor &rgb, const QColor &rgb2, bool trans) const;
144
150 QImage doublePixels(const QImage &src) const;
151
158 static void toGray(QImage &image, float value);
159
167 static void colorize(QImage &image, const QColor &col, float value);
168
177 static void toMonochrome(QImage &image, const QColor &black, const QColor &white, float value);
178
185 static void deSaturate(QImage &image, float value);
186
193 static void toGamma(QImage &image, float value);
194
200 static void semiTransparent(QImage &image);
201
207 static void semiTransparent(QPixmap &pixmap);
208
215 static void overlay(QImage &src, QImage &overlay);
216
217private:
218 KIconEffectPrivate* const d;
219};
220
221#endif
KIconEffect
Applies effects to icons.
Definition: kiconeffect.h:48
KIconEffect::Effects
Effects
This is the enumeration of all possible icon effects.
Definition: kiconeffect.h:72
KIconEffect::Colorize
@ Colorize
Definition: kiconeffect.h:72
KIconEffect::ToMonochrome
@ ToMonochrome
Definition: kiconeffect.h:73
kdeui_export.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDEUI

Skip menu "KDEUI"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal