kiconeffect.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
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
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
This file is part of the documentation for kdecore Library Version 3.2.0.