kdecore Library API Documentation

kiconeffect.h

00001 /* vi: ts=8 sts=4 sw=4 00002 * 00003 * $Id: kiconeffect.h,v 1.23 2003/09/06 19:06:29 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 00023 class QWidget; 00024 00025 class KIconEffectPrivate; 00026 00035 class KIconEffect 00036 { 00037 public: 00041 KIconEffect(); 00042 ~KIconEffect(); 00043 00055 enum Effects { NoEffect, ToGray, Colorize, ToGamma, DeSaturate, LastEffect }; 00056 00060 void init(); 00061 00071 bool hasEffect(int group, int state) const; 00072 00081 QString fingerprint(int group, int state) const; 00082 00091 QImage apply(QImage src, int group, int state) const; 00092 00102 // KDE4: make them references 00103 QImage apply(QImage src, int effect, float value, const QColor rgb, bool trans) const; 00104 00112 QPixmap apply(QPixmap src, int group, int state) const; 00113 00123 QPixmap apply(QPixmap src, int effect, float value, const QColor rgb, bool trans) const; 00124 00130 QImage doublePixels(QImage src) const; 00131 00144 static void visualActivate(QWidget *widget, QRect rect); 00145 00152 static void toGray(QImage &image, float value); 00153 00161 static void colorize(QImage &image, const QColor &col, float value); 00162 00169 static void deSaturate(QImage &image, float value); 00170 00177 static void toGamma(QImage &image, float value); 00178 00184 static void semiTransparent(QImage &image); 00185 00191 static void semiTransparent(QPixmap &pixmap); 00192 00199 static void overlay(QImage &src, QImage &overlay); 00200 00201 private: 00202 int mEffect[6][3]; 00203 float mValue[6][3]; 00204 QColor mColor[6][3]; 00205 bool mTrans[6][3]; 00206 KIconEffectPrivate *d; 00207 }; 00208 00209 #endif
KDE Logo
This file is part of the documentation for kdecore Library Version 3.3.0.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Sep 29 09:43:10 2004 by doxygen 1.3.8 written by Dimitri van Heesch, © 1997-2003