KImageEffect Class Reference
This class includes various QImage based graphical effects. More...
#include <kimageeffect.h>
Static Public Methods | |
QImage | gradient (const QSize &size, const QColor &ca, const QColor &cb, GradientType type, int ncols=3) |
Create a gradient from color a to color b of the specified type. | |
QImage | unbalancedGradient (const QSize &size, const QColor &ca, const QColor &cb, GradientType type, int xfactor=100, int yfactor=100, int ncols=3) |
Create an unbalanced gradient. | |
QImage & | blend (const QColor &clr, QImage &dst, float opacity) |
Blends a color into the destination image, using an opacity value for blending one into another. | |
QImage & | blend (QImage &src, QImage &dst, float opacity) |
Blend the src image into the destination image, using an opacity value for blending one into another. | |
QImage & | blend (QImage &image, float initial_intensity, const QColor &bgnd, GradientType eff, bool anti_dir=false) |
Blend the provided image into a background of the indicated color. | |
QImage & | blend (QImage &image1, QImage &image2, GradientType gt, int xf=100, int yf=100) |
Blend an image into another one, using a gradient type for blending from one to another. | |
QImage & | blend (QImage &image1, QImage &image2, QImage &blendImage, RGBComponent channel) |
Blend an image into another one, using a color channel of a third image for the decision of blending from one to another. | |
bool | blend (const QImage &upper, const QImage &lower, QImage &output) |
Blend an image into another one, using alpha in the expected way. | |
bool | blend (int &x, int &y, const QImage &upper, const QImage &lower, QImage &output) |
Blend an image into another one, using alpha in the expected way and over coordinates x and y with respect to the lower image. | |
bool | blendOnLower (int x, int y, const QImage &upper, const QImage &lower) |
Blend an image into another one, using alpha in the expected way and over coordinates x and y with respect to the lower image. | |
QImage & | channelIntensity (QImage &image, float percent, RGBComponent channel) |
Modifies the intensity of a pixmap's RGB channel component. | |
QImage & | fade (QImage &img, float val, const QColor &color) |
Fade an image to a certain background color. | |
QImage & | flatten (QImage &image, const QColor &ca, const QColor &cb, int ncols=0) |
This recolors a pixmap. | |
QImage & | hash (QImage &image, Lighting lite=NorthLite, unsigned int spacing=0) |
Build a hash on any given QImage. | |
QImage & | intensity (QImage &image, float percent) |
Either brighten or dim the image by a specified percent. | |
QImage & | modulate (QImage &image, QImage &modImage, bool reverse, ModulationType type, int factor, RGBComponent channel) |
Modulate the image with a color channel of another image. | |
QImage & | toGray (QImage &image, bool fast=false) |
Convert an image to grayscale. | |
QImage & | desaturate (QImage &image, float desat=0.3) |
Desaturate an image evenly. | |
QImage & | contrast (QImage &image, int c) |
Fast, but low quality contrast of an image. | |
QImage & | dither (QImage &img, const QColor *palette, int size) |
Dither an image using Floyd-Steinberg dithering for low-color situations. | |
QImage & | selectedImage (QImage &img, const QColor &col) |
Calculate the image for a selected image, for instance a selected icon on the desktop. | |
void | contrastHSV (QImage &img, bool sharpen=true) |
High quality, expensive HSV contrast. | |
void | normalize (QImage &img) |
Normalizes the pixel values to span the full range of color values. | |
void | equalize (QImage &img) |
Performs histogram equalization on the reference image. | |
void | threshold (QImage &img, unsigned int value=128) |
Thresholds the reference image. | |
void | solarize (QImage &img, double factor=50.0) |
Produces a 'solarization' effect seen when exposing a photographic film to light during the development process. | |
QImage | emboss (QImage &src) |
Embosses the source image. | |
QImage | despeckle (QImage &src) |
Minimizes speckle noise in the source image using the 8 hull algorithm. | |
QImage | charcoal (QImage &src, double factor=50.0) |
Produces a neat little "charcoal" effect. | |
QImage | rotate (QImage &src, RotateDirection r) |
Rotates the image by the specified amount. | |
QImage | sample (QImage &src, int w, int h) |
Scales an image using simple pixel sampling. | |
QImage | addNoise (QImage &src, NoiseType type=GaussianNoise) |
Adds noise to an image. | |
QImage | blur (QImage &src, double factor=50.0) |
Blurs an image by convolving pixel neighborhoods. | |
QImage | edge (QImage &src, double factor=50.0) |
Detects edges in an image using pixel neighborhoods and an edge detection mask. | |
QImage | implode (QImage &src, double factor=30.0, unsigned int background=0xFFFFFFFF) |
Implodes an image by a specified percent. | |
QImage | oilPaint (QImage &src, int radius=3) |
Produces an oil painting effect. | |
QImage | sharpen (QImage &src, double factor=30.0) |
Sharpens the pixels in the image using pixel neighborhoods. | |
QImage | spread (QImage &src, unsigned int amount=3) |
Randomly displaces pixels. | |
QImage | shade (QImage &src, bool color_shading=true, double azimuth=30.0, double elevation=30.0) |
Shades the image using a distance light source. | |
QImage | swirl (QImage &src, double degrees=50.0, unsigned int background=0xFFFFFFFF) |
Swirls the image by a specified amount. | |
QImage | wave (QImage &src, double amplitude=25.0, double frequency=150.0, unsigned int background=0xFFFFFFFF) |
Modifies the pixels along a sine wave. |
Detailed Description
This class includes various QImage 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 47 of file kimageeffect.h.
Member Function Documentation
|
Create a gradient from color a to color b of the specified type.
Definition at line 58 of file kimageeffect.cpp. References QColor::blue(), QPixmap::defaultDepth(), dither(), QColor::green(), QSize::height(), QColor::red(), QImage::scanLine(), QColor::setRgb(), and QSize::width(). Referenced by KPixmapEffect::gradient(). |
|
Create 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 322 of file kimageeffect.cpp. References QColor::blue(), QPixmap::defaultDepth(), dither(), QColor::green(), QSize::height(), QColor::red(), QColor::rgb(), QImage::scanLine(), QColor::setRgb(), and QSize::width(). Referenced by blend(), and KPixmapEffect::unbalancedGradient(). |
|
Blends a color into the destination image, using an opacity value for blending one into another. Very fast direct pixel manipulation is used.
Definition at line 860 of file kimageeffect.cpp. References QImage::bits(), QImage::convertDepth(), QImage::depth(), QImage::height(), QColor::rgb(), and QImage::width(). Referenced by KPixmapEffect::blend(), blend(), and selectedImage(). |
|
Blend the src image into the destination image, using an opacity value for blending one into another. Very fast direct pixel manipulation is used.
Definition at line 903 of file kimageeffect.cpp. References QImage::bits(), QImage::convertDepth(), QImage::depth(), QImage::height(), and QImage::width(). |
|
Blend the provided image into a background of the indicated color.
Definition at line 955 of file kimageeffect.cpp. References QImage::bits(), QColor::blue(), QImage::depth(), QColor::green(), QImage::height(), intensity(), QColor::red(), and QImage::width(). |
|
Blend an image into another one, using a gradient type for blending from one to another.
Definition at line 1163 of file kimageeffect.cpp. References blend(), QImage::height(), QImage::size(), unbalancedGradient(), and QImage::width(). |
|
Blend an image into another one, using a color channel of a third image for the decision of blending from one to another.
Definition at line 1181 of file kimageeffect.cpp. References QImage::bits(), QImage::colorTable(), QImage::convertDepth(), QImage::depth(), QImage::height(), and QImage::width(). |
|
Blend an image into another one, using alpha in the expected way.
Definition at line 1784 of file kimageeffect.cpp. References QImage::copy(), QImage::depth(), QImage::height(), QImage::scanLine(), and QImage::width(). |
|
Blend an image into another one, using alpha in the expected way and over coordinates
The output is a QImage which is the Definition at line 1856 of file kimageeffect.cpp. References QImage::create(), QImage::depth(), QImage::height(), QImage::scanLine(), and QImage::width(). |
|
Blend an image into another one, using alpha in the expected way and over coordinates
The output is painted in the own Definition at line 1920 of file kimageeffect.cpp. References QImage::depth(), QImage::height(), QImage::scanLine(), and QImage::width(). |
|
Modifies the intensity of a pixmap's RGB channel component.
Definition at line 639 of file kimageeffect.cpp. References QImage::bits(), QImage::colorTable(), QImage::depth(), QImage::height(), QImage::numColors(), and QImage::width(). Referenced by KPixmapEffect::channelIntensity(). |
|
Fade an image to a certain background color. The number of colors will not be changed.
Definition at line 1462 of file kimageeffect.cpp. References QColor::blue(), QImage::color(), QImage::depth(), QColor::green(), QImage::height(), QImage::numColors(), QColor::red(), QImage::scanLine(), QImage::setColor(), and QImage::width(). Referenced by KPixmapEffect::fade(). |
|
This recolors a pixmap. The most dark color will become color a, the most bright one color b, and in between.
Definition at line 1365 of file kimageeffect.cpp. References QColor::blue(), QImage::color(), QImage::depth(), dither(), QColor::green(), QImage::height(), QImage::numColors(), QImage::pixel(), QColor::red(), QColor::rgb(), QImage::setColor(), QImage::setPixel(), and QImage::width(). Referenced by KPixmapEffect::pattern(). |
|
Build a hash on any given QImage.
Definition at line 1284 of file kimageeffect.cpp. References QImage::bits(), QImage::height(), and QImage::width(). Referenced by KPixmapEffect::hash(). |
|
Either brighten or dim the image by a specified percent. For example, .50 will modify the colors by 50%.
Definition at line 573 of file kimageeffect.cpp. References QImage::bits(), QImage::colorTable(), QImage::depth(), QImage::height(), QImage::numColors(), and QImage::width(). Referenced by blend(), and KPixmapEffect::intensity(). |
|
Modulate the image with a color channel of another image.
Definition at line 730 of file kimageeffect.cpp. References QImage::colorTable(), QImage::convertDepth(), QImage::depth(), QImage::height(), QColor::hsv(), QColor::rgb(), QImage::scanLine(), QColor::setHsv(), QColor::setRgb(), and QImage::width(). |
|
Convert an image to grayscale.
Definition at line 1544 of file kimageeffect.cpp. References QImage::bits(), QImage::color(), QImage::colorTable(), QImage::depth(), KStdAccel::end(), QImage::height(), QImage::numBytes(), QImage::numColors(), QImage::setColor(), and QImage::width(). Referenced by charcoal(), emboss(), and KPixmapEffect::toGray(). |
|
Desaturate an image evenly.
Definition at line 1594 of file kimageeffect.cpp. References QImage::bits(), QImage::colorTable(), QImage::depth(), QImage::height(), QColor::hsv(), QImage::numColors(), QColor::rgb(), QColor::setHsv(), QColor::setRgb(), and QImage::width(). Referenced by KPixmapEffect::desaturate(). |
|
Fast, but low quality contrast of an image. Also see contrastHSV.
Definition at line 1617 of file kimageeffect.cpp. References QImage::bits(), QImage::colorTable(), QImage::depth(), QImage::height(), QImage::numColors(), and QImage::width(). Referenced by KPixmapEffect::contrast(). |
|
Dither an image using Floyd-Steinberg dithering for low-color situations.
Definition at line 1667 of file kimageeffect.cpp. References QColor::blue(), QImage::depth(), QColor::green(), QImage::height(), QColor::red(), QImage::scanLine(), QImage::setColor(), QImage::setNumColors(), and QImage::width(). Referenced by KPixmapEffect::blend(), KPixmapEffect::dither(), flatten(), gradient(), KPixmapEffect::hash(), and unbalancedGradient(). |
|
Calculate the image for a selected image, for instance a selected icon on the desktop.
Definition at line 1991 of file kimageeffect.cpp. References blend(). Referenced by KPixmapEffect::selectedPixmap(). |
|
High quality, expensive HSV contrast. You can do a faster one by just taking a intensity threshold (ie: 128) and incrementing RGB color channels above it and decrementing those below it, but this gives much better results.
Definition at line 3756 of file kimageeffect.cpp. References QImage::bits(), QColor::blue(), QImage::colorTable(), QImage::depth(), QColor::green(), QImage::height(), QColor::hsv(), QImage::numColors(), QColor::red(), QColor::setHsv(), QColor::setRgb(), sharpen(), and QImage::width(). |
|
Normalizes the pixel values to span the full range of color values. This is a contrast enhancement technique.
Definition at line 2003 of file kimageeffect.cpp. References QImage::colorTable(), QImage::depth(), QImage::height(), QImage::numColors(), QImage::scanLine(), and QImage::width(). Referenced by charcoal(), and emboss(). |
|
Performs histogram equalization on the reference image.
Definition at line 2119 of file kimageeffect.cpp. References QImage::colorTable(), QImage::depth(), QImage::height(), QImage::numColors(), QImage::scanLine(), and QImage::width(). |
|
Thresholds the reference image. You can also threshold images by using ThresholdDither in the various QPixmap/QImage convert methods, but this lets you specify a threshold value.
Definition at line 2297 of file kimageeffect.cpp. References QImage::bits(), QImage::colorTable(), QImage::depth(), QImage::height(), QImage::numColors(), threshold(), and QImage::width(). Referenced by solarize(), and threshold(). |
|
Produces a 'solarization' effect seen when exposing a photographic film to light during the development process.
Definition at line 2920 of file kimageeffect.cpp. References QImage::bits(), QImage::colorTable(), QImage::depth(), QImage::height(), QImage::numColors(), threshold(), and QImage::width(). |
|
Embosses the source image. This involves highlighting the edges and applying various other enhancements in order to get a metal effect.
Definition at line 3422 of file kimageeffect.cpp. References QImage::colorTable(), QImage::depth(), QImage::height(), normalize(), QImage::scanLine(), toGray(), and QImage::width(). |
|
Minimizes speckle noise in the source image using the 8 hull algorithm.
Definition at line 2405 of file kimageeffect.cpp. References QImage::colorTable(), QImage::depth(), QImage::height(), QImage::scanLine(), and QImage::width(). |
|
Produces a neat little "charcoal" effect.
Definition at line 2313 of file kimageeffect.cpp. References blur(), QImage::detach(), edge(), QImage::invertPixels(), normalize(), and toGray(). |
|
Rotates the image by the specified amount.
Definition at line 2822 of file kimageeffect.cpp. References QImage::colorTable(), QImage::create(), QImage::depth(), QImage::height(), QImage::numColors(), QImage::scanLine(), QImage::setNumColors(), and QImage::width(). |
|
Scales an image using simple pixel sampling. This does not produce nearly as nice a result as QImage::smoothScale(), but has the advantage of being much faster - only a few milliseconds.
Definition at line 2204 of file kimageeffect.cpp. References QImage::colorTable(), QImage::depth(), QImage::height(), QImage::numColors(), QImage::scanLine(), QImage::setNumColors(), and QImage::width(). |
|
Adds noise to an image.
Definition at line 2611 of file kimageeffect.cpp. References QImage::colorTable(), QImage::depth(), QImage::height(), QImage::scanLine(), and QImage::width(). |
|
Blurs an image by convolving pixel neighborhoods.
Definition at line 3654 of file kimageeffect.cpp. References QImage::colorTable(), QImage::depth(), QImage::height(), QImage::scanLine(), and QImage::width(). Referenced by charcoal(). |
|
Detects edges in an image using pixel neighborhoods and an edge detection mask.
Definition at line 3174 of file kimageeffect.cpp. References QImage::colorTable(), QImage::depth(), QImage::height(), QImage::scanLine(), and QImage::width(). Referenced by charcoal(). |
|
Implodes an image by a specified percent.
Definition at line 2741 of file kimageeffect.cpp. References QImage::colorTable(), QImage::depth(), QImage::height(), QImage::scanLine(), and QImage::width(). |
|
Produces an oil painting effect.
Definition at line 3098 of file kimageeffect.cpp. References QImage::depth(), QImage::detach(), QImage::height(), QImage::scanLine(), and QImage::width(). |
|
Sharpens the pixels in the image using pixel neighborhoods.
Definition at line 3271 of file kimageeffect.cpp. References QImage::colorTable(), QImage::depth(), QImage::height(), QImage::scanLine(), and QImage::width(). Referenced by contrastHSV(). |
|
Randomly displaces pixels.
Definition at line 2943 of file kimageeffect.cpp. References QImage::depth(), QImage::detach(), QImage::height(), QImage::scanLine(), and QImage::width(). |
|
Shades the image using a distance light source.
Definition at line 3520 of file kimageeffect.cpp. References QImage::colorTable(), QImage::depth(), QImage::height(), QImage::scanLine(), shade(), and QImage::width(). Referenced by shade(). |
|
Swirls the image by a specified amount.
Definition at line 2994 of file kimageeffect.cpp. References QImage::colorTable(), QImage::depth(), QImage::height(), QImage::scanLine(), and QImage::width(). |
|
Modifies the pixels along a sine wave.
Definition at line 3072 of file kimageeffect.cpp. References QImage::height(), QImage::scanLine(), and QImage::width(). |
The documentation for this class was generated from the following files: