kdecore Library API Documentation

kiconeffect.h

00001 /* vi: ts=8 sts=4 sw=4
00002  *
00003  * $Id: kiconeffect.h,v 1.27 2004/12/17 08:49:24 binner Exp $
00004  *
00005  * This file is part of the KDE project, module kdecore.
00006  * Copyright (C) 2000 Geert Jansen <jansen@kde.org>
00007  * with minor additions and based on ideas from
00008  * Torsten Rahn <torsten@kde.org>
00009  *
00010  * This is free software; it comes under the GNU Library General
00011  * Public License, version 2. See the file "COPYING.LIB" for the
00012  * exact licensing terms.
00013  */
00014 
00015 #ifndef __KIconEffect_h_Included__
00016 #define __KIconEffect_h_Included__
00017 
00018 #include <qimage.h>
00019 #include <qpixmap.h>
00020 #include <qcolor.h>
00021 #include <qrect.h>
00022 #include "kdelibs_export.h"
00023 
00024 class QWidget;
00025 
00026 class KIconEffectPrivate;
00027 
00036 class KDECORE_EXPORT KIconEffect
00037 {
00038 public:
00042     KIconEffect();
00043     ~KIconEffect();
00044 
00057     enum Effects { NoEffect, ToGray, Colorize, ToGamma, DeSaturate,
00058            LastEffect };
00059 
00063     void init();
00064 
00074     bool hasEffect(int group, int state) const;
00075 
00084      QString fingerprint(int group, int state) const;
00085 
00094     QImage apply(QImage src, int group, int state) const;
00095 
00105     // KDE4: make them references
00106     QImage apply(QImage src, int effect, float value, const QColor rgb, bool trans) const;
00107 
00115     QPixmap apply(QPixmap src, int group, int state) const;
00116 
00126     QPixmap apply(QPixmap src, int effect, float value, const QColor rgb, bool trans) const;
00132     QImage doublePixels(QImage src) const;
00133 
00146     static void visualActivate(QWidget *widget, QRect rect);
00147 
00154     static void toGray(QImage &image, float value);
00155 
00163     static void colorize(QImage &image, const QColor &col, float value);
00164 
00171     static void deSaturate(QImage &image, float value);
00172 
00179     static void toGamma(QImage &image, float value);
00180 
00186     static void semiTransparent(QImage &image);
00187 
00193     static void semiTransparent(QPixmap &pixmap);
00194 
00201     static void overlay(QImage &src, QImage &overlay);
00202 
00203 private:
00204     int mEffect[6][3];
00205     float mValue[6][3];
00206     QColor mColor[6][3];
00207     bool mTrans[6][3];
00208     KIconEffectPrivate *d;
00209 };
00210 
00211 #endif
KDE Logo
This file is part of the documentation for kdecore Library Version 3.3.90.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Mar 30 10:09:39 2005 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2003