KImageEffect Class Reference
This class includes various QImage based graphical effects. More...
#include <kimageeffect.h>
Public Types | |
| enum | GradientType { VerticalGradient, HorizontalGradient, DiagonalGradient, CrossDiagonalGradient, PyramidGradient, RectangleGradient, PipeCrossGradient, EllipticGradient } |
| enum | RGBComponent { Red, Green, Blue, Gray, All } |
| enum | Lighting { NorthLite, NWLite, WestLite, SWLite, SouthLite, SELite, EastLite, NELite } |
| enum | ModulationType { Intensity, Saturation, HueShift, Contrast } |
| enum | NoiseType { UniformNoise = 0, GaussianNoise, MultiplicativeGaussianNoise, ImpulseNoise, LaplacianNoise, PoissonNoise } |
| enum | RotateDirection { Rotate90, Rotate180, Rotate270 } |
| enum | Disposition { NoImage = 0, Centered, Tiled, CenterTiled, CenteredMaxpect, TiledMaxpect, Scaled, CenteredAutoFit } |
Static Public Member Functions | |
| QImage | gradient (const QSize &size, const QColor &ca, const QColor &cb, GradientType type, int ncols=3) |
| QImage | unbalancedGradient (const QSize &size, const QColor &ca, const QColor &cb, GradientType type, int xfactor=100, int yfactor=100, int ncols=3) |
| QImage & | blend (const QColor &clr, QImage &dst, float opacity) |
| QImage & | blend (QImage &src, QImage &dst, float opacity) |
| QImage & | blend (QImage &image, float initial_intensity, const QColor &bgnd, GradientType eff, bool anti_dir=false) |
| QImage & | blend (QImage &image1, QImage &image2, GradientType gt, int xf=100, int yf=100) |
| QImage & | blend (QImage &image1, QImage &image2, QImage &blendImage, RGBComponent channel) |
| bool | blend (const QImage &upper, const QImage &lower, QImage &output) |
| bool | blend (int &x, int &y, const QImage &upper, const QImage &lower, QImage &output) |
| bool | blendOnLower (int x, int y, const QImage &upper, const QImage &lower) |
| void | blendOnLower (const QImage &upper, const QPoint &upperOffset, QImage &lower, const QRect &lowerRect) |
| void | blendOnLower (const QImage &upper, const QPoint &upperOffset, QImage &lower, const QRect &lowerRect, float opacity) |
| QRect | computeDestinationRect (const QSize &lowerSize, Disposition disposition, QImage &upper) |
| void | blendOnLower (QImage &upper, QImage &lower, Disposition disposition, float opacity) |
| QImage & | channelIntensity (QImage &image, float percent, RGBComponent channel) |
| QImage & | fade (QImage &image, float val, const QColor &color) |
| QImage & | flatten (QImage &image, const QColor &ca, const QColor &cb, int ncols=0) |
| QImage & | hash (QImage &image, Lighting lite=NorthLite, unsigned int spacing=0) |
| QImage & | intensity (QImage &image, float percent) |
| QImage & | modulate (QImage &image, QImage &modImage, bool reverse, ModulationType type, int factor, RGBComponent channel) |
| QImage & | toGray (QImage &image, bool fast=false) |
| QImage & | desaturate (QImage &image, float desat=0.3) |
| QImage & | contrast (QImage &image, int c) |
| QImage & | dither (QImage &image, const QColor *palette, int size) |
| QImage & | selectedImage (QImage &img, const QColor &col) |
| void | contrastHSV (QImage &img, bool sharpen=true) |
| void | normalize (QImage &img) |
| void | equalize (QImage &img) |
| void | threshold (QImage &img, unsigned int value=128) |
| void | solarize (QImage &img, double factor=50.0) |
| QImage | emboss (QImage &src, double radius, double sigma) |
| QImage | emboss (QImage &src) |
| QImage | despeckle (QImage &src) |
| QImage | charcoal (QImage &src, double radius, double sigma) |
| QImage | charcoal (QImage &src, double factor=50.0) |
| QImage | rotate (QImage &src, RotateDirection r) |
| QImage | sample (QImage &src, int w, int h) |
| QImage | addNoise (QImage &src, NoiseType type=GaussianNoise) |
| QImage | blur (QImage &src, double radius, double sigma) |
| QImage | blur (QImage &src, double factor=50.0) |
| QImage | edge (QImage &src, double radius) |
| QImage | implode (QImage &src, double factor=30.0, unsigned int background=0xFFFFFFFF) |
| QImage | oilPaintConvolve (QImage &src, double radius) |
| QImage | oilPaint (QImage &src, int radius=3) |
| QImage | sharpen (QImage &src, double radius, double sigma) |
| QImage | sharpen (QImage &src, double factor=30.0) |
| QImage | spread (QImage &src, unsigned int amount=3) |
| QImage | shade (QImage &src, bool color_shading=true, double azimuth=30.0, double elevation=30.0) |
| QImage | swirl (QImage &src, double degrees=50.0, unsigned int background=0xFFFFFFFF) |
| QImage | wave (QImage &src, double amplitude=25.0, double frequency=150.0, unsigned int background=0xFFFFFFFF) |
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 48 of file kimageeffect.h.
Member Enumeration Documentation
|
|
This enum provides a gradient type specification.
Definition at line 56 of file kimageeffect.h. |
|
|
This enum provides a RGB channel specification.
Definition at line 71 of file kimageeffect.h. |
|
|
This enum provides a lighting direction specification.
Definition at line 82 of file kimageeffect.h. |
|
|
This enum provides a modulation type specification.
Definition at line 96 of file kimageeffect.h. |
|
|
This enum provides a noise type specification.
Definition at line 106 of file kimageeffect.h. |
|
|
This enum provides a rotation specification.
Definition at line 118 of file kimageeffect.h. |
|
|
Disposition of a source image on top of a destination image.
Definition at line 314 of file kimageeffect.h. |
Member Function Documentation
|
||||||||||||||||||||||||
|
Create a gradient from color a to color b of the specified type.
Definition at line 103 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 367 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. This function uses MMX and SSE2 instructions to blend the image on processors that support it.
Definition at line 1046 of file kimageeffect.cpp. References QImage::bits(), QColor::blue(), QImage::convertDepth(), QImage::depth(), QColor::green(), KCPUInfo::haveExtension(), QImage::height(), QColor::red(), 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. This function uses MMX and SSE2 instructions to blend the images on processors that support it.
Definition at line 1287 of file kimageeffect.cpp. References QImage::bits(), QImage::convertDepth(), QImage::depth(), KCPUInfo::haveExtension(), QImage::height(), and QImage::width(). |
|
||||||||||||||||||||||||
|
Blend the provided image into a background of the indicated color.
Definition at line 1516 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 1724 of file kimageeffect.cpp. References blend(), QImage::height(), Red, 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 1742 of file kimageeffect.cpp. References QImage::bits(), Blue, QImage::colorTable(), QImage::convertDepth(), QImage::depth(), Green, QImage::height(), Red, and QImage::width(). |
|
||||||||||||||||
|
Blend an image into another one, using alpha in the expected way.
Definition at line 2345 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 2417 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 2481 of file kimageeffect.cpp. References QImage::depth(), QImage::height(), QImage::scanLine(), and QImage::width(). Referenced by blendOnLower(). |
|
||||||||||||||||||||
|
Blend part of an image into part of another, using the alpha channel in the expected way. Note that the destination rectangle will be correctly clipped.
Definition at line 2551 of file kimageeffect.cpp. References QImage::height(), QRect::height(), QRect::isValid(), QImage::rect(), QImage::scanLine(), QRect::setHeight(), QRect::setWidth(), QImage::width(), QRect::width(), QRect::x(), QPoint::x(), QRect::y(), and QPoint::y(). |
|
||||||||||||||||||||||||
|
Blend part of an image into part of another, using the opacity value and the alpha channel in the expected way. Note that the destination rectangle will be correctly clipped.
Definition at line 2573 of file kimageeffect.cpp. References QImage::height(), QRect::height(), QRect::isValid(), QImage::rect(), QImage::scanLine(), QRect::setHeight(), QRect::setWidth(), QImage::width(), QRect::width(), QRect::x(), QPoint::x(), QRect::y(), and QPoint::y(). |
|
||||||||||||||||
|
Compute the destination rectangle where to draw the upper image on top of another image using the given disposition. For tiled disposition, the rectangle should be duplicated on the whole area to obtained the wanted effect.
Definition at line 2595 of file kimageeffect.cpp. References Centered, CenteredAutoFit, CenteredMaxpect, CenterTiled, QImage::height(), QSize::height(), NoImage, Scaled, QRect::setCoords(), QRect::setRect(), QImage::smoothScale(), Tiled, TiledMaxpect, QImage::width(), and QSize::width(). Referenced by blendOnLower(). |
|
||||||||||||||||||||
|
Blend an image on top of another using a given disposition and a given opacity. The alpha channel of the upper image is used in the expected way. Beware the upper image may be modified.
Definition at line 2660 of file kimageeffect.cpp. References blendOnLower(), QRect::bottom(), computeDestinationRect(), QImage::height(), QRect::left(), QRect::right(), QImage::size(), QRect::top(), and QImage::width(). |
|
||||||||||||||||
|
Modifies the intensity of a pixmap's RGB channel component.
Definition at line 825 of file kimageeffect.cpp. References QImage::bits(), QImage::colorTable(), QImage::depth(), Green, QImage::height(), QImage::numColors(), Red, 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 2023 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 1926 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 1845 of file kimageeffect.cpp. References QImage::bits(), EastLite, QImage::height(), NELite, NorthLite, NWLite, SELite, SouthLite, SWLite, WestLite, 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%. This function uses MMX instructions to process the image on processors that support it.
Definition at line 633 of file kimageeffect.cpp. References QImage::bits(), QImage::colorTable(), QImage::depth(), KCPUInfo::haveExtension(), 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 916 of file kimageeffect.cpp. References All, Blue, QImage::colorTable(), Contrast, QImage::convertDepth(), QImage::depth(), Gray, Green, QImage::height(), HueShift, Intensity, Red, QColor::rgb(), Saturation, QImage::scanLine(), QColor::setHsv(), QColor::setRgb(), and QImage::width(). |
|
||||||||||||
|
Convert an image to grayscale.
Definition at line 2105 of file kimageeffect.cpp. |
