.TH "KIconEffect" kde3 "11 Jun 2005" "Version Version 3.4.1" "kdecore Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KIconEffect \- Applies effects to icons.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <kiconeffect.h>\fP
.PP
.SS "Public Types"

.in +1c
.ti -1c
.RI "enum \fBEffects\fP { \fBNoEffect\fP, \fBToGray\fP, \fBColorize\fP, \fBToGamma\fP, \fBDeSaturate\fP, \fBToMonochrome\fP, \fBLastEffect\fP }"
.br
.in -1c
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBKIconEffect\fP ()"
.br
.ti -1c
.RI "void \fBinit\fP ()"
.br
.ti -1c
.RI "bool \fBhasEffect\fP (int group, int state) const "
.br
.ti -1c
.RI "\fBQString\fP \fBfingerprint\fP (int group, int state) const "
.br
.ti -1c
.RI "\fBQImage\fP \fBapply\fP (\fBQImage\fP src, int group, int state) const "
.br
.ti -1c
.RI "\fBQImage\fP \fBapply\fP (\fBQImage\fP src, int effect, float value, const \fBQColor\fP rgb, bool trans) const "
.br
.ti -1c
.RI "\fBQImage\fP \fBapply\fP (\fBQImage\fP src, int effect, float value, const \fBQColor\fP rgb, const \fBQColor\fP rgb2, bool trans) const "
.br
.ti -1c
.RI "\fBQPixmap\fP \fBapply\fP (\fBQPixmap\fP src, int group, int state) const "
.br
.ti -1c
.RI "\fBQPixmap\fP \fBapply\fP (\fBQPixmap\fP src, int effect, float value, const \fBQColor\fP rgb, bool trans) const "
.br
.ti -1c
.RI "\fBQPixmap\fP \fBapply\fP (\fBQPixmap\fP src, int effect, float value, const \fBQColor\fP rgb, const \fBQColor\fP rgb2, bool trans) const "
.br
.ti -1c
.RI "\fBQImage\fP \fBdoublePixels\fP (\fBQImage\fP src) const "
.br
.in -1c
.SS "Static Public Member Functions"

.in +1c
.ti -1c
.RI "static void \fBvisualActivate\fP (\fBQWidget\fP *widget, \fBQRect\fP rect)"
.br
.ti -1c
.RI "static void \fBtoGray\fP (\fBQImage\fP &image, float value)"
.br
.ti -1c
.RI "static void \fBcolorize\fP (\fBQImage\fP &image, const \fBQColor\fP &col, float value)"
.br
.ti -1c
.RI "static void \fBtoMonochrome\fP (\fBQImage\fP &image, const \fBQColor\fP &black, const \fBQColor\fP &white, float value)"
.br
.ti -1c
.RI "static void \fBdeSaturate\fP (\fBQImage\fP &image, float value)"
.br
.ti -1c
.RI "static void \fBtoGamma\fP (\fBQImage\fP &image, float value)"
.br
.ti -1c
.RI "static void \fBsemiTransparent\fP (\fBQImage\fP &image)"
.br
.ti -1c
.RI "static void \fBsemiTransparent\fP (\fBQPixmap\fP &pixmap)"
.br
.ti -1c
.RI "static void \fBoverlay\fP (\fBQImage\fP &src, \fBQImage\fP &overlay)"
.br
.in -1c
.SH "Detailed Description"
.PP 
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. 
.PP
\fBSee also:\fP
.RS 4
\fBKIcon\fP 
.RE
.PP

.PP
Definition at line 34 of file kiconeffect.h.
.SH "Member Enumeration Documentation"
.PP 
.SS "enum \fBKIconEffect::Effects\fP"
.PP
This is the enumeration of all possible icon effects. 
.PP
Note that 'LastEffect' is no valid icon effect but only used internally to check for invalid icon effects.
.PP
.PD 0
.IP "\(bu" 2
NoEffect: Don't apply any icon effect 
.IP "\(bu" 2
ToGray: Tints the icon gray 
.IP "\(bu" 2
Colorize: Tints the icon with an other color 
.IP "\(bu" 2
ToGamma: Change the gamma value of the icon 
.IP "\(bu" 2
DeSaturate: Reduce the saturation of the icon 
.IP "\(bu" 2
ToMonochrome: Produces a monochrome icon 
.PP

.PP
\fBEnumeration values: \fP
.in +1c
.TP
\fB\fIToMonochrome \fP\fP
\fBSince:\fP
.RS 4
3.4 
.RE
.PP

.PP
Definition at line 55 of file kiconeffect.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KIconEffect::KIconEffect ()"
.PP
Create a new KIconEffect. 
.PP
Definition at line 49 of file kiconeffect.cpp.
.PP
References init().
.SH "Member Function Documentation"
.PP 
.SS "void KIconEffect::init ()"
.PP
Rereads configuration. 
.PP
Definition at line 61 of file kiconeffect.cpp.
.PP
References KGlobal::config(), KConfigBase::readBoolEntry(), KConfigBase::readColorEntry(), KConfigBase::readDoubleNumEntry(), KConfigBase::readEntry(), KConfigBase::setGroup(), and ToMonochrome.
.PP
Referenced by KIconEffect().
.SS "bool KIconEffect::hasEffect (int group, int state) const"
.PP
Tests whether an effect has been configured for the given icon group. 
.PP
\fBParameters:\fP
.RS 4
\fIgroup\fP the group to check, see \fBKIcon::Group\fP 
.br
\fIstate\fP the state to check, see \fBKIcon::States\fP 
.RE
.PP
\fBReturns:\fP
.RS 4
true if an effect is configured for the given \fCgroup\fP in \fCstate\fP, otherwise false. 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBKIcon::Group\fP \fBKIcon::States\fP 
.RE
.PP

.PP
Definition at line 137 of file kiconeffect.cpp.
.SS "\fBQString\fP KIconEffect::fingerprint (int group, int state) const"
.PP
Returns a fingerprint for the effect by encoding the given \fCgroup\fP and \fCstate\fP into a \fBQString\fP. 
.PP
This is useful for caching. 
.PP
\fBParameters:\fP
.RS 4
\fIgroup\fP the group, see \fBKIcon::Group\fP 
.br
\fIstate\fP the state, see \fBKIcon::States\fP 
.RE
.PP
\fBReturns:\fP
.RS 4
the fingerprint of the given \fCgroup+\fCstate\fP \fP 
.RE
.PP

.PP
Definition at line 142 of file kiconeffect.cpp.
.PP
References QString::fromLatin1(), QString::isEmpty(), QColor::name(), QString::setNum(), and ToMonochrome.
.SS "\fBQImage\fP KIconEffect::apply (\fBQImage\fP src, int group, int state) const"
.PP
Applies an effect to an image. 
.PP
The effect to apply depends on the \fCgroup\fP and \fCstate\fP parameters, and is configured by the user. 
.PP
\fBParameters:\fP
.RS 4
\fIsrc\fP The image. 
.br
\fIgroup\fP The group for the icon, see \fBKIcon::Group\fP 
.br
\fIstate\fP The icon's state, see \fBKIcon::States\fP 
.RE
.PP
\fBReturns:\fP
.RS 4
An image with the effect applied. 
.RE
.PP

.PP
Definition at line 172 of file kiconeffect.cpp.
.PP
Referenced by apply().
.SS "\fBQImage\fP KIconEffect::apply (\fBQImage\fP src, int effect, float value, const \fBQColor\fP rgb, bool trans) const"
.PP
Applies an effect to an image. 
.PP
\fBParameters:\fP
.RS 4
\fIsrc\fP The image. 
.br
\fIeffect\fP The effect to apply, one of \fBKIconEffect::Effects\fP. 
.br
\fIvalue\fP Strength of the effect. 0 <= \fCvalue\fP <= 1. 
.br
\fIrgb\fP Color parameter for effects that need one. 
.br
\fItrans\fP Add Transparency if trans = true. 
.RE
.PP
\fBReturns:\fP
.RS 4
An image with the effect applied. 
.RE
.PP

.PP
Definition at line 188 of file kiconeffect.cpp.
.PP
References apply().
.SS "\fBQImage\fP KIconEffect::apply (\fBQImage\fP src, int effect, float value, const \fBQColor\fP rgb, const \fBQColor\fP rgb2, bool trans) const"
.PP
\fBSince:\fP
.RS 4
3.4 
.RE
.PP

.PP
Definition at line 193 of file kiconeffect.cpp.
.PP
References colorize(), deSaturate(), semiTransparent(), toGamma(), toGray(), toMonochrome(), and ToMonochrome.
.SS "\fBQPixmap\fP KIconEffect::apply (\fBQPixmap\fP src, int group, int state) const"
.PP
Applies an effect to a pixmap. 
.PP
\fBParameters:\fP
.RS 4
\fIsrc\fP The pixmap. 
.br
\fIgroup\fP The group for the icon, see \fBKIcon::Group\fP 
.br
\fIstate\fP The icon's state, see \fBKIcon::States\fP 
.RE
.PP
\fBReturns:\fP
.RS 4
A pixmap with the effect applied. 
.RE
.PP

.PP
Definition at line 229 of file kiconeffect.cpp.
.PP
References apply().
.SS "\fBQPixmap\fP KIconEffect::apply (\fBQPixmap\fP src, int effect, float value, const \fBQColor\fP rgb, bool trans) const"
.PP
Applies an effect to a pixmap. 
.PP
\fBParameters:\fP
.RS 4
\fIsrc\fP The pixmap. 
.br
\fIeffect\fP The effect to apply, one of \fBKIconEffect::Effects\fP. 
.br
\fIvalue\fP Strength of the effect. 0 <= \fCvalue\fP <= 1. 
.br
\fIrgb\fP Color parameter for effects that need one. 
.br
\fItrans\fP Add Transparency if trans = true. 
.RE
.PP
\fBReturns:\fP
.RS 4
A pixmap with the effect applied. 
.RE
.PP

.PP
Definition at line 245 of file kiconeffect.cpp.
.PP
References apply().
.SS "\fBQPixmap\fP KIconEffect::apply (\fBQPixmap\fP src, int effect, float value, const \fBQColor\fP rgb, const \fBQColor\fP rgb2, bool trans) const"
.PP
\fBSince:\fP
.RS 4
3.4 
.RE
.PP

.PP
Definition at line 251 of file kiconeffect.cpp.
.PP
References apply(), QPixmap::convertFromImage(), QPixmap::convertToImage(), and semiTransparent().
.SS "\fBQImage\fP KIconEffect::doublePixels (\fBQImage\fP src) const"
.PP
Returns an image twice as large, consisting of 2x2 pixels. 
.PP
\fBParameters:\fP
.RS 4
\fIsrc\fP the image. 
.RE
.PP
\fBReturns:\fP
.RS 4
the scaled image. 
.RE
.PP

.PP
Definition at line 540 of file kiconeffect.cpp.
.PP
References QImage::bytesPerLine(), QImage::color(), QImage::create(), QImage::depth(), QImage::hasAlphaBuffer(), QImage::height(), QImage::numColors(), QImage::scanLine(), QImage::setAlphaBuffer(), QImage::setColor(), and QImage::width().
.SS "void KIconEffect::visualActivate (\fBQWidget\fP * widget, \fBQRect\fP rect)\fC [static]\fP"
.PP
Provides visual feedback to show activation of an icon on a widget. 
.PP
Not strictly an 'icon effect', but in practice that's what it looks like.
.PP
This method does nothing if the global 'Visual feedback on activation' option is not activated (See kcontrol/Peripherals/Mouse).
.PP
\fBParameters:\fP
.RS 4
\fIwidget\fP The widget on which the effect should be painted 
.br
\fIrect\fP This rectangle defines the effect's borders 
.RE
.PP

.PP
Definition at line 704 of file kiconeffect.cpp.
.PP
References QRect::center(), QPainter::drawRect(), QPainter::flush(), QRect::height(), QPainter::setPen(), QPainter::setRasterOp(), QRect::setRect(), KGlobalSettings::visualActivateSpeed(), QRect::width(), QPoint::x(), and QPoint::y().
.SS "void KIconEffect::toGray (\fBQImage\fP & image, float value)\fC [static]\fP"
.PP
Tints an image gray. 
.PP
\fBParameters:\fP
.RS 4
\fIimage\fP The image 
.br
\fIvalue\fP Strength of the effect. 0 <= \fCvalue\fP <= 1 
.RE
.PP

.PP
Definition at line 282 of file kiconeffect.cpp.
.PP
References QPixmap::depth(), QPixmap::height(), and QPixmap::width().
.PP
Referenced by apply().
.SS "void KIconEffect::colorize (\fBQImage\fP & image, const \fBQColor\fP & col, float value)\fC [static]\fP"
.PP
Colorizes an image with a specific color. 
.PP
\fBParameters:\fP
.RS 4
\fIimage\fP The image 
.br
\fIcol\fP The color with which the \fCimage\fP is tinted 
.br
\fIvalue\fP Strength of the effect. 0 <= \fCvalue\fP <= 1 
.RE
.PP

.PP
Definition at line 304 of file kiconeffect.cpp.
.PP
References QPixmap::depth(), QPixmap::height(), and QPixmap::width().
.PP
Referenced by apply().
.SS "void KIconEffect::toMonochrome (\fBQImage\fP & image, const \fBQColor\fP & black, const \fBQColor\fP & white, float value)\fC [static]\fP"
.PP
Produces a monochrome icon with a given foreground and background color. 
.PP
\fBParameters:\fP
.RS 4
\fIimage\fP The image 
.br
\fIwhite\fP The color with which the white parts of \fCimage\fP are painted 
.br
\fIblack\fP The color with which the black parts of \fCimage\fP are painted 
.br
\fIvalue\fP Strength of the effect. 0 <= \fCvalue\fP <= 1 
.RE
.PP
\fBSince:\fP
.RS 4
3.4 
.RE
.PP

.PP
Definition at line 345 of file kiconeffect.cpp.
.PP
References QPixmap::depth(), QPixmap::height(), and QPixmap::width().
.PP
Referenced by apply().
.SS "void KIconEffect::deSaturate (\fBQImage\fP & image, float value)\fC [static]\fP"
.PP
Desaturates an image. 
.PP
\fBParameters:\fP
.RS 4
\fIimage\fP The image 
.br
\fIvalue\fP Strength of the effect. 0 <= \fCvalue\fP <= 1 
.RE
.PP

.PP
Definition at line 395 of file kiconeffect.cpp.
.PP
References QColor::blue(), QColor::green(), QPixmap::height(), QColor::red(), QColor::setHsv(), QColor::setRgb(), and QPixmap::width().
.PP
Referenced by apply().
.SS "void KIconEffect::toGamma (\fBQImage\fP & image, float value)\fC [static]\fP"
.PP
Changes the gamma value of an image. 
.PP
\fBParameters:\fP
.RS 4
\fIimage\fP The image 
.br
\fIvalue\fP Strength of the effect. 0 <= \fCvalue\fP <= 1 
.RE
.PP

.PP
Definition at line 413 of file kiconeffect.cpp.
.PP
References QColor::rgb(), and QColor::setRgb().
.PP
Referenced by apply().
.SS "void KIconEffect::semiTransparent (\fBQImage\fP & image)\fC [static]\fP"
.PP
Renders an image semi-transparent. 
.PP
\fBParameters:\fP
.RS 4
\fIimage\fP The image 
.RE
.PP

.PP
Definition at line 435 of file kiconeffect.cpp.
.PP
Referenced by apply(), and semiTransparent().
.SS "void KIconEffect::semiTransparent (\fBQPixmap\fP & pixmap)\fC [static]\fP"
.PP
Renders a pixmap semi-transparent. 
.PP
\fBParameters:\fP
.RS 4
\fIpixmap\fP The pixmap 
.RE
.PP

.PP
Definition at line 509 of file kiconeffect.cpp.
.PP
References QImage::create(), QImage::fill(), QImage::height(), QImage::scanLine(), semiTransparent(), and QImage::width().
.SS "void KIconEffect::overlay (\fBQImage\fP & src, \fBQImage\fP & overlay)\fC [static]\fP"
.PP
Overlays an image with an other image. 
.PP
\fBParameters:\fP
.RS 4
\fIsrc\fP The image 
.br
\fIoverlay\fP The image to overlay \fCsrc\fP with 
.RE
.PP

.PP
Definition at line 589 of file kiconeffect.cpp.
.PP
References overlay().
.PP
Referenced by KIconLoader::loadIcon(), and overlay().

.SH "Author"
.PP 
Generated automatically by Doxygen for kdecore Library from the source code.
