\section{KPixmap\-Effect Class Reference}
\label{classKPixmapEffect}\index{KPixmapEffect@{KPixmapEffect}}
This class includes various pixmap-based graphical effects.  


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

\subsection*{Public Types}
\begin{CompactItemize}
\item 
enum {\bf Gradient\-Type} \{ \par
{\bf Vertical\-Gradient}, 
{\bf Horizontal\-Gradient}, 
{\bf Diagonal\-Gradient}, 
{\bf Cross\-Diagonal\-Gradient}, 
\par
{\bf Pyramid\-Gradient}, 
{\bf Rectangle\-Gradient}, 
{\bf Pipe\-Cross\-Gradient}, 
{\bf Elliptic\-Gradient}
 \}
\item 
enum {\bf RGBComponent} \{ {\bf Red}, 
{\bf Green}, 
{\bf Blue}
 \}
\item 
enum {\bf Lighting} \{ \par
{\bf North\-Lite}, 
{\bf NWLite}, 
{\bf West\-Lite}, 
{\bf SWLite}, 
\par
{\bf South\-Lite}, 
{\bf SELite}, 
{\bf East\-Lite}, 
{\bf NELite}
 \}
\end{CompactItemize}
\subsection*{Static Public Member Functions}
\begin{CompactItemize}
\item 
static {\bf KPixmap} \& {\bf gradient} ({\bf KPixmap} \&pixmap, const {\bf QColor} \&ca, const {\bf QColor} \&cb, Gradient\-Type type, int ncols=3)
\item 
static {\bf KPixmap} \& {\bf unbalanced\-Gradient} ({\bf KPixmap} \&pixmap, const {\bf QColor} \&ca, const {\bf QColor} \&cb, Gradient\-Type type, int xfactor=100, int yfactor=100, int ncols=3)
\item 
static {\bf KPixmap} {\bf create\-Tiled} (const {\bf KPixmap} \&pixmap, {\bf QSize} size)
\item 
static {\bf KPixmap} \& {\bf intensity} ({\bf KPixmap} \&pixmap, float ratio)
\item 
static {\bf KPixmap} \& {\bf channel\-Intensity} ({\bf KPixmap} \&pixmap, float ratio, RGBComponent channel)
\item 
static {\bf KPixmap} \& {\bf blend} ({\bf KPixmap} \&pixmap, float initial\_\-intensity, const {\bf QColor} \&bgnd, Gradient\-Type eff, bool anti\_\-dir=false, int ncols=3)
\item 
static {\bf KPixmap} \& {\bf hash} ({\bf KPixmap} \&pixmap, Lighting lite=North\-Lite, unsigned int spacing=0, int ncols=3)
\item 
static {\bf KPixmap} {\bf pattern} (const {\bf KPixmap} \&pixmap, {\bf QSize} size, const {\bf QColor} \&ca, const {\bf QColor} \&cb, int ncols=8)
\item 
static {\bf KPixmap} \& {\bf fade} ({\bf KPixmap} \&pixmap, double val, const {\bf QColor} \&color)
\item 
static {\bf KPixmap} \& {\bf to\-Gray} ({\bf KPixmap} \&pixmap, bool fast=false)
\item 
static {\bf KPixmap} \& {\bf desaturate} ({\bf KPixmap} \&pixmap, float desat=0.3)
\item 
static {\bf KPixmap} \& {\bf contrast} ({\bf KPixmap} \&pixmap, int c)
\item 
static {\bf KPixmap} \& {\bf dither} ({\bf KPixmap} \&pixmap, const {\bf QColor} $\ast$palette, int size)
\item 
static {\bf KPixmap} {\bf selected\-Pixmap} (const {\bf KPixmap} \&pixmap, const {\bf QColor} \&col)
\end{CompactItemize}


\subsection{Detailed Description}
This class includes various pixmap-based graphical effects. 

Everything is static, so there is no need to create an instance of this class. You can just call the static methods. They are encapsulated here merely to provide a common namespace. 



Definition at line 27 of file kpixmapeffect.h.

\subsection{Member Function Documentation}
\index{KPixmapEffect@{KPixmap\-Effect}!gradient@{gradient}}
\index{gradient@{gradient}!KPixmapEffect@{KPixmap\-Effect}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KPixmap} \& KPixmap\-Effect::gradient ({\bf KPixmap} \& {\em pixmap}, const {\bf QColor} \& {\em ca}, const {\bf QColor} \& {\em cb}, Gradient\-Type {\em type}, int {\em ncols} = {\tt 3})\hspace{0.3cm}{\tt  [static]}}\label{classKPixmapEffect_e0}


Creates a gradient from color a to color b of the specified type. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em pixmap}]The pixmap to process. \item[{\em ca}]Color a. \item[{\em cb}]Color b. \item[{\em type}]The type of gradient. \item[{\em ncols}]The number of colors to use when not running on a truecolor display. The gradient will be dithered to this number of colors. Pass 0 to prevent dithering. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Returns the generated pixmap, for convenience. \end{Desc}


Definition at line 24 of file kpixmapeffect.cpp.

References QPainter::draw\-Line(), KImage\-Effect::gradient(), and QPainter::set\-Pen().\index{KPixmapEffect@{KPixmap\-Effect}!unbalancedGradient@{unbalancedGradient}}
\index{unbalancedGradient@{unbalancedGradient}!KPixmapEffect@{KPixmap\-Effect}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KPixmap} \& KPixmap\-Effect::unbalanced\-Gradient ({\bf KPixmap} \& {\em pixmap}, const {\bf QColor} \& {\em ca}, const {\bf QColor} \& {\em cb}, Gradient\-Type {\em type}, int {\em xfactor} = {\tt 100}, int {\em yfactor} = {\tt 100}, int {\em ncols} = {\tt 3})\hspace{0.3cm}{\tt  [static]}}\label{classKPixmapEffect_e1}


Creates an unbalanced gradient. 

An unbalanced gradient is a gradient where the transition from color a to color b is not linear, but in this case, exponential.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em pixmap}]The pixmap that should be written. \item[{\em ca}]Color a. \item[{\em cb}]Color b. \item[{\em type}]The type of gradient. \item[{\em xfactor}]The x decay length. Use a value between -200 and 200. \item[{\em yfactor}]The y decay length. \item[{\em ncols}]The number of colors. See {\bf gradient}{\rm (p.\,\pageref{classKPixmapEffect_e0})}. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]The generated pixmap, for convencience. \end{Desc}


Definition at line 88 of file kpixmapeffect.cpp.

References KImage\-Effect::unbalanced\-Gradient().\index{KPixmapEffect@{KPixmap\-Effect}!createTiled@{createTiled}}
\index{createTiled@{createTiled}!KPixmapEffect@{KPixmap\-Effect}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KPixmap} KPixmap\-Effect::create\-Tiled (const {\bf KPixmap} \& {\em pixmap}, {\bf QSize} {\em size})\hspace{0.3cm}{\tt  [static]}}\label{classKPixmapEffect_e2}


Creates a pixmap of a given size with the given pixmap. 

if the given size is bigger than the size of the pixmap, the pixmap is tiled.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em pixmap}]This is the source pixmap \item[{\em size}]The size the new pixmap should have. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]The generated, tiled pixmap. \end{Desc}


Definition at line 240 of file kpixmapeffect.cpp.

References QPainter::draw\-Tiled\-Pixmap(), QSize::height(), and QSize::width().

Referenced by pattern().\index{KPixmapEffect@{KPixmap\-Effect}!intensity@{intensity}}
\index{intensity@{intensity}!KPixmapEffect@{KPixmap\-Effect}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KPixmap} \& KPixmap\-Effect::intensity ({\bf KPixmap} \& {\em pixmap}, float {\em ratio})\hspace{0.3cm}{\tt  [static]}}\label{classKPixmapEffect_e3}


Either brightens or dims a pixmap by a specified ratio. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em pixmap}]The pixmap to process. \item[{\em ratio}]The ratio to use. Use negative value to dim. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Returns The pixmap(), provided for convenience. \end{Desc}


Definition at line 109 of file kpixmapeffect.cpp.

References QPixmap::convert\-To\-Image(), and KImage\-Effect::intensity().\index{KPixmapEffect@{KPixmap\-Effect}!channelIntensity@{channelIntensity}}
\index{channelIntensity@{channelIntensity}!KPixmapEffect@{KPixmap\-Effect}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KPixmap} \& KPixmap\-Effect::channel\-Intensity ({\bf KPixmap} \& {\em pixmap}, float {\em ratio}, RGBComponent {\em channel})\hspace{0.3cm}{\tt  [static]}}\label{classKPixmapEffect_e4}


Modifies the intensity of a pixmap's RGB channel component. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em pixmap}]The pixmap to process. \item[{\em ratio}]value. Use negative value to dim. \item[{\em channel}]Which channel(s) should be modified \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Returns the pixmap(), provided for convenience. \end{Desc}


Definition at line 121 of file kpixmapeffect.cpp.

References KImage\-Effect::channel\-Intensity(), and QPixmap::convert\-To\-Image().\index{KPixmapEffect@{KPixmap\-Effect}!blend@{blend}}
\index{blend@{blend}!KPixmapEffect@{KPixmap\-Effect}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KPixmap} \& KPixmap\-Effect::blend ({\bf KPixmap} \& {\em pixmap}, float {\em initial\_\-intensity}, const {\bf QColor} \& {\em bgnd}, Gradient\-Type {\em eff}, bool {\em anti\_\-dir} = {\tt false}, int {\em ncols} = {\tt 3})\hspace{0.3cm}{\tt  [static]}}\label{classKPixmapEffect_e5}


Blends the provided pixmap into a background of the indicated color. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em pixmap}]The pixmap to process. \item[{\em initial\_\-intensity}]this parameter takes values from -1 to 1: \begin{itemize}
\item If positive, it tells how much to fade the image in its less affected spot. \item If negative, it tells roughly indicates how much of the image remains unaffected \end{itemize}
\item[{\em bgnd}]Indicates the color of the background to blend in. \item[{\em eff}]Lets you choose what kind of blending you like. \item[{\em anti\_\-dir}]Blend in the opposite direction (makes no much sense with concentric blending effects). \item[{\em ncols}]The number of colors to dither the pixmap to. Only used for 8 bpp pixmaps. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Returns the pixmap(), provided for convenience. \end{Desc}


Definition at line 140 of file kpixmapeffect.cpp.

References KImage\-Effect::blend(), QImage::convert\-Depth(), QPixmap::convert\-To\-Image(), QImage::depth(), KImage\-Effect::dither(), and QColor::set\-Rgb().\index{KPixmapEffect@{KPixmap\-Effect}!hash@{hash}}
\index{hash@{hash}!KPixmapEffect@{KPixmap\-Effect}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KPixmap} \& KPixmap\-Effect::hash ({\bf KPixmap} \& {\em pixmap}, Lighting {\em lite} = {\tt NorthLite}, unsigned int {\em spacing} = {\tt 0}, int {\em ncols} = {\tt 3})\hspace{0.3cm}{\tt  [static]}}\label{classKPixmapEffect_e6}


Builds a hash on any given pixmap. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em pixmap}]The pixmap to process. \item[{\em lite}]The hash faces the indicated lighting (cardinal poles) \item[{\em spacing}]How many unmodified pixels inbetween hashes. \item[{\em ncols}]The number of colors to dither the pixmap to. Only used for 8 bpp pixmaps. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Returns The pixmap(), provided for convenience. \end{Desc}


Definition at line 179 of file kpixmapeffect.cpp.

References QPixmap::convert\-To\-Image(), KImage\-Effect::dither(), KImage\-Effect::hash(), and QColor::set\-Rgb().\index{KPixmapEffect@{KPixmap\-Effect}!pattern@{pattern}}
\index{pattern@{pattern}!KPixmapEffect@{KPixmap\-Effect}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KPixmap} KPixmap\-Effect::pattern (const {\bf KPixmap} \& {\em pixmap}, {\bf QSize} {\em size}, const {\bf QColor} \& {\em ca}, const {\bf QColor} \& {\em cb}, int {\em ncols} = {\tt 8})\hspace{0.3cm}{\tt  [static]}}\label{classKPixmapEffect_e7}


Creates a pattern from a pixmap. 

The given pixmap is \char`\"{}flattened\char`\"{} between color a to color b. Doesn't change the original pixmap.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em pixmap}]The pixmap to process. \item[{\em size}]The size of the returned pixmap. If {\tt size} is larger than the original, the resulting pixmap will be tiled. \item[{\em ca}]Color a. \item[{\em cb}]Color b. \item[{\em ncols}]The number of colors to use. The image will be dithered to this depth. Pass zero to prevent dithering. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]The resulting pixmap. \end{Desc}


Definition at line 223 of file kpixmapeffect.cpp.

References KPixmap::convert\-From\-Image(), QPixmap::convert\-To\-Image(), create\-Tiled(), and KImage\-Effect::flatten().\index{KPixmapEffect@{KPixmap\-Effect}!fade@{fade}}
\index{fade@{fade}!KPixmapEffect@{KPixmap\-Effect}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KPixmap} \& KPixmap\-Effect::fade ({\bf KPixmap} \& {\em pixmap}, double {\em val}, const {\bf QColor} \& {\em color})\hspace{0.3cm}{\tt  [static]}}\label{classKPixmapEffect_e8}


Fades a pixmap to a certain color. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em pixmap}]The pixmap to process. \item[{\em val}]The strength of the effect. 0 $<$= val $<$= 1. \item[{\em color}]The color to blend to. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Returns the pixmap(), provided for convenience. \end{Desc}


Definition at line 257 of file kpixmapeffect.cpp.

References QPixmap::convert\-To\-Image(), and KImage\-Effect::fade().\index{KPixmapEffect@{KPixmap\-Effect}!toGray@{toGray}}
\index{toGray@{toGray}!KPixmapEffect@{KPixmap\-Effect}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KPixmap} \& KPixmap\-Effect::to\-Gray ({\bf KPixmap} \& {\em pixmap}, bool {\em fast} = {\tt false})\hspace{0.3cm}{\tt  [static]}}\label{classKPixmapEffect_e9}


Converts a pixmap to grayscale. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em pixmap}]The pixmap to process. \item[{\em fast}]Set to {\tt true} in order to use a faster but non-photographic quality algorithm. Appropriate for things such as toolbar icons. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Returns the pixmap(), provided for convenience. \end{Desc}


Definition at line 268 of file kpixmapeffect.cpp.

References QPixmap::convert\-To\-Image(), and KImage\-Effect::to\-Gray().\index{KPixmapEffect@{KPixmap\-Effect}!desaturate@{desaturate}}
\index{desaturate@{desaturate}!KPixmapEffect@{KPixmap\-Effect}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KPixmap} \& KPixmap\-Effect::desaturate ({\bf KPixmap} \& {\em pixmap}, float {\em desat} = {\tt 0.3})\hspace{0.3cm}{\tt  [static]}}\label{classKPixmapEffect_e10}


Desaturates a pixmap. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em pixmap}]The pixmap to process. \item[{\em desat}]A value between 0 and 1 setting the degree of desaturation \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Returns The pixmap(), provided for convenience. \end{Desc}


Definition at line 278 of file kpixmapeffect.cpp.

References QPixmap::convert\-To\-Image(), and KImage\-Effect::desaturate().\index{KPixmapEffect@{KPixmap\-Effect}!contrast@{contrast}}
\index{contrast@{contrast}!KPixmapEffect@{KPixmap\-Effect}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KPixmap} \& KPixmap\-Effect::contrast ({\bf KPixmap} \& {\em pixmap}, int {\em c})\hspace{0.3cm}{\tt  [static]}}\label{classKPixmapEffect_e11}


Modifies the contrast of a pixmap. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em pixmap}]The pixmap to process. \item[{\em c}]A contrast value between -255 and 255. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Returns the pixmap(), provided for convenience. \end{Desc}


Definition at line 287 of file kpixmapeffect.cpp.

References KImage\-Effect::contrast(), and QPixmap::convert\-To\-Image().\index{KPixmapEffect@{KPixmap\-Effect}!dither@{dither}}
\index{dither@{dither}!KPixmapEffect@{KPixmap\-Effect}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KPixmap} \& KPixmap\-Effect::dither ({\bf KPixmap} \& {\em pixmap}, const {\bf QColor} $\ast$ {\em palette}, int {\em size})\hspace{0.3cm}{\tt  [static]}}\label{classKPixmapEffect_e12}


Dithers a pixmap using Floyd-Steinberg dithering for low-color situations. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em pixmap}]The pixmap to process. \item[{\em palette}]The color palette to use. \item[{\em size}]The size of the palette. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Returns the pixmap(), provided for convenience. \end{Desc}


Definition at line 303 of file kpixmapeffect.cpp.

References QPixmap::convert\-To\-Image(), and KImage\-Effect::dither().\index{KPixmapEffect@{KPixmap\-Effect}!selectedPixmap@{selectedPixmap}}
\index{selectedPixmap@{selectedPixmap}!KPixmapEffect@{KPixmap\-Effect}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KPixmap} KPixmap\-Effect::selected\-Pixmap (const {\bf KPixmap} \& {\em pixmap}, const {\bf QColor} \& {\em col})\hspace{0.3cm}{\tt  [static]}}\label{classKPixmapEffect_e13}


Calculate a 'selected' pixmap, for instance a selected icon on the desktop. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em pixmap}]the pixmap to select \item[{\em col}]the selected color, usually from {\bf QColor\-Group::highlight()}. \end{description}
\end{Desc}


Definition at line 318 of file kpixmapeffect.cpp.

References KPixmap::convert\-From\-Image(), QPixmap::convert\-To\-Image(), and KImage\-Effect::selected\-Image().

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