KIconEffect Class Reference
Applies effects to icons. More...
#include <kiconeffect.h>
Public Types | |
enum | Effects { NoEffect, ToGray, Colorize, ToGamma, DeSaturate, LastEffect } |
Public Member Functions | |
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 Member Functions | |
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.
|
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.
|
|
Returns a fingerprint for the effect by encoding the given This is useful for caching.
References QString::fromLatin1(), QString::isEmpty(), QColor::name(), and QString::setNum(). |
|
Applies an effect to an image.
The effect to apply depends on the
Referenced by apply(). |
|
Applies an effect to an image.
References colorize(), deSaturate(), semiTransparent(), toGamma(), and toGray(). |
|
Applies an effect to a pixmap.
References apply(). |
|
Applies an effect to a pixmap.
References apply(), QPixmap::convertFromImage(), QPixmap::convertToImage(), and semiTransparent(). |
|
Returns an image twice as large, consisting of 2x2 pixels.
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).
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.
References QImage::bits(), QImage::colorTable(), QImage::depth(), QImage::height(), QImage::numColors(), and QImage::width(). Referenced by apply(). |
|
Colorizes an image with a specific color.
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.
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.
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.
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.
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.
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: