KIconEffect Class Reference
Applies effects to icons. More...
#include <kiconeffect.h>
Public Types | |
enum | Effects { NoEffect, ToGray, Colorize, ToGamma, DeSaturate, ToMonochrome, LastEffect } |
Public Member Functions | |
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 |
QImage | apply (QImage src, int effect, float value, const QColor rgb, const QColor rgb2, 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 |
QPixmap | apply (QPixmap src, int effect, float value, const QColor rgb, const QColor rgb2, bool trans) const |
QImage | doublePixels (QImage src) const |
Static Public Member Functions | |
static void | visualActivate (QWidget *widget, QRect rect) |
static void | toGray (QImage &image, float value) |
static void | colorize (QImage &image, const QColor &col, float value) |
static void | toMonochrome (QImage &image, const QColor &black, const QColor &white, float value) |
static void | deSaturate (QImage &image, float value) |
static void | toGamma (QImage &image, float value) |
static void | semiTransparent (QImage &image) |
static void | semiTransparent (QPixmap &pixmap) |
static 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 34 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 49 of file kiconeffect.cpp. References init(). |
Member Function Documentation
|
Rereads configuration.
Definition at line 61 of file kiconeffect.cpp. References KGlobal::config(), KConfigBase::readBoolEntry(), KConfigBase::readColorEntry(), KConfigBase::readDoubleNumEntry(), KConfigBase::readEntry(), KConfigBase::setGroup(), and ToMonochrome. Referenced by KIconEffect(). |
|
Tests whether an effect has been configured for the given icon group.
Definition at line 137 of file kiconeffect.cpp. |
|
Returns a fingerprint for the effect by encoding the given This is useful for caching.
Definition at line 142 of file kiconeffect.cpp. References QString::fromLatin1(), QString::isEmpty(), KIcon::LastGroup, QColor::name(), QString::setNum(), and ToMonochrome. |
|
Applies an effect to an image.
The effect to apply depends on the
Definition at line 172 of file kiconeffect.cpp. References kdDebug(), KIcon::LastGroup, and KIcon::LastState. Referenced by apply(). |
|
Applies an effect to an image.
Definition at line 188 of file kiconeffect.cpp. References apply(), and KGlobalSettings::baseColor(). |
|
Definition at line 193 of file kiconeffect.cpp. References colorize(), deSaturate(), kdDebug(), semiTransparent(), toGamma(), toGray(), toMonochrome(), and ToMonochrome. |
|
Applies an effect to a pixmap.
Definition at line 229 of file kiconeffect.cpp. References apply(), kdDebug(), KIcon::LastGroup, and KIcon::LastState. |
|
Applies an effect to a pixmap.
Definition at line 245 of file kiconeffect.cpp. References apply(), and KGlobalSettings::baseColor(). |
|
Definition at line 251 of file kiconeffect.cpp. References apply(), QPixmap::convertFromImage(), QPixmap::convertToImage(), kdDebug(), and semiTransparent(). |
|
Returns an image twice as large, consisting of 2x2 pixels.
Definition at line 540 of file kiconeffect.cpp. References QImage::bytesPerLine(), QImage::color(), QImage::create(), QImage::depth(), QImage::hasAlphaBuffer(), QImage::height(), kdDebug(), 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 704 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 282 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 304 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(). |
|
Produces a monochrome icon with a given foreground and background color.
Definition at line 345 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 395 of file kiconeffect.cpp. References QImage::bits(), QColor::blue(), QImage::colorTable(), QImage::depth(), QColor::green(), QImage::height(), QColor::hsv(), QImage::numColors(), QColor::red(), QColor::setHsv(), QColor::setRgb(), and QImage::width(). Referenced by apply(). |
|
Changes the gamma value of an image.
Definition at line 413 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 435 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 509 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 589 of file kiconeffect.cpp. References QImage::color(), QImage::depth(), QImage::hasAlphaBuffer(), QImage::height(), kdDebug(), 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: