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

KDEUI

kiconeffect.h

Go to the documentation of this file.
00001 /* vi: ts=8 sts=4 sw=4
00002  *
00003  * This file is part of the KDE project, module kdecore.
00004  * Copyright (C) 2000 Geert Jansen <jansen@kde.org>
00005  * Copyright (C) 2007 Daniel M. Duley <daniel.duley@verizon.net>
00006  * with minor additions and based on ideas from
00007  * Torsten Rahn <torsten@kde.org>
00008  *
00009  * This library is free software; you can redistribute it and/or
00010  * modify it under the terms of the GNU Library General Public
00011  * License version 2 as published by the Free Software Foundation.
00012  *
00013  * This library is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00016  * Library General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU Library General Public License
00019  * along with this library; see the file COPYING.LIB.  If not, write to
00020  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00021  * Boston, MA 02110-1301, USA.
00022  */
00023 
00024 #ifndef KICONEFFECT_H
00025 #define KICONEFFECT_H
00026 
00027 #include <kdeui_export.h>
00028 
00029 #include <QtGui/QImage>
00030 #include <QtGui/QPixmap>
00031 #include <QtGui/QColor>
00032 #include <QtCore/QRect>
00033 
00034 class KIconEffectPrivate;
00035 
00047 class KDEUI_EXPORT KIconEffect
00048 {
00049 public:
00057     KIconEffect();
00058     ~KIconEffect();
00059 
00072     enum Effects { NoEffect, ToGray, Colorize, ToGamma, DeSaturate,
00073                    ToMonochrome,
00074                    LastEffect };
00075 
00079     void init();
00080 
00090     bool hasEffect(int group, int state) const;
00091 
00100      QString fingerprint(int group, int state) const;
00101 
00110     QImage apply(const QImage &src, int group, int state) const;
00111 
00121     QImage apply(const QImage &src, int effect, float value, const QColor &rgb, bool trans) const;
00122     QImage apply(const QImage &src, int effect, float value, const QColor &rgb, const QColor &rgb2, bool trans) const;
00123 
00131     QPixmap apply(const QPixmap &src, int group, int state) const;
00132 
00142     QPixmap apply(const QPixmap &src, int effect, float value, const QColor &rgb, bool trans) const;
00143     QPixmap apply(const QPixmap &src, int effect, float value, const QColor &rgb, const QColor &rgb2, bool trans) const;
00144 
00150     QImage doublePixels(const QImage &src) const;
00151 
00158     static void toGray(QImage &image, float value);
00159 
00167     static void colorize(QImage &image, const QColor &col, float value);
00168 
00177     static void toMonochrome(QImage &image, const QColor &black, const QColor &white, float value);
00178 
00185     static void deSaturate(QImage &image, float value);
00186 
00193     static void toGamma(QImage &image, float value);
00194 
00200     static void semiTransparent(QImage &image);
00201 
00207     static void semiTransparent(QPixmap &pixmap);
00208 
00215     static void overlay(QImage &src, QImage &overlay);
00216 
00217 private:
00218     KIconEffectPrivate* const d;
00219 };
00220 
00221 #endif

KDEUI

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

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • 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
Generated for kdelibs by doxygen 1.7.3
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal