Namespace KImageEffect |
|
|
Functions to perform various QImage based graphical effects. |
|
Adds noise to an image.
src - The QImage to process. type - The algorithm used to generate the noise. Returns The image with noise added. The original is not changed. Author Daniel M. Duley (mosfet) |
|
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.
clr - source color to be blended into the destination image. dst - destination image in which the source will be blended into. opacity - opacity (between 0.0 and 1.0) which determines how much the source color will be blended into the destination image. Returns The destination image (dst) containing the result. Author Karol Szwed (gallium@kde.org) Author Fredrik Höglund (fredrik@kde.org) |
|
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.
src - source image to be blended into the destination image. dst - destination image in which the source will be blended into. opacity - opacity (between 0.0 and 1.0) which determines how much the source image will be blended into the destination image. Returns The destination image (dst) containing the result. Author Karol Szwed (gallium@kde.org) Author Fredrik Höglund (fredrik@kde.org) |
|
Blend the provided image into a background of the indicated color.
initial_intensity - this parameter takes values from -1 to 1: a) if positive: how much to fade the image in its less affected spot b) if negative: roughly indicates how much of the image remains unaffected bgnd - indicates the color of the background to blend in eff - lets you choose what kind of blending you like anti_dir - blend in the opposite direction (makes no much sense with concentric blending effects) image - must be 32bpp |
|
Blend an image into another one, using a gradient type for blending from one to another.
image1 - source1 and result of blending image2 - source2 of blending gt - gradient type for blending between source1 and source2 xf - x decay length for unbalanced gradient tpye yf - y decay length for unbalanced gradient tpye |
|
Blend an image into another one, using a color channel of a third image for the decision of blending from one to another.
image1 - Source 1 and result of blending image2 - Source 2 of blending blendImage - If the gray value of of pixel is 0, the result for this pixel is that of image1; for a gray value of 1, the pixel of image2 is used; for a value in between, a corresponding blending is used. channel - The RBG channel to use for the blending decision. |
|
Blend an image into another one, using alpha in the expected way. upper - the "upper" image lower - the "lower" image
output - the target image
Author Rik Hemsley (rikkus) |
|
Blend an image into another one, using alpha in the expected way and over coordinates x and y with respect to the lower image. The output is a QImage which is the upper image already blended with the lower one, so its size will be (in general) the same than upper instead of the same size than lower like the method above. In fact, the size of output is like upper's one only when it can be painted on lower, if there has to be some clipping, output's size will be the clipped area and x and y will be set to the correct up-left corner where the clipped rectangle begins. x - x-coordinate of lower image y - y-coordinate of lower image upper - the "upper" image lower - the "lower" image output - the target image |
|
Blend an image into another one, using alpha in the expected way and over coordinates x and y with respect to the lower image. The output is painted in the own lower image. This is an optimization of the blend method above provided by convenience. x - x-coordinate of lower image y - y-coordinate of lower image upper - the "upper" image lower - the "lower" image, which becomes the output image |
|
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.
upper - the "upper" image upperOffset - Offset for the part of the upper image to be used. lower - the "lower" image lowerRect - Rectangle for the part of the lower image where the blending will occur. |
|
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.
upper - the "upper" image upperOffset - Offset for the part of the upper image to be used. lower - the "lower" image lowerRect - Rectangle for the part of the lower image where the blending will occur. opacity - Opacity (between 0.0 and 1.0) which determines how much the source image will be blended into the destination image. |
|
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. |
|
Blurs an image by convolving pixel neighborhoods.
src - The QImage to process. radius - The radius of the gaussian not counting the center pixel. Use 0 and a suitable radius will be automatically used. sigma - The standard deviation of the gaussian. Use 1 if you're not sure. Returns The blurred image. The original is not changed. Author Daniel M. Duley (mosfet) |
|
This is provided for binary compatability only! Use the above method with a radius and sigma instead! |
|
A bumpmapping algorithm.
img - the image you want bumpmap map - the map used azimuth - azimuth elevation - elevation depth - depth (not the depth of the image, but of the map) xofs - X offset yofs - Y offset waterlevel - level that full transparency should represent ambient - ambient lighting factor compensate - compensate for darkening invert - invert bumpmap type - type of the bumpmap tiled - tile the bumpmap over the image through the Y offset
Returns The destination image (dst) containing the result.
Author Zack Rusin |
|
Modifies the intensity of a pixmap's RGB channel component.
image - The QImage to process. percent - Percent value. Use a negative value to dim. channel - Which channel(s) should be modified Returns The image, provided for convenience. Author Daniel M. Duley (mosfet) |
|
Produces a neat little "charcoal" effect.
src - The QImage to process. radius - The radius of the gaussian not counting the center pixel. Use 0 and a suitable radius will be automatically used. sigma - The standard deviation of the gaussian. Use 1 if you're not sure. Returns The charcoal image. The original is not changed. Author Daniel M. Duley (mosfet) |
|
This is provided for binary compatability only! Use the above method with a radius and sigma instead! |
|
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.
lowerSize - The size of the destination image. disposition - The wanted disposition. upper - The upper image. Note that this image may be scaled to adjust to the requested disposition. Returns the computed rectangle. Its size may exceed lowerSize. |
|
Fast, but low quality contrast of an image. Also see contrastHSV.
image - The QImage to process. c - A contrast value between -255 to 255. Returns The image(), provided for convenience. Author Daniel M. Duley (mosfet) ###KDE 4: remove |
|
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.
img - The QImage to process. sharpen - If true sharpness is increase, (spiffed). Otherwise it is decreased, (dulled). Author Daniel M. Duley (mosfet) |
|
Desaturate an image evenly.
image - The QImage to process. desat - A value between 0 and 1 setting the degree of desaturation Returns Returns the image(), provided for convenience. |
|
Minimizes speckle noise in the source image using the 8 hull algorithm.
src - The QImage to process. Returns The despeckled image. The original is not changed. Author Daniel M. Duley (mosfet) |
|
Dither an image using Floyd-Steinberg dithering for low-color situations.
image - The QImage to process. palette - The color palette to use size - The size of the palette Returns Returns the image(), provided for convenience. |
|
Detects edges in an image using pixel neighborhoods and an edge detection mask.
src - The QImage to process. radius - The radius of the gaussian not counting the center pixel. Use 0 and a suitable radius will be automatically used. Returns The image with edges detected. The original is not changed. Author Daniel M. Duley (mosfet) |
|
Embosses the source image. This involves highlighting the edges and applying various other enhancements in order to get a metal effect.
src - The QImage to process. radius - The radius of the gaussian not counting the center pixel. Use 0 and a suitable radius will be automatically used. sigma - The standard deviation of the gaussian. Use 1 if you're not sure. Returns The embossed image. The original is not changed. Author Daniel M. Duley (mosfet) |
|
Convenience method. |
|
Performs histogram equalisation on the reference image. img - the image that is equalised Author Daniel M. Duley (mosfet) |
|
Fade an image to a certain background color. The number of colors will not be changed.
image - The QImage to process. val - The strength of the effect. 0 <= val <= 1. color - The background color. Returns Returns the image(), provided for convenience. |
|
This recolors a pixmap. The most dark color will become color a, the most bright one color b, and in between.
image - A QImage to process. ca - Color a cb - Color b ncols - The number of colors to dither the image to. Pass 0 to prevent dithering. |
|
Create a gradient from color a to color b of the specified type.
size - The desired size of the gradient. ca - Color a cb - Color b type - The type of gradient. ncols - The number of colors to use when not running on a truecolor display. The gradient will be dithered to this number of colors. Pass 0 to prevent dithering. |
|
Build a hash on any given QImage
image - The QImage to process lite - The hash faces the indicated lighting (cardinal poles). spacing - How many unmodified pixels in between hashes. Returns Returns the image(), provided for convenience. |
|
Implodes an image by a specified percent.
src - The QImage to process. factor - The extent of the implosion. background - An RGBA value to use for the background. After the effect some pixels may be "empty". This value is used for those pixels. Returns The imploded image. The original is not changed. Author Daniel M. Duley (mosfet) |
|
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.
image - The QImage to process. percent - The percent value. Use a negative value to dim. Returns Returns The image(), provided for convenience. Author Daniel M. Duley (mosfet) Author Benjamin Roe (ben@benroe.com) |
|
Modulate the image with a color channel of another image.
image - The QImage to modulate and result. modImage - The QImage to use for modulation. reverse - Invert the meaning of image/modImage; result is image! type - The modulation Type to use. factor - The modulation amplitude; with 0 no effect [-200;200]. channel - The RBG channel of image2 to use for modulation. Returns Returns the image(), provided for convenience. |
|
Normalises the pixel values to span the full range of color values. This is a contrast enhancement technique. img - the image that is normalised Author Daniel M. Duley (mosfet) |
|
This is provided for binary compatability only! Use the above method instead! |
|
Produces an oil painting effect.
src - The QImage to process. radius - The radius of the gaussian not counting the center pixel. Use 0 and a suitable radius will be automatically used. Returns The new image. The original is not changed. Author Daniel M. Duley (mosfet) |
|
Rotates the image by the specified amount
src - The QImage to process. r - The rotate direction. Returns The rotated image. The original is not changed. Author Daniel M. Duley (mosfet) |
|
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.
src - The QImage to process. w - The new width. h - The new height. Returns The scaled image. The original is not changed. Author Daniel M. Duley (mosfet) |
|
Calculate the image for a selected image, for instance a selected icon on the desktop. img - the QImage to select col - the selected color, usually from QPalette.highlight(). |
|
Shades the image using a distance light source.
src - The QImage to process. color_shading - If true do color shading, otherwise do grayscale. azimuth - Determines the light source and direction. elevation - Determines the light source and direction. Returns The shaded image. The original is not changed. Author Daniel M. Duley (mosfet) |
|
Sharpens the pixels in the image using pixel neighborhoods.
src - The QImage to process. radius - The radius of the gaussian not counting the center pixel. Use 0 and a suitable radius will be automatically used. sigma - The standard deviation of the gaussian. Use 1 if you're not sure. Returns The sharpened image. The original is not changed. Author Daniel M. Duley (mosfet) |
|
This is provided for binary compatability only! Use the above method instead! |
|
Produces a 'solarization' effect seen when exposing a photographic film to light during the development process.
img - The QImage to process. factor - The extent of the solarization (0-99.9) Author Daniel M. Duley (mosfet) |
|
Randomly displaces pixels.
src - The QImage to process. amount - The vicinity for choosing a random pixel to swap. Returns The image with pixels displaced. The original is not changed. Author Daniel M. Duley (mosfet) |
|
Swirls the image by a specified amount
src - The QImage to process. degrees - The tightness of the swirl. background - An RGBA value to use for the background. After the effect some pixels may be "empty". This value is used for those pixels. Returns The swirled image. The original is not changed. Author Daniel M. Duley (mosfet) |
|
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.
img - The QImage to process. value - The threshold value. Author Daniel M. Duley (mosfet) |
|
Convert an image to grayscale.
image - The QImage to process. fast - Set to true in order to use a faster but non-photographic quality algorithm. Appropriate for things such as toolbar icons. Returns Returns the image(), provided for convenience. Author Daniel M. Duley (mosfet) |
|
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.
size - The desired size of the gradient. ca - Color a cb - Color b type - The type of gradient. xfactor - The x decay length. Use a value between -200 and 200. yfactor - The y decay length. ncols - The number of colors. See KImageEffect:gradient. |
|
Modifies the pixels along a sine wave.
src - The QImage to process. amplitude - The amplitude of the sine wave. frequency - The frequency of the sine wave. background - An RGBA value to use for the background. After the effect some pixels may be "empty". This value is used for those pixels. Returns The new image. The original is not changed. Author Daniel M. Duley (mosfet) |