• Skip to content
  • Skip to link menu
KDE 4.1 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • 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 
00044 class KDEUI_EXPORT KIconEffect
00045 {
00046 public:
00050     KIconEffect();
00051     ~KIconEffect();
00052 
00065     enum Effects { NoEffect, ToGray, Colorize, ToGamma, DeSaturate,
00066                    ToMonochrome,
00067                    LastEffect };
00068 
00072     void init();
00073 
00083     bool hasEffect(int group, int state) const;
00084 
00093      QString fingerprint(int group, int state) const;
00094 
00103     QImage apply(const QImage &src, int group, int state) const;
00104 
00114     QImage apply(const QImage &src, int effect, float value, const QColor &rgb, bool trans) const;
00115     QImage apply(const QImage &src, int effect, float value, const QColor &rgb, const QColor &rgb2, bool trans) const;
00116 
00124     QPixmap apply(const QPixmap &src, int group, int state) const;
00125 
00135     QPixmap apply(const QPixmap &src, int effect, float value, const QColor &rgb, bool trans) const;
00136     QPixmap apply(const QPixmap &src, int effect, float value, const QColor &rgb, const QColor &rgb2, bool trans) const;
00137 
00143     QImage doublePixels(const QImage &src) const;
00144 
00151     static void toGray(QImage &image, float value);
00152 
00160     static void colorize(QImage &image, const QColor &col, float value);
00161 
00170     static void toMonochrome(QImage &image, const QColor &black, const QColor &white, float value);
00171 
00178     static void deSaturate(QImage &image, float value);
00179 
00186     static void toGamma(QImage &image, float value);
00187 
00193     static void semiTransparent(QImage &image);
00194 
00200     static void semiTransparent(QPixmap &pixmap);
00201 
00208     static void overlay(QImage &src, QImage &overlay);
00209 
00210 private:
00211     KIconEffectPrivate* const d;
00212 };
00213 
00214 #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
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • KIO
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.4
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