\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=51pt]{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 To\-Monochrome}, 
{\bf Last\-Effect}
 \}
\end{CompactItemize}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf KIcon\-Effect} ()
\item 
void {\bf init} ()
\item 
bool {\bf has\-Effect} (int group, int state) const 
\item 
{\bf QString} {\bf fingerprint} (int group, int state) const 
\item 
{\bf QImage} {\bf apply} ({\bf QImage} src, int group, int state) const 
\item 
{\bf QImage} {\bf apply} ({\bf QImage} src, int effect, float value, const {\bf QColor} rgb, bool trans) const 
\item 
{\bf QImage} {\bf apply} ({\bf QImage} src, int effect, float value, const {\bf QColor} rgb, const {\bf QColor} rgb2, bool trans) const 
\item 
{\bf QPixmap} {\bf apply} ({\bf QPixmap} src, int group, int state) const 
\item 
{\bf QPixmap} {\bf apply} ({\bf QPixmap} src, int effect, float value, const {\bf QColor} rgb, bool trans) const 
\item 
{\bf QPixmap} {\bf apply} ({\bf QPixmap} src, int effect, float value, const {\bf QColor} rgb, const {\bf QColor} rgb2, bool trans) const 
\item 
{\bf QImage} {\bf double\-Pixels} ({\bf QImage} src) const 
\end{CompactItemize}
\subsection*{Static Public Member Functions}
\begin{CompactItemize}
\item 
static void {\bf visual\-Activate} ({\bf QWidget} $\ast$widget, {\bf QRect} rect)
\item 
static void {\bf to\-Gray} ({\bf QImage} \&image, float value)
\item 
static void {\bf colorize} ({\bf QImage} \&image, const {\bf QColor} \&col, float value)
\item 
static void {\bf to\-Monochrome} ({\bf QImage} \&image, const {\bf QColor} \&black, const {\bf QColor} \&white, float value)
\item 
static void {\bf de\-Saturate} ({\bf QImage} \&image, float value)
\item 
static void {\bf to\-Gamma} ({\bf QImage} \&image, float value)
\item 
static void {\bf semi\-Transparent} ({\bf QImage} \&image)
\item 
static void {\bf semi\-Transparent} ({\bf QPixmap} \&pixmap)
\item 
static void {\bf overlay} ({\bf QImage} \&src, {\bf QImage} \&overlay)
\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 gray. \begin{Desc}
\item[See also:]{\bf KIcon}{\rm (p.\,\pageref{classKIcon})} \end{Desc}




Definition at line 34 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_w7}


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 of the icon \item De\-Saturate: Reduce the saturation of the icon \item To\-Monochrome: Produces a monochrome icon \end{itemize}
\begin{Desc}
\item[Enumeration values: ]\par
\begin{description}
\index{ToMonochrome@{ToMonochrome}!KIconEffect@{KIconEffect}}\index{KIconEffect@{KIconEffect}!ToMonochrome@{ToMonochrome}}\item[{\em 
To\-Monochrome\label{classKIconEffect_w7w5}
}]\begin{Desc}
\item[Since:]3.4 \end{Desc}
\end{description}
\end{Desc}



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 49 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 61 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(), KConfig\-Base::set\-Group(), and To\-Monochrome.

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_w39})} \item[{\em state}]the state to check, see {\bf KIcon::States}{\rm (p.\,\pageref{classKIcon_w41})} \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_w39})} {\bf KIcon::States}{\rm (p.\,\pageref{classKIcon_w41})} \end{Desc}


Definition at line 137 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_w39})} \item[{\em state}]the state, see {\bf KIcon::States}{\rm (p.\,\pageref{classKIcon_w41})} \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]the fingerprint of the given {\tt group+{\tt state} } \end{Desc}


Definition at line 142 of file kiconeffect.cpp.

References QString::from\-Latin1(), QString::is\-Empty(), QColor::name(), QString::set\-Num(), and To\-Monochrome.\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_w39})} \item[{\em state}]The icon's state, see {\bf KIcon::States}{\rm (p.\,\pageref{classKIcon_w41})} \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]An image with the effect applied. \end{Desc}


Definition at line 172 of file kiconeffect.cpp.

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_w7})}. \item[{\em value}]Strength of the effect. 0 $<$= {\tt value} $<$= 1. \item[{\em rgb}]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 188 of file kiconeffect.cpp.

References 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}, const {\bf QColor} {\em rgb2}, bool {\em trans}) const}\label{classKIconEffect_a7}


\begin{Desc}
\item[Since:]3.4 \end{Desc}




Definition at line 193 of file kiconeffect.cpp.

References colorize(), de\-Saturate(), semi\-Transparent(), to\-Gamma(), to\-Gray(), to\-Monochrome(), and To\-Monochrome.\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_a8}


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_w39})} \item[{\em state}]The icon's state, see {\bf KIcon::States}{\rm (p.\,\pageref{classKIcon_w41})} \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]A pixmap with the effect applied. \end{Desc}


Definition at line 229 of file kiconeffect.cpp.

References apply().\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_a9}


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_w7})}. \item[{\em value}]Strength of the effect. 0 $<$= {\tt value} $<$= 1. \item[{\em rgb}]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 245 of file kiconeffect.cpp.

References apply().\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}, const {\bf QColor} {\em rgb2}, bool {\em trans}) const}\label{classKIconEffect_a10}


\begin{Desc}
\item[Since:]3.4 \end{Desc}




Definition at line 251 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_a11}


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 540 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 704 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\-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 282 of file kiconeffect.cpp.

References QPixmap::depth(), QPixmap::height(), and QPixmap::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 304 of file kiconeffect.cpp.

References QPixmap::depth(), QPixmap::height(), and QPixmap::width().

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


Produces a monochrome icon with a given foreground and background color. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em image}]The image \item[{\em white}]The color with which the white parts of {\tt image} are painted \item[{\em black}]The color with which the black parts of {\tt image} are painted \item[{\em value}]Strength of the effect. 0 $<$= {\tt value} $<$= 1 \end{description}
\end{Desc}
\begin{Desc}
\item[Since:]3.4 \end{Desc}


Definition at line 345 of file kiconeffect.cpp.

References QPixmap::depth(), QPixmap::height(), and QPixmap::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_e4}


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 395 of file kiconeffect.cpp.

References QColor::blue(), QColor::green(), QPixmap::height(), QColor::red(), QColor::set\-Hsv(), QColor::set\-Rgb(), and QPixmap::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_e5}


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 413 of file kiconeffect.cpp.

References QColor::rgb(), and QColor::set\-Rgb().

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_e6}


Renders an image semi-transparent. 

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


Definition at line 435 of file kiconeffect.cpp.

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_e7}


Renders a pixmap semi-transparent. 

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


Definition at line 509 of file kiconeffect.cpp.

References QImage::create(), QImage::fill(), QImage::height(), QImage::scan\-Line(), semi\-Transparent(), 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_e8}


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 589 of file kiconeffect.cpp.

References overlay().

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

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