KDEUI
kiconeffect.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
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