KPixmapEffect Class Reference
This class includes various pixmap-based graphical effects. More...
#include <kpixmapeffect.h>
Public Types | |
enum | GradientType { VerticalGradient, HorizontalGradient, DiagonalGradient, CrossDiagonalGradient, PyramidGradient, RectangleGradient, PipeCrossGradient, EllipticGradient } |
enum | RGBComponent { Red, Green, Blue } |
enum | Lighting { NorthLite, NWLite, WestLite, SWLite, SouthLite, SELite, EastLite, NELite } |
Static Public Member Functions | |
KPixmap & | gradient (KPixmap &pixmap, const QColor &ca, const QColor &cb, GradientType type, int ncols=3) |
Creates a gradient from color a to color b of the specified type. | |
KPixmap & | unbalancedGradient (KPixmap &pixmap, const QColor &ca, const QColor &cb, GradientType type, int xfactor=100, int yfactor=100, int ncols=3) |
Creates an unbalanced gradient. | |
KPixmap | createTiled (const KPixmap &pixmap, QSize size) |
Creates a pixmap of a given size with the given pixmap. | |
KPixmap & | intensity (KPixmap &pixmap, float ratio) |
Either brightens or dims a pixmap by a specified ratio. | |
KPixmap & | channelIntensity (KPixmap &pixmap, float ratio, RGBComponent channel) |
Modifies the intensity of a pixmap's RGB channel component. | |
KPixmap & | blend (KPixmap &pixmap, float initial_intensity, const QColor &bgnd, GradientType eff, bool anti_dir=false, int ncols=3) |
Blends the provided pixmap into a background of the indicated color. | |
KPixmap & | hash (KPixmap &pixmap, Lighting lite=NorthLite, unsigned int spacing=0, int ncols=3) |
Builds a hash on any given pixmap. | |
KPixmap | pattern (const KPixmap &pixmap, QSize size, const QColor &ca, const QColor &cb, int ncols=8) |
Creates a pattern from a pixmap. | |
KPixmap & | fade (KPixmap &pixmap, double val, const QColor &color) |
Recolors a pixmap. | |
KPixmap & | toGray (KPixmap &pixmap, bool fast=false) |
Converts a pixmap to grayscale. | |
KPixmap & | desaturate (KPixmap &pixmap, float desat=0.3) |
Desaturates a pixmap. | |
KPixmap & | contrast (KPixmap &pixmap, int c) |
Modifies the contrast of a pixmap. | |
KPixmap & | dither (KPixmap &pixmap, const QColor *palette, int size) |
Dithers a pixmap using Floyd-Steinberg dithering for low-color situations. | |
KPixmap | selectedPixmap (const KPixmap &pixmap, const QColor &col) |
Calculate a 'selected' pixmap, for instance a selected icon on the desktop. |
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 26 of file kpixmapeffect.h.
Member Function Documentation
|
Creates a gradient from color a to color b of the specified type.
Definition at line 24 of file kpixmapeffect.cpp. References QColor::blue(), KPixmap::convertFromImage(), QPixmap::depth(), QPainter::drawLine(), KImageEffect::gradient(), QColor::green(), QPixmap::height(), QColor::red(), QPainter::setPen(), QPixmap::size(), and QPixmap::width(). |
|
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.
Definition at line 88 of file kpixmapeffect.cpp. References KPixmap::convertFromImage(), QPixmap::size(), and KImageEffect::unbalancedGradient(). |
|
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.
Definition at line 240 of file kpixmapeffect.cpp. References QPainter::drawTiledPixmap(), QSize::height(), and QSize::width(). Referenced by pattern(). |
|
Either brightens or dims a pixmap by a specified ratio.
Definition at line 109 of file kpixmapeffect.cpp. References KPixmap::convertFromImage(), QPixmap::convertToImage(), and KImageEffect::intensity(). |
|
Modifies the intensity of a pixmap's RGB channel component.
Definition at line 121 of file kpixmapeffect.cpp. References KImageEffect::channelIntensity(), KPixmap::convertFromImage(), and QPixmap::convertToImage(). |
|
Blends the provided pixmap into a background of the indicated color.
Definition at line 140 of file kpixmapeffect.cpp. References KImageEffect::blend(), QImage::convertDepth(), KPixmap::convertFromImage(), QPixmap::convertToImage(), QPixmap::depth(), QImage::depth(), KImageEffect::dither(), and QColor::setRgb(). |
|
Builds a hash on any given pixmap.
Definition at line 179 of file kpixmapeffect.cpp. References KPixmap::convertFromImage(), QPixmap::convertToImage(), QPixmap::depth(), KImageEffect::dither(), KImageEffect::hash(), and QColor::setRgb(). |
|
Creates a pattern from a pixmap. The given pixmap is "flattened" between color a to color b.
Definition at line 223 of file kpixmapeffect.cpp. References KPixmap::convertFromImage(), QPixmap::convertToImage(), createTiled(), QPixmap::depth(), and KImageEffect::flatten(). |
|
Recolors a pixmap. The most dark color will become color a, the most bright one color b, and in between.
Definition at line 257 of file kpixmapeffect.cpp. References KPixmap::convertFromImage(), QPixmap::convertToImage(), and KImageEffect::fade(). |
|
Converts a pixmap to grayscale.
Definition at line 268 of file kpixmapeffect.cpp. References KPixmap::convertFromImage(), QPixmap::convertToImage(), and KImageEffect::toGray(). |
|
Desaturates a pixmap.
Definition at line 278 of file kpixmapeffect.cpp. References KPixmap::convertFromImage(), QPixmap::convertToImage(), and KImageEffect::desaturate(). |
|
Modifies the contrast of a pixmap.
Definition at line 287 of file kpixmapeffect.cpp. References KImageEffect::contrast(), KPixmap::convertFromImage(), and QPixmap::convertToImage(). |
|
Dithers a pixmap using Floyd-Steinberg dithering for low-color situations.
Definition at line 303 of file kpixmapeffect.cpp. References KPixmap::convertFromImage(), QPixmap::convertToImage(), and KImageEffect::dither(). |
|
Calculate a 'selected' pixmap, for instance a selected icon on the desktop.
Definition at line 318 of file kpixmapeffect.cpp. References KPixmap::convertFromImage(), QPixmap::convertToImage(), and KImageEffect::selectedImage(). |
The documentation for this class was generated from the following files: