org.kde.koala

Class KImageEffect

public class KImageEffect extends Object implements QtSupport

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.

UNKNOWN: This class includes various QImage based graphical effects.

Field Summary
static intAll
static intBlue
static intCentered
static intCenteredAutoFit
static intCenteredMaxpect
static intCenterTiled
static intContrast
static intCrossDiagonalGradient
static intDiagonalGradient
static intEastLite
static intEllipticGradient
static intGaussianNoise
static intGray
static intGreen
static intHorizontalGradient
static intHueShift
static intImpulseNoise
static intIntensity
This enum provides a modulation type specification
static intLaplacianNoise
static intLinear
This enum lists possible bumpmapping implementations.
static intMultiplicativeGaussianNoise
static intNELite
static intNoImage
Disposition of a source image on top of a destination image.
static intNorthLite
This enum provides a lighting direction specification
static intNWLite
static intPipeCrossGradient
static intPoissonNoise
static intPyramidGradient
static intRectangleGradient
static intRed
This enum provides a RGB channel specification
static intRotate180
static intRotate270
static intRotate90
This enum provides a rotation specification.
static intSaturation
static intScaled
static intSELite
static intSinuosidal
static intSouthLite
static intSpherical
static intSWLite
static intTiled
static intTiledMaxpect
static intUniformNoise
This enum provides a noise type specification
static intVerticalGradient
This enum provides a gradient type specification
static intWestLite
Constructor Summary
protected KImageEffect(Class dummy)
KImageEffect()
Method Summary
static QImageaddNoise(QImage src, int type)
Adds noise to an image.
static QImageaddNoise(QImage src)
static QImageblend(QColor clr, QImage dst, float opacity)
Blends a color into the destination image, using an opacity value for blending one into another.
static QImageblend(QImage src, QImage dst, float opacity)
Blend the src image into the destination image, using an opacity value for blending one into another.
static QImageblend(QImage image, float initial_intensity, QColor bgnd, int eff, boolean anti_dir)
Blend the provided image into a background of the indicated color.
static QImageblend(QImage image, float initial_intensity, QColor bgnd, int eff)
static QImageblend(QImage image1, QImage image2, int gt, int xf, int yf)
Blend an image into another one, using a gradient type for blending from one to another.
static QImageblend(QImage image1, QImage image2, int gt, int xf)
static QImageblend(QImage image1, QImage image2, int gt)
static QImageblend(QImage image1, QImage image2, QImage blendImage, int channel)
Blend an image into another one, using a color channel of a third image for the decision of blending from one to another.
static booleanblend(QImage upper, QImage lower, QImage output)
Blend an image into another one, using alpha in the expected way.
static booleanblend(int[] x, int[] y, QImage upper, 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.
static booleanblendOnLower(int x, int y, QImage upper, 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.
static voidblendOnLower(QImage upper, QPoint upperOffset, QImage lower, QRect lowerRect)
Blend part of an image into part of another, using the alpha channel in the expected way.
static voidblendOnLower(QImage upper, QPoint upperOffset, QImage lower, QRect lowerRect, float opacity)
Blend part of an image into part of another, using the opacity value and the alpha channel in the expected way.
static voidblendOnLower(QImage upper, QImage lower, int disposition, float opacity)
Blend an image on top of another using a given disposition and a given opacity.
static QImageblur(QImage src, double radius, double sigma)
Blurs an image by convolving pixel neighborhoods.
static QImageblur(QImage src, double factor)
This is provided for binary compatability only!
static QImageblur(QImage src)
static QImagebumpmap(QImage img, QImage map, double azimuth, double elevation, int depth, int xofs, int yofs, int waterlevel, int ambient, boolean compensate, boolean invert, int type, boolean tiled)
A bumpmapping algorithm.
static QImagechannelIntensity(QImage image, float percent, int channel)
Modifies the intensity of a pixmap's RGB channel component.
static QImagecharcoal(QImage src, double radius, double sigma)
Produces a neat little "charcoal" effect.
static QImagecharcoal(QImage src, double factor)
This is provided for binary compatability only!
static QImagecharcoal(QImage src)
static QRectcomputeDestinationRect(QSize lowerSize, int disposition, QImage upper)
Compute the destination rectangle where to draw the upper image on top of another image using the given disposition.
static QImagecontrast(QImage image, int c)
Fast, but low quality contrast of an image.
static voidcontrastHSV(QImage img, boolean sharpen)
High quality, expensive HSV contrast.
static voidcontrastHSV(QImage img)
static QImagedesaturate(QImage image, float desat)
Desaturate an image evenly.
static QImagedesaturate(QImage image)
static QImagedespeckle(QImage src)
Minimizes speckle noise in the source image using the 8 hull algorithm.
voiddispose()
Delete the wrapped C++ instance ahead of finalize()
static QImagedither(QImage image, QColor palette, int size)
Dither an image using Floyd-Steinberg dithering for low-color situations.
static QImageedge(QImage src, double radius)
Detects edges in an image using pixel neighborhoods and an edge detection mask.
static QImageemboss(QImage src, double radius, double sigma)
Embosses the source image.
static QImageemboss(QImage src)
Convenience method.
static voidequalize(QImage img)
Performs histogram equalisation on the reference image.
static QImagefade(QImage image, float val, QColor color)
Fade an image to a certain background color.
protected voidfinalize()
Deletes the wrapped C++ instance
static QImageflatten(QImage image, QColor ca, QColor cb, int ncols)
This recolors a pixmap.
static QImageflatten(QImage image, QColor ca, QColor cb)
static QImagegradient(QSize size, QColor ca, QColor cb, int type, int ncols)
Create a gradient from color a to color b of the specified type.
static QImagegradient(QSize size, QColor ca, QColor cb, int type)
static QImagehash(QImage image, int lite, int spacing)
Build a hash on any given QImage
static QImagehash(QImage image, int lite)
static QImagehash(QImage image)
static QImageimplode(QImage src, double factor, int background)
Implodes an image by a specified percent.
static QImageimplode(QImage src, double factor)
static QImageimplode(QImage src)
static QImageintensity(QImage image, float percent)
Either brighten or dim the image by a specified percent.
booleanisDisposed()
Has the wrapped C++ instance been deleted?
static QImagemodulate(QImage image, QImage modImage, boolean reverse, int type, int factor, int channel)
Modulate the image with a color channel of another image.
static voidnormalize(QImage img)
Normalises the pixel values to span the full range of color values.
static QImageoilPaint(QImage src, int radius)
This is provided for binary compatability only!
static QImageoilPaint(QImage src)
static QImageoilPaintConvolve(QImage src, double radius)
Produces an oil painting effect.
static QImagerotate(QImage src, int r)
Rotates the image by the specified amount
static QImagesample(QImage src, int w, int h)
Scales an image using simple pixel sampling.
static QImageselectedImage(QImage img, QColor col)
Calculate the image for a selected image, for instance a selected icon on the desktop.
static QImageshade(QImage src, boolean color_shading, double azimuth, double elevation)
Shades the image using a distance light source.
static QImageshade(QImage src, boolean color_shading, double azimuth)
static QImageshade(QImage src, boolean color_shading)
static QImageshade(QImage src)
static QImagesharpen(QImage src, double radius, double sigma)
Sharpens the pixels in the image using pixel neighborhoods.
static QImagesharpen(QImage src, double factor)
This is provided for binary compatability only!
static QImagesharpen(QImage src)
static voidsolarize(QImage img, double factor)
Produces a 'solarization' effect seen when exposing a photographic film to light during the development process.
static voidsolarize(QImage img)
static QImagespread(QImage src, int amount)
Randomly displaces pixels.
static QImagespread(QImage src)
static QImageswirl(QImage src, double degrees, int background)
Swirls the image by a specified amount
static QImageswirl(QImage src, double degrees)
static QImageswirl(QImage src)
static voidthreshold(QImage img, int value)
Thresholds the reference image.
static voidthreshold(QImage img)
static QImagetoGray(QImage image, boolean fast)
Convert an image to grayscale.
static QImagetoGray(QImage image)
static QImageunbalancedGradient(QSize size, QColor ca, QColor cb, int type, int xfactor, int yfactor, int ncols)
Create an unbalanced gradient.
static QImageunbalancedGradient(QSize size, QColor ca, QColor cb, int type, int xfactor, int yfactor)
static QImageunbalancedGradient(QSize size, QColor ca, QColor cb, int type, int xfactor)
static QImageunbalancedGradient(QSize size, QColor ca, QColor cb, int type)
static QImagewave(QImage src, double amplitude, double frequency, int background)
Modifies the pixels along a sine wave.
static QImagewave(QImage src, double amplitude, double frequency)
static QImagewave(QImage src, double amplitude)
static QImagewave(QImage src)

Field Detail

All

public static final int All

Blue

public static final int Blue

Centered

public static final int Centered

CenteredAutoFit

public static final int CenteredAutoFit

CenteredMaxpect

public static final int CenteredMaxpect

CenterTiled

public static final int CenterTiled

Contrast

public static final int Contrast

CrossDiagonalGradient

public static final int CrossDiagonalGradient

DiagonalGradient

public static final int DiagonalGradient

EastLite

public static final int EastLite

EllipticGradient

public static final int EllipticGradient

GaussianNoise

public static final int GaussianNoise

Gray

public static final int Gray

Green

public static final int Green

HorizontalGradient

public static final int HorizontalGradient

HueShift

public static final int HueShift

ImpulseNoise

public static final int ImpulseNoise

Intensity

public static final int Intensity
This enum provides a modulation type specification

See Also: KImageEffect

UNKNOWN: This enum provides a modulation type specification

LaplacianNoise

public static final int LaplacianNoise

Linear

public static final int Linear
This enum lists possible bumpmapping implementations.

See Also: KImageEffect

UNKNOWN: This enum lists possible bumpmapping implementations.

MultiplicativeGaussianNoise

public static final int MultiplicativeGaussianNoise

NELite

public static final int NELite

NoImage

public static final int NoImage
Disposition of a source image on top of a destination image.

See Also: KImageEffect KImageEffect

UNKNOWN: Disposition of a source image on top of a destination image.

NorthLite

public static final int NorthLite
This enum provides a lighting direction specification

See Also: KImageEffect

UNKNOWN: This enum provides a lighting direction specification

NWLite

public static final int NWLite

PipeCrossGradient

public static final int PipeCrossGradient

PoissonNoise

public static final int PoissonNoise

PyramidGradient

public static final int PyramidGradient

RectangleGradient

public static final int RectangleGradient

Red

public static final int Red
This enum provides a RGB channel specification

See Also: KImageEffect KImageEffect KImageEffect

UNKNOWN: This enum provides a RGB channel specification

Rotate180

public static final int Rotate180

Rotate270

public static final int Rotate270

Rotate90

public static final int Rotate90
This enum provides a rotation specification.

See Also: KImageEffect

UNKNOWN: This enum provides a rotation specification.

Saturation

public static final int Saturation

Scaled

public static final int Scaled

SELite

public static final int SELite

Sinuosidal

public static final int Sinuosidal

SouthLite

public static final int SouthLite

Spherical

public static final int Spherical

SWLite

public static final int SWLite

Tiled

public static final int Tiled

TiledMaxpect

public static final int TiledMaxpect

UniformNoise

public static final int UniformNoise
This enum provides a noise type specification

See Also: KImageEffect

UNKNOWN: This enum provides a noise type specification

VerticalGradient

public static final int VerticalGradient
This enum provides a gradient type specification

See Also: KImageEffect KImageEffect KImageEffect

UNKNOWN: This enum provides a gradient type specification

WestLite

public static final int WestLite

Constructor Detail

KImageEffect

protected KImageEffect(Class dummy)

KImageEffect

public KImageEffect()

Method Detail

addNoise

public static QImage addNoise(QImage src, int type)
Adds noise to an image.

Parameters: 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)

UNKNOWN: Adds noise to an image.

addNoise

public static QImage addNoise(QImage src)

blend

public static QImage blend(QColor clr, QImage dst, float opacity)
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.

Parameters: 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: Fredrik Höglund (fredrik@kde.org)

UNKNOWN: Blends a color into the destination image, using an opacity value for blending one into another.

blend

public static 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. Very fast direct pixel manipulation is used. This function uses MMX and SSE2 instructions to blend the images on processors that support it.

Parameters: 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: Fredrik Höglund (fredrik@kde.org)

UNKNOWN: Blend the src image into the destination image, using an opacity value for blending one into another.

blend

public static QImage blend(QImage image, float initial_intensity, QColor bgnd, int eff, boolean anti_dir)
Blend the provided image into a background of the indicated color.

Parameters: 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

UNKNOWN: Blend the provided image into a background of the indicated color.

blend

public static QImage blend(QImage image, float initial_intensity, QColor bgnd, int eff)

blend

public static QImage blend(QImage image1, QImage image2, int gt, int xf, int yf)
Blend an image into another one, using a gradient type for blending from one to another.

Parameters: 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

UNKNOWN: Blend an image into another one, using a gradient type for blending from one to another.

blend

public static QImage blend(QImage image1, QImage image2, int gt, int xf)

blend

public static QImage blend(QImage image1, QImage image2, int gt)

blend

public static QImage blend(QImage image1, QImage image2, QImage blendImage, int channel)
Blend an image into another one, using a color channel of a third image for the decision of blending from one to another.

Parameters: 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.

UNKNOWN: Blend an image into another one, using a color channel of a third image for the decision of blending from one to another.

blend

public static boolean blend(QImage upper, QImage lower, QImage output)
Blend an image into another one, using alpha in the expected way.

Parameters: upper the "upper" image lower the "lower" image output the target image

Author: Rik Hemsley (rikkus)

UNKNOWN: Blend an image into another one, using alpha in the expected way.

blend

public static boolean blend(int[] x, int[] y, QImage upper, 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. 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.

Parameters: x x-coordinate of lower image y y-coordinate of lower image upper the "upper" image lower the "lower" image output the target image

UNKNOWN: Blend an image into another one, using alpha in the expected way and over coordinates x and y with respect to the lower image.

blendOnLower

public static boolean blendOnLower(int x, int y, QImage upper, 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. The output is painted in the own lower image. This is an optimization of the blend method above provided by convenience.

Parameters: 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

UNKNOWN: Blend an image into another one, using alpha in the expected way and over coordinates x and y with respect to the lower image.

blendOnLower

public static void blendOnLower(QImage upper, QPoint upperOffset, QImage lower, QRect lowerRect)
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.

Parameters: 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.

UNKNOWN: Blend part of an image into part of another, using the alpha channel in the expected way.

blendOnLower

public static void blendOnLower(QImage upper, QPoint upperOffset, QImage lower, QRect lowerRect, float opacity)
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.

Parameters: 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.

UNKNOWN: Blend part of an image into part of another, using the opacity value and the alpha channel in the expected way.

blendOnLower

public static void blendOnLower(QImage upper, QImage lower, int disposition, float opacity)
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.

UNKNOWN: Blend an image on top of another using a given disposition and a given opacity.

blur

public static QImage blur(QImage src, double radius, double sigma)
Blurs an image by convolving pixel neighborhoods.

Parameters: 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)

UNKNOWN: Blurs an image by convolving pixel neighborhoods.

blur

public static QImage blur(QImage src, double factor)
This is provided for binary compatability only! Use the above method with a radius and sigma instead!

UNKNOWN: This is provided for binary compatability only! Use the above method with a radius and sigma instead!

blur

public static QImage blur(QImage src)

bumpmap

public static QImage bumpmap(QImage img, QImage map, double azimuth, double elevation, int depth, int xofs, int yofs, int waterlevel, int ambient, boolean compensate, boolean invert, int type, boolean tiled)
A bumpmapping algorithm.

Parameters: 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

UNKNOWN: A bumpmapping algorithm.

channelIntensity

public static QImage channelIntensity(QImage image, float percent, int channel)
Modifies the intensity of a pixmap's RGB channel component.

Parameters: 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)

UNKNOWN: Modifies the intensity of a pixmap's RGB channel component.

charcoal

public static QImage charcoal(QImage src, double radius, double sigma)
Produces a neat little "charcoal" effect.

Parameters: 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)

UNKNOWN: Produces a neat little "charcoal" effect.

charcoal

public static QImage charcoal(QImage src, double factor)
This is provided for binary compatability only! Use the above method with a radius and sigma instead!

UNKNOWN: This is provided for binary compatability only! Use the above method with a radius and sigma instead!

charcoal

public static QImage charcoal(QImage src)

computeDestinationRect

public static QRect computeDestinationRect(QSize lowerSize, int disposition, QImage upper)
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.

Parameters: 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 @e lowerSize.

UNKNOWN: Compute the destination rectangle where to draw the upper image on top of another image using the given disposition.

contrast

public static QImage contrast(QImage image, int c)
Fast, but low quality contrast of an image. Also see contrastHSV.

Parameters: 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

UNKNOWN: Fast, but low quality contrast of an image.

contrastHSV

public static void contrastHSV(QImage img, boolean sharpen)
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.

Parameters: img The QImage to process. sharpen If true sharpness is increase, (spiffed). Otherwise it is decreased, (dulled).

Author: Daniel M. Duley (mosfet)

UNKNOWN: High quality, expensive HSV contrast.

contrastHSV

public static void contrastHSV(QImage img)

desaturate

public static QImage desaturate(QImage image, float desat)
Desaturate an image evenly.

Parameters: image The QImage to process. desat A value between 0 and 1 setting the degree of desaturation

Returns: Returns the image(), provided for convenience.

UNKNOWN: Desaturate an image evenly.

desaturate

public static QImage desaturate(QImage image)

despeckle

public static QImage despeckle(QImage src)
Minimizes speckle noise in the source image using the 8 hull algorithm.

Parameters: src The QImage to process.

Returns: The despeckled image. The original is not changed.

Author: Daniel M. Duley (mosfet)

UNKNOWN: Minimizes speckle noise in the source image using the 8 hull algorithm.

dispose

public void dispose()
Delete the wrapped C++ instance ahead of finalize()

dither

public static QImage dither(QImage image, QColor palette, int size)
Dither an image using Floyd-Steinberg dithering for low-color situations.

Parameters: image The QImage to process. palette The color palette to use size The size of the palette

Returns: Returns the image(), provided for convenience.

UNKNOWN: Dither an image using Floyd-Steinberg dithering for low-color situations.

edge

public static QImage edge(QImage src, double radius)
Detects edges in an image using pixel neighborhoods and an edge detection mask.

Parameters: 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)

UNKNOWN: Detects edges in an image using pixel neighborhoods and an edge detection mask.

emboss

public static QImage emboss(QImage src, double radius, double sigma)
Embosses the source image. This involves highlighting the edges and applying various other enhancements in order to get a metal effect.

Parameters: 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)

UNKNOWN: Embosses the source image.

emboss

public static QImage emboss(QImage src)
Convenience method.

UNKNOWN: Convenience method.

equalize

public static void equalize(QImage img)
Performs histogram equalisation on the reference image.

Parameters: img the image that is equalised

Author: Daniel M. Duley (mosfet)

UNKNOWN: Performs histogram equalisation on the reference image.

fade

public static QImage fade(QImage image, float val, QColor color)
Fade an image to a certain background color. The number of colors will not be changed.

Parameters: 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.

UNKNOWN: Fade an image to a certain background color.

finalize

protected void finalize()
Deletes the wrapped C++ instance

flatten

public static QImage flatten(QImage image, QColor ca, QColor cb, int ncols)
This recolors a pixmap. The most dark color will become color a, the most bright one color b, and in between.

Parameters: 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.

UNKNOWN: This recolors a pixmap.

flatten

public static QImage flatten(QImage image, QColor ca, QColor cb)

gradient

public static QImage gradient(QSize size, QColor ca, QColor cb, int type, int ncols)
Create a gradient from color a to color b of the specified type.

Parameters: 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.

UNKNOWN: Create a gradient from color a to color b of the specified type.

gradient

public static QImage gradient(QSize size, QColor ca, QColor cb, int type)

hash

public static QImage hash(QImage image, int lite, int spacing)
Build a hash on any given QImage

Parameters: 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.

UNKNOWN: Build a hash on any given QImage

hash

public static QImage hash(QImage image, int lite)

hash

public static QImage hash(QImage image)

implode

public static QImage implode(QImage src, double factor, int background)
Implodes an image by a specified percent.

Parameters: 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)

UNKNOWN: Implodes an image by a specified percent.

implode

public static QImage implode(QImage src, double factor)

implode

public static QImage implode(QImage src)

intensity

public static QImage intensity(QImage image, float percent)
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.

Parameters: image The QImage to process. percent The percent value. Use a negative value to dim.

Returns: Returns The image(), provided for convenience.

Author: Benjamin Roe (ben@benroe.com)

UNKNOWN: Either brighten or dim the image by a specified percent.

isDisposed

public boolean isDisposed()
Has the wrapped C++ instance been deleted?

modulate

public static QImage modulate(QImage image, QImage modImage, boolean reverse, int type, int factor, int channel)
Modulate the image with a color channel of another image.

Parameters: 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.

UNKNOWN: Modulate the image with a color channel of another image.

normalize

public static void normalize(QImage img)
Normalises the pixel values to span the full range of color values. This is a contrast enhancement technique.

Parameters: img the image that is normalised

Author: Daniel M. Duley (mosfet)

UNKNOWN: Normalises the pixel values to span the full range of color values.

oilPaint

public static QImage oilPaint(QImage src, int radius)
This is provided for binary compatability only! Use the above method instead!

UNKNOWN: This is provided for binary compatability only! Use the above method instead!

oilPaint

public static QImage oilPaint(QImage src)

oilPaintConvolve

public static QImage oilPaintConvolve(QImage src, double radius)
Produces an oil painting effect.

Parameters: 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)

UNKNOWN: Produces an oil painting effect.

rotate

public static QImage rotate(QImage src, int r)
Rotates the image by the specified amount

Parameters: src The QImage to process. r The rotate direction.

Returns: The rotated image. The original is not changed.

Author: Daniel M. Duley (mosfet)

UNKNOWN: Rotates the image by the specified amount

sample

public static QImage sample(QImage src, int w, int h)
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.

Parameters: 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)

UNKNOWN: Scales an image using simple pixel sampling.

selectedImage

public static QImage selectedImage(QImage img, QColor col)
Calculate the image for a selected image, for instance a selected icon on the desktop.

Parameters: img the QImage to select col the selected color, usually from QColorGroup.highlight().

UNKNOWN: Calculate the image for a selected image, for instance a selected icon on the desktop.

shade

public static QImage shade(QImage src, boolean color_shading, double azimuth, double elevation)
Shades the image using a distance light source.

Parameters: 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)

UNKNOWN: Shades the image using a distance light source.

shade

public static QImage shade(QImage src, boolean color_shading, double azimuth)

shade

public static QImage shade(QImage src, boolean color_shading)

shade

public static QImage shade(QImage src)

sharpen

public static QImage sharpen(QImage src, double radius, double sigma)
Sharpens the pixels in the image using pixel neighborhoods.

Parameters: 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)

UNKNOWN: Sharpens the pixels in the image using pixel neighborhoods.

sharpen

public static QImage sharpen(QImage src, double factor)
This is provided for binary compatability only! Use the above method instead!

UNKNOWN: This is provided for binary compatability only! Use the above method instead!

sharpen

public static QImage sharpen(QImage src)

solarize

public static void solarize(QImage img, double factor)
Produces a 'solarization' effect seen when exposing a photographic film to light during the development process.

Parameters: img The QImage to process. factor The extent of the solarization (0-99.9)

Author: Daniel M. Duley (mosfet)

UNKNOWN: Produces a 'solarization' effect seen when exposing a photographic film to light during the development process.

solarize

public static void solarize(QImage img)

spread

public static QImage spread(QImage src, int amount)
Randomly displaces pixels.

Parameters: 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)

UNKNOWN: Randomly displaces pixels.

spread

public static QImage spread(QImage src)

swirl

public static QImage swirl(QImage src, double degrees, int background)
Swirls the image by a specified amount

Parameters: 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)

UNKNOWN: Swirls the image by a specified amount

swirl

public static QImage swirl(QImage src, double degrees)

swirl

public static QImage swirl(QImage src)

threshold

public static void threshold(QImage img, int value)
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.

Parameters: img The QImage to process. value The threshold value.

Author: Daniel M. Duley (mosfet)

UNKNOWN: Thresholds the reference image.

threshold

public static void threshold(QImage img)

toGray

public static QImage toGray(QImage image, boolean fast)
Convert an image to grayscale.

Parameters: 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)

UNKNOWN: Convert an image to grayscale.

toGray

public static QImage toGray(QImage image)

unbalancedGradient

public static QImage unbalancedGradient(QSize size, QColor ca, QColor cb, int type, int xfactor, int yfactor, int ncols)
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.

Parameters: 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.

UNKNOWN: Create an unbalanced gradient.

unbalancedGradient

public static QImage unbalancedGradient(QSize size, QColor ca, QColor cb, int type, int xfactor, int yfactor)

unbalancedGradient

public static QImage unbalancedGradient(QSize size, QColor ca, QColor cb, int type, int xfactor)

unbalancedGradient

public static QImage unbalancedGradient(QSize size, QColor ca, QColor cb, int type)

wave

public static QImage wave(QImage src, double amplitude, double frequency, int background)
Modifies the pixels along a sine wave.

Parameters: 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)

UNKNOWN: Modifies the pixels along a sine wave.

wave

public static QImage wave(QImage src, double amplitude, double frequency)

wave

public static QImage wave(QImage src, double amplitude)

wave

public static QImage wave(QImage src)