KIconEffect Class Reference
Applies effects to icons. More...
#include <kiconeffect.h>
Public Types | |
enum | Effects { NoEffect, ToGray, Colorize, ToGamma, DeSaturate, LastEffect } |
Public Methods | |
KIconEffect () | |
~KIconEffect () | |
void | init () |
bool | hasEffect (int group, int state) const |
QString | fingerprint (int group, int state) const |
QImage | apply (QImage src, int group, int state) const |
QImage | apply (QImage src, int effect, float value, const QColor rgb, bool trans) const |
QPixmap | apply (QPixmap src, int group, int state) const |
QPixmap | apply (QPixmap src, int effect, float value, const QColor rgb, bool trans) const |
QImage | doublePixels (QImage src) const |
Static Public Methods | |
void | visualActivate (QWidget *widget, QRect rect) |
void | toGray (QImage &image, float value) |
void | colorize (QImage &image, const QColor &col, float value) |
void | deSaturate (QImage &image, float value) |
void | toGamma (QImage &image, float value) |
void | semiTransparent (QImage &image) |
void | semiTransparent (QPixmap &pixmap) |
void | overlay (QImage &src, QImage &overlay) |
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.
- See also:
- KIcon
Definition at line 35 of file kiconeffect.h.
Member Enumeration Documentation
|
This is the enumeration of all possible icon effects. Note that 'LastEffect' is no valid icon effect but only used internally to check for invalid icon effects.
Definition at line 55 of file kiconeffect.h. |
Constructor & Destructor Documentation
|
Create a new KIconEffect.
Definition at line 44 of file kiconeffect.cpp. References init(). |
Member Function Documentation
|
Rereads configuration.
Definition at line 56 of file kiconeffect.cpp. References KGlobal::config(), KConfigBase::readBoolEntry(), KConfigBase::readColorEntry(), KConfigBase::readDoubleNumEntry(), KConfigBase::readEntry(), and KConfigBase::setGroup(). Referenced by KIconEffect(). |
|
Tests whether an effect has been configured for the given icon group.
Definition at line 125 of file kiconeffect.cpp. |
|
Returns a fingerprint for the effect by encoding the given This is useful for caching.
Definition at line 130 of file kiconeffect.cpp. References QString::fromLatin1(), QString::isEmpty(), and QString::setNum(). |
|
Applies an effect to an image.
The effect to apply depends on the
Definition at line 161 of file kiconeffect.cpp. References KIcon::LastState. Referenced by apply(). |
|
Applies an effect to an image.
Definition at line 177 of file kiconeffect.cpp. References colorize(), deSaturate(), semiTransparent(), toGamma(), and toGray(). |
|
Applies an effect to a pixmap.
Definition at line 210 of file kiconeffect.cpp. References apply(), and KIcon::LastState. |
|
Applies an effect to a pixmap.
Definition at line 226 of file kiconeffect.cpp. References apply(), QPixmap::convertFromImage(), QPixmap::convertToImage(), and semiTransparent(). |
|
Returns an image twice as large, consisting of 2x2 pixels.
Definition at line 465 of file kiconeffect.cpp. References QImage::bytesPerLine(), QImage::color(), QImage::create(), QImage::depth(), QImage::hasAlphaBuffer(), QImage::height(), QImage::numColors(), QImage::scanLine(), QImage::setAlphaBuffer(), QImage::setColor(), and QImage::width(). |
|
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).
Definition at line 629 of file kiconeffect.cpp. References QRect::center(), QPainter::drawRect(), QPainter::flush(), QRect::height(), QPainter::setPen(), QPainter::setRasterOp(), QRect::setRect(), KGlobalSettings::visualActivate(), KGlobalSettings::visualActivateSpeed(), QRect::width(), QPoint::x(), and QPoint::y(). |
|
Tints an image gray.
Definition at line 257 of file kiconeffect.cpp. References QImage::bits(), QImage::colorTable(), QImage::depth(), QImage::height(), QImage::numColors(), and QImage::width(). Referenced by apply(). |
|
Colorizes an image with a specific color.
Definition at line 279 of file kiconeffect.cpp. References QImage::bits(), QColor::blue(), QImage::colorTable(), QImage::depth(), QColor::green(), QImage::height(), QImage::numColors(), QColor::red(), and QImage::width(). Referenced by apply(). |
|
Desaturates an image.
Definition at line 320 of file kiconeffect.cpp. References QImage::bits(), QColor::blue(), QImage::colorTable(), QImage::depth(), QColor::green(), QImage::height(), QImage::numColors(), QColor::red(), QColor::setHsv(), QColor::setRgb(), and QImage::width(). Referenced by apply(). |
|
Changes the gamma value of an image.
Definition at line 338 of file kiconeffect.cpp. References QImage::bits(), QImage::colorTable(), QImage::depth(), QImage::height(), QImage::numColors(), QColor::rgb(), QColor::setRgb(), and QImage::width(). Referenced by apply(). |
|
Renders an image semi-transparent.
Definition at line 360 of file kiconeffect.cpp. References QImage::color(), QImage::depth(), QImage::height(), QImage::numColors(), QImage::scanLine(), QImage::setAlphaBuffer(), QImage::setColor(), QImage::setPixel(), and QImage::width(). Referenced by apply(), and semiTransparent(). |
|
Renders a pixmap semi-transparent.
Definition at line 434 of file kiconeffect.cpp. References QPixmap::convertFromImage(), QPixmap::convertToImage(), QImage::create(), QImage::fill(), QImage::height(), QPixmap::mask(), QImage::scanLine(), semiTransparent(), QPixmap::setMask(), QPixmap::size(), and QImage::width(). |
|
Overlays an image with an other image.
Definition at line 514 of file kiconeffect.cpp. References QImage::color(), QImage::depth(), QImage::hasAlphaBuffer(), QImage::height(), QImage::numColors(), QImage::scanLine(), QImage::setColor(), QImage::setNumColors(), QImage::size(), and QImage::width(). Referenced by KIconLoader::loadIcon(). |
The documentation for this class was generated from the following files: