\section{KIcon\-Effect Class Reference}
\label{classKIconEffect}\index{KIconEffect@{KIconEffect}}
Applies effects to icons.  


{\tt \#include $<$kiconeffect.h$>$}

Collaboration diagram for KIcon\-Effect:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=60pt]{classKIconEffect__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Types}
\begin{CompactItemize}
\item 
enum {\bf Effects} \{ \par
{\bf No\-Effect}, 
{\bf To\-Gray}, 
{\bf Colorize}, 
{\bf To\-Gamma}, 
\par
{\bf De\-Saturate}, 
{\bf Last\-Effect}
 \}
\begin{CompactList}\small\item\em This is the enumeration of all possible icon effects. \item\end{CompactList}\end{CompactItemize}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf KIcon\-Effect} ()
\begin{CompactList}\small\item\em Create a new KIcon\-Effect. \item\end{CompactList}\item 
void {\bf init} ()
\begin{CompactList}\small\item\em Rereads configuration. \item\end{CompactList}\item 
bool {\bf has\-Effect} (int group, int state) const 
\begin{CompactList}\small\item\em Tests whether an effect has been configured for the given icon group. \item\end{CompactList}\item 
{\bf QString} {\bf fingerprint} (int group, int state) const 
\begin{CompactList}\small\item\em Returns a fingerprint for the effect by encoding the given {\tt group} and {\tt state} into a {\bf QString}. \item\end{CompactList}\item 
{\bf QImage} {\bf apply} ({\bf QImage} src, int group, int state) const 
\begin{CompactList}\small\item\em Applies an effect to an image. \item\end{CompactList}\item 
{\bf QImage} {\bf apply} ({\bf QImage} src, int effect, float value, const  {\bf QColor} rgb, bool trans) const 
\begin{CompactList}\small\item\em Applies an effect to an image. \item\end{CompactList}\item 
{\bf QPixmap} {\bf apply} ({\bf QPixmap} src, int group, int state) const 
\begin{CompactList}\small\item\em Applies an effect to a pixmap. \item\end{CompactList}\item 
{\bf QPixmap} {\bf apply} ({\bf QPixmap} src, int effect, float value, const  {\bf QColor} rgb, bool trans) const 
\begin{CompactList}\small\item\em Applies an effect to a pixmap. \item\end{CompactList}\item 
{\bf QImage} {\bf double\-Pixels} ({\bf QImage} src) const 
\begin{CompactList}\small\item\em Returns an image twice as large, consisting of 2x2 pixels. \item\end{CompactList}\end{CompactItemize}
\subsection*{Static Public Member Functions}
\begin{CompactItemize}
\item 
void {\bf visual\-Activate} ({\bf QWidget} $\ast$widget, {\bf QRect} rect)
\begin{CompactList}\small\item\em Provides visual feedback to show activation of an icon on a widget. \item\end{CompactList}\item 
void {\bf to\-Gray} ({\bf QImage} \&image, float value)
\begin{CompactList}\small\item\em Tints an image gray. \item\end{CompactList}\item 
void {\bf colorize} ({\bf QImage} \&image, const  {\bf QColor} \&col, float value)
\begin{CompactList}\small\item\em Colorizes an image with a specific color. \item\end{CompactList}\item 
void {\bf de\-Saturate} ({\bf QImage} \&image, float value)
\begin{CompactList}\small\item\em Desaturates an image. \item\end{CompactList}\item 
void {\bf to\-Gamma} ({\bf QImage} \&image, float value)
\begin{CompactList}\small\item\em Changes the gamma value of an image. \item\end{CompactList}\item 
void {\bf semi\-Transparent} ({\bf QImage} \&image)
\begin{CompactList}\small\item\em Renders an image semi-transparent. \item\end{CompactList}\item 
void {\bf semi\-Transparent} ({\bf QPixmap} \&pixmap)
\begin{CompactList}\small\item\em Renders a pixmap semi-transparent. \item\end{CompactList}\item 
void {\bf overlay} ({\bf QImage} \&src, {\bf QImage} \&overlay)
\begin{CompactList}\small\item\em Overlays an image with an other image. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
Applies effects to icons. 

This class applies effects to icons depending on their state and group. For example, it can be used to make all disabled icons in a toolbar grey. \begin{Desc}
\item[See also:]{\bf KIcon}{\rm (p.\,\pageref{classKIcon})} \end{Desc}




Definition at line 35 of file kiconeffect.h.

\subsection{Member Enumeration Documentation}
\index{KIconEffect@{KIcon\-Effect}!Effects@{Effects}}
\index{Effects@{Effects}!KIconEffect@{KIcon\-Effect}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}enum {\bf KIcon\-Effect::Effects}}\label{classKIconEffect_w6}


This is the enumeration of all possible icon effects. 

Note that 'Last\-Effect' is no valid icon effect but only used internally to check for invalid icon effects.

\begin{itemize}
\item No\-Effect: Don't apply any icon effect \item To\-Gray: Tints the icon gray \item Colorize: Tints the icon with an other color \item To\-Gamma: Change the gamma value if the icon \item De\-Saturate: Reduce the saturation of the icon \end{itemize}


Definition at line 55 of file kiconeffect.h.

\subsection{Constructor \& Destructor Documentation}
\index{KIconEffect@{KIcon\-Effect}!KIconEffect@{KIconEffect}}
\index{KIconEffect@{KIconEffect}!KIconEffect@{KIcon\-Effect}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KIcon\-Effect::KIcon\-Effect ()}\label{classKIconEffect_a0}


Create a new KIcon\-Effect. 



Definition at line 44 of file kiconeffect.cpp.

References init().

\subsection{Member Function Documentation}
\index{KIconEffect@{KIcon\-Effect}!init@{init}}
\index{init@{init}!KIconEffect@{KIcon\-Effect}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KIcon\-Effect::init ()}\label{classKIconEffect_a2}


Rereads configuration. 



Definition at line 55 of file kiconeffect.cpp.

References KGlobal::config(), KConfig\-Base::read\-Bool\-Entry(), KConfig\-Base::read\-Color\-Entry(), KConfig\-Base::read\-Double\-Num\-Entry(), KConfig\-Base::read\-Entry(), and KConfig\-Base::set\-Group().

Referenced by KIcon\-Effect().\index{KIconEffect@{KIcon\-Effect}!hasEffect@{hasEffect}}
\index{hasEffect@{hasEffect}!KIconEffect@{KIcon\-Effect}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KIcon\-Effect::has\-Effect (int {\em group}, int {\em state}) const}\label{classKIconEffect_a3}


Tests whether an effect has been configured for the given icon group. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em group}]the group to check, see {\bf KIcon::Group}{\rm (p.\,\pageref{classKIcon_w36})} \item[{\em state}]the state to check, see {\bf KIcon::States}{\rm (p.\,\pageref{classKIcon_w38})} \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]true if an effect is configured for the given {\tt group} in {\tt state}, otherwise false. \end{Desc}
\begin{Desc}
\item[See also:]{\bf KIcon::Group}{\rm (p.\,\pageref{classKIcon_w36})} {\bf KIcon::States}{\rm (p.\,\pageref{classKIcon_w38})} \end{Desc}


Definition at line 124 of file kiconeffect.cpp.\index{KIconEffect@{KIcon\-Effect}!fingerprint@{fingerprint}}
\index{fingerprint@{fingerprint}!KIconEffect@{KIcon\-Effect}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KIcon\-Effect::fingerprint (int {\em group}, int {\em state}) const}\label{classKIconEffect_a4}


Returns a fingerprint for the effect by encoding the given {\tt group} and {\tt state} into a {\bf QString}. 

This is useful for caching. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em group}]the group, see {\bf KIcon::Group}{\rm (p.\,\pageref{classKIcon_w36})} \item[{\em state}]the state, see {\bf KIcon::States}{\rm (p.\,\pageref{classKIcon_w38})} \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]the fingerprint of the given {\tt group+{\tt state} } \end{Desc}


Definition at line 129 of file kiconeffect.cpp.

References QString::from\-Latin1(), QString::is\-Empty(), and QString::set\-Num().\index{KIconEffect@{KIcon\-Effect}!apply@{apply}}
\index{apply@{apply}!KIconEffect@{KIcon\-Effect}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QImage} KIcon\-Effect::apply ({\bf QImage} {\em src}, int {\em group}, int {\em state}) const}\label{classKIconEffect_a5}


Applies an effect to an image. 

The effect to apply depends on the {\tt group} and {\tt state} parameters, and is configured by the user. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em src}]The image. \item[{\em group}]The group for the icon, see {\bf KIcon::Group}{\rm (p.\,\pageref{classKIcon_w36})} \item[{\em state}]The icon's state, see {\bf KIcon::States}{\rm (p.\,\pageref{classKIcon_w38})} \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]An image with the effect applied. \end{Desc}


Definition at line 154 of file kiconeffect.cpp.

References KIcon::Last\-State.

Referenced by apply().\index{KIconEffect@{KIcon\-Effect}!apply@{apply}}
\index{apply@{apply}!KIconEffect@{KIcon\-Effect}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QImage} KIcon\-Effect::apply ({\bf QImage} {\em src}, int {\em effect}, float {\em value}, const {\bf QColor} {\em rgb}, bool {\em trans}) const}\label{classKIconEffect_a6}


Applies an effect to an image. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em src}]The image. \item[{\em effect}]The effect to apply, one of {\bf KIcon\-Effect::Effects}{\rm (p.\,\pageref{classKIconEffect_w6})}. \item[{\em value}]Strength of the effect. 0 $<$= {\tt value} $<$= 1. \item[{\em color}]Color parameter for effects that need one. \item[{\em trans}]Add Transparency if trans = true. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]An image with the effect applied. \end{Desc}


Definition at line 170 of file kiconeffect.cpp.

References colorize(), de\-Saturate(), semi\-Transparent(), to\-Gamma(), and to\-Gray().\index{KIconEffect@{KIcon\-Effect}!apply@{apply}}
\index{apply@{apply}!KIconEffect@{KIcon\-Effect}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QPixmap} KIcon\-Effect::apply ({\bf QPixmap} {\em src}, int {\em group}, int {\em state}) const}\label{classKIconEffect_a7}


Applies an effect to a pixmap. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em src}]The pixmap. \item[{\em group}]The group for the icon, see {\bf KIcon::Group}{\rm (p.\,\pageref{classKIcon_w36})} \item[{\em state}]The icon's state, see {\bf KIcon::States}{\rm (p.\,\pageref{classKIcon_w38})} \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]A pixmap with the effect applied. \end{Desc}


Definition at line 203 of file kiconeffect.cpp.

References apply(), and KIcon::Last\-State.\index{KIconEffect@{KIcon\-Effect}!apply@{apply}}
\index{apply@{apply}!KIconEffect@{KIcon\-Effect}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QPixmap} KIcon\-Effect::apply ({\bf QPixmap} {\em src}, int {\em effect}, float {\em value}, const {\bf QColor} {\em rgb}, bool {\em trans}) const}\label{classKIconEffect_a8}


Applies an effect to a pixmap. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em src}]The pixmap. \item[{\em effect}]The effect to apply, one of {\bf KIcon\-Effect::Effects}{\rm (p.\,\pageref{classKIconEffect_w6})}. \item[{\em value}]Strength of the effect. 0 $<$= {\tt value} $<$= 1. \item[{\em color}]Color parameter for effects that need one. \item[{\em trans}]Add Transparency if trans = true. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]A pixmap with the effect applied. \end{Desc}


Definition at line 219 of file kiconeffect.cpp.

References apply(), QPixmap::convert\-From\-Image(), QPixmap::convert\-To\-Image(), and semi\-Transparent().\index{KIconEffect@{KIcon\-Effect}!doublePixels@{doublePixels}}
\index{doublePixels@{doublePixels}!KIconEffect@{KIcon\-Effect}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QImage} KIcon\-Effect::double\-Pixels ({\bf QImage} {\em src}) const}\label{classKIconEffect_a9}


Returns an image twice as large, consisting of 2x2 pixels. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em src}]the image. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]the scaled image. \end{Desc}


Definition at line 458 of file kiconeffect.cpp.

References QImage::bytes\-Per\-Line(), QImage::color(), QImage::create(), QImage::depth(), QImage::has\-Alpha\-Buffer(), QImage::height(), QImage::num\-Colors(), QImage::scan\-Line(), QImage::set\-Alpha\-Buffer(), QImage::set\-Color(), and QImage::width().\index{KIconEffect@{KIcon\-Effect}!visualActivate@{visualActivate}}
\index{visualActivate@{visualActivate}!KIconEffect@{KIcon\-Effect}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KIcon\-Effect::visual\-Activate ({\bf QWidget} $\ast$ {\em widget}, {\bf QRect} {\em rect})\hspace{0.3cm}{\tt  [static]}}\label{classKIconEffect_e0}


Provides visual feedback to show activation of an icon on a widget. 

Not strictly an 'icon effect', but in practice that's what it looks like.

This method does nothing if the global 'Visual feedback on activation' option is not activated (See kcontrol/Peripherals/Mouse).

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em widget}]The widget on which the effect should be painted \item[{\em rect}]This rectangle defines the effect's borders \end{description}
\end{Desc}


Definition at line 622 of file kiconeffect.cpp.

References QRect::center(), QPainter::draw\-Rect(), QPainter::flush(), QRect::height(), QPainter::set\-Pen(), QPainter::set\-Raster\-Op(), QRect::set\-Rect(), KGlobal\-Settings::visual\-Activate(), KGlobal\-Settings::visual\-Activate\-Speed(), QRect::width(), QPoint::x(), and QPoint::y().\index{KIconEffect@{KIcon\-Effect}!toGray@{toGray}}
\index{toGray@{toGray}!KIconEffect@{KIcon\-Effect}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KIcon\-Effect::to\-Gray ({\bf QImage} \& {\em image}, float {\em value})\hspace{0.3cm}{\tt  [static]}}\label{classKIconEffect_e1}


Tints an image gray. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em image}]The image \item[{\em value}]Strength of the effect. 0 $<$= {\tt value} $<$= 1 \end{description}
\end{Desc}


Definition at line 250 of file kiconeffect.cpp.

References QImage::bits(), QImage::color\-Table(), QImage::depth(), QImage::height(), QImage::num\-Colors(), and QImage::width().

Referenced by apply().\index{KIconEffect@{KIcon\-Effect}!colorize@{colorize}}
\index{colorize@{colorize}!KIconEffect@{KIcon\-Effect}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KIcon\-Effect::colorize ({\bf QImage} \& {\em image}, const {\bf QColor} \& {\em col}, float {\em value})\hspace{0.3cm}{\tt  [static]}}\label{classKIconEffect_e2}


Colorizes an image with a specific color. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em image}]The image \item[{\em col}]The color with which the {\tt image} is tinted \item[{\em value}]Strength of the effect. 0 $<$= {\tt value} $<$= 1 \end{description}
\end{Desc}


Definition at line 272 of file kiconeffect.cpp.

References QImage::bits(), QColor::blue(), QImage::color\-Table(), QImage::depth(), QColor::green(), QImage::height(), QImage::num\-Colors(), QColor::red(), and QImage::width().

Referenced by apply().\index{KIconEffect@{KIcon\-Effect}!deSaturate@{deSaturate}}
\index{deSaturate@{deSaturate}!KIconEffect@{KIcon\-Effect}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KIcon\-Effect::de\-Saturate ({\bf QImage} \& {\em image}, float {\em value})\hspace{0.3cm}{\tt  [static]}}\label{classKIconEffect_e3}


Desaturates an image. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em image}]The image \item[{\em value}]Strength of the effect. 0 $<$= {\tt value} $<$= 1 \end{description}
\end{Desc}


Definition at line 313 of file kiconeffect.cpp.

References QImage::bits(), QColor::blue(), QImage::color\-Table(), QImage::depth(), QColor::green(), QImage::height(), QImage::num\-Colors(), QColor::red(), QColor::set\-Hsv(), QColor::set\-Rgb(), and QImage::width().

Referenced by apply().\index{KIconEffect@{KIcon\-Effect}!toGamma@{toGamma}}
\index{toGamma@{toGamma}!KIconEffect@{KIcon\-Effect}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KIcon\-Effect::to\-Gamma ({\bf QImage} \& {\em image}, float {\em value})\hspace{0.3cm}{\tt  [static]}}\label{classKIconEffect_e4}


Changes the gamma value of an image. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em image}]The image \item[{\em value}]Strength of the effect. 0 $<$= {\tt value} $<$= 1 \end{description}
\end{Desc}


Definition at line 331 of file kiconeffect.cpp.

References QImage::bits(), QImage::color\-Table(), QImage::depth(), QImage::height(), QImage::num\-Colors(), QColor::rgb(), QColor::set\-Rgb(), and QImage::width().

Referenced by apply().\index{KIconEffect@{KIcon\-Effect}!semiTransparent@{semiTransparent}}
\index{semiTransparent@{semiTransparent}!KIconEffect@{KIcon\-Effect}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KIcon\-Effect::semi\-Transparent ({\bf QImage} \& {\em image})\hspace{0.3cm}{\tt  [static]}}\label{classKIconEffect_e5}


Renders an image semi-transparent. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em image}]The image \end{description}
\end{Desc}


Definition at line 353 of file kiconeffect.cpp.

References QImage::color(), QImage::depth(), QImage::height(), QImage::num\-Colors(), QImage::scan\-Line(), QImage::set\-Alpha\-Buffer(), QImage::set\-Color(), QImage::set\-Pixel(), and QImage::width().

Referenced by apply(), and semi\-Transparent().\index{KIconEffect@{KIcon\-Effect}!semiTransparent@{semiTransparent}}
\index{semiTransparent@{semiTransparent}!KIconEffect@{KIcon\-Effect}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KIcon\-Effect::semi\-Transparent ({\bf QPixmap} \& {\em pixmap})\hspace{0.3cm}{\tt  [static]}}\label{classKIconEffect_e6}


Renders a pixmap semi-transparent. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em image}]The pixmap \end{description}
\end{Desc}


Definition at line 427 of file kiconeffect.cpp.

References QPixmap::convert\-From\-Image(), QPixmap::convert\-To\-Image(), QImage::create(), QImage::fill(), QImage::height(), QPixmap::mask(), QImage::scan\-Line(), semi\-Transparent(), QPixmap::set\-Mask(), QPixmap::size(), and QImage::width().\index{KIconEffect@{KIcon\-Effect}!overlay@{overlay}}
\index{overlay@{overlay}!KIconEffect@{KIcon\-Effect}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KIcon\-Effect::overlay ({\bf QImage} \& {\em src}, {\bf QImage} \& {\em overlay})\hspace{0.3cm}{\tt  [static]}}\label{classKIconEffect_e7}


Overlays an image with an other image. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em src}]The image \item[{\em overlay}]The image to overlay {\tt src} with \end{description}
\end{Desc}


Definition at line 507 of file kiconeffect.cpp.

References QImage::color(), QImage::depth(), QImage::has\-Alpha\-Buffer(), QImage::height(), QImage::num\-Colors(), QImage::scan\-Line(), QImage::set\-Color(), QImage::set\-Num\-Colors(), QImage::size(), and QImage::width().

Referenced by KIcon\-Loader::load\-Icon().

The documentation for this class was generated from the following files:\begin{CompactItemize}
\item 
kiconeffect.h\item 
kiconeffect.cpp\end{CompactItemize}
