org.kde.koala
Class KImageEffect

java.lang.Object
  extended by org.kde.koala.KImageEffect
All Implemented Interfaces:
org.kde.qt.QtSupport

public class KImageEffect
extends java.lang.Object
implements org.kde.qt.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.


Field Summary
static int All
           
static int Blue
           
static int Centered
           
static int CenteredAutoFit
           
static int CenteredMaxpect
           
static int CenterTiled
           
static int Contrast
           
static int CrossDiagonalGradient
           
static int DiagonalGradient
           
static int EastLite
           
static int EllipticGradient
           
static int GaussianNoise
           
static int Gray
           
static int Green
           
static int HorizontalGradient
           
static int HueShift
           
static int ImpulseNoise
           
static int Intensity
          This enum provides a modulation type specification
static int LaplacianNoise
           
static int Linear
          This enum lists possible bumpmapping implementations.
static int MultiplicativeGaussianNoise
           
static int NELite
           
static int NoImage
          Disposition of a source image on top of a destination image.
static int NorthLite
          This enum provides a lighting direction specification
static int NWLite
           
static int PipeCrossGradient
           
static int PoissonNoise
           
static int PyramidGradient
           
static int RectangleGradient
           
static int Red
          This enum provides a RGB channel specification
static int Rotate180
           
static int Rotate270
           
static int Rotate90
          This enum provides a rotation specification.
static int Saturation
           
static int Scaled
           
static int SELite
           
static int Sinuosidal
           
static int SouthLite
           
static int Spherical
           
static int SWLite
           
static int Tiled
           
static int TiledMaxpect
           
static int UniformNoise
          This enum provides a noise type specification
static int VerticalGradient
          This enum provides a gradient type specification
static int WestLite
           
 
Constructor Summary
  KImageEffect()
           
protected KImageEffect(java.lang.Class dummy)
           
 
Method Summary
static org.kde.qt.QImage addNoise(org.kde.qt.QImage src)
           
static org.kde.qt.QImage addNoise(org.kde.qt.QImage src, int type)
          Adds noise to an image.
static boolean blend(int[] x, int[] y, org.kde.qt.QImage upper, org.kde.qt.QImage lower, org.kde.qt.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 org.kde.qt.QImage blend(org.kde.qt.QColor clr, org.kde.qt.QImage dst, float opacity)
          Blends a color into the destination image, using an opacity value for blending one into another.
static org.kde.qt.QImage blend(org.kde.qt.QImage image, float initial_intensity, org.kde.qt.QColor bgnd, int eff)
           
static org.kde.qt.QImage blend(org.kde.qt.QImage image, float initial_intensity, org.kde.qt.QColor bgnd, int eff, boolean anti_dir)
          Blend the provided image into a background of the indicated color.
static org.kde.qt.QImage blend(org.kde.qt.QImage src, org.kde.qt.QImage dst, float opacity)
          Blend the src image into the destination image, using an opacity value for blending one into another.
static org.kde.qt.QImage blend(org.kde.qt.QImage image1, org.kde.qt.QImage image2, int gt)
           
static org.kde.qt.QImage blend(org.kde.qt.QImage image1, org.kde.qt.QImage image2, int gt, int xf)
           
static org.kde.qt.QImage blend(org.kde.qt.QImage image1, org.kde.qt.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 boolean blend(org.kde.qt.QImage upper, org.kde.qt.QImage lower, org.kde.qt.QImage output)
          Blend an image into another one, using alpha in the expected way.
static org.kde.qt.QImage blend(org.kde.qt.QImage image1, org.kde.qt.QImage image2, org.kde.qt.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 boolean blendOnLower(int x, int y, org.kde.qt.QImage upper, org.kde.qt.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 void blendOnLower(org.kde.qt.QImage upper, org.kde.qt.QImage lower, int disposition, float opacity)
          Blend an image on top of another using a given disposition and a given opacity.
static void blendOnLower(org.kde.qt.QImage upper, org.kde.qt.QPoint upperOffset, org.kde.qt.QImage lower, org.kde.qt.QRect lowerRect)
          Blend part of an image into part of another, using the alpha channel in the expected way.
static void blendOnLower(org.kde.qt.QImage upper, org.kde.qt.QPoint upperOffset, org.kde.qt.QImage lower, org.kde.qt.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 org.kde.qt.QImage blur(org.kde.qt.QImage src)
           
static org.kde.qt.QImage blur(org.kde.qt.QImage src, double factor)
          This is provided for binary compatability only! Use the above method with a radius and sigma instead!
static org.kde.qt.QImage blur(org.kde.qt.QImage src, double radius, double sigma)
          Blurs an image by convolving pixel neighborhoods.
static org.kde.qt.QImage bumpmap(org.kde.qt.QImage img, org.kde.qt.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 org.kde.qt.QImage channelIntensity(org.kde.qt.QImage image, float percent, int channel)
          Modifies the intensity of a pixmap's RGB channel component.
static org.kde.qt.QImage charcoal(org.kde.qt.QImage src)
           
static org.kde.qt.QImage charcoal(org.kde.qt.QImage src, double factor)
          This is provided for binary compatability only! Use the above method with a radius and sigma instead!
static org.kde.qt.QImage charcoal(org.kde.qt.QImage src, double radius, double sigma)
          Produces a neat little "charcoal" effect.
static org.kde.qt.QRect computeDestinationRect(org.kde.qt.QSize lowerSize, int disposition, org.kde.qt.QImage upper)
          Compute the destination rectangle where to draw the upper image on top of another image using the given disposition.
static org.kde.qt.QImage contrast(org.kde.qt.QImage image, int c)
          Fast, but low quality contrast of an image.
static void contrastHSV(org.kde.qt.QImage img)
           
static void contrastHSV(org.kde.qt.QImage img, boolean sharpen)
          High quality, expensive HSV contrast.
static org.kde.qt.QImage desaturate(org.kde.qt.QImage image)
           
static org.kde.qt.QImage desaturate(org.kde.qt.QImage image, float desat)
          Desaturate an image evenly.
static org.kde.qt.QImage despeckle(org.kde.qt.QImage src)
          Minimizes speckle noise in the source image using the 8 hull algorithm.
 void dispose()
          Delete the wrapped C++ instance ahead of finalize()
static org.kde.qt.QImage dither(org.kde.qt.QImage image, org.kde.qt.QColor palette, int size)
          Dither an image using Floyd-Steinberg dithering for low-color situations.
static org.kde.qt.QImage edge(org.kde.qt.QImage src, double radius)
          Detects edges in an image using pixel neighborhoods and an edge detection mask.
static org.kde.qt.QImage emboss(org.kde.qt.QImage src)
          Convenience method.
static org.kde.qt.QImage emboss(org.kde.qt.QImage src, double radius, double sigma)
          Embosses the source image.
static void equalize(org.kde.qt.QImage img)
          Performs histogram equalisation on the reference image.
static org.kde.qt.QImage fade(org.kde.qt.QImage image, float val, org.kde.qt.QColor color)
          Fade an image to a certain background color.
protected  void finalize()
          Deletes the wrapped C++ instance
static org.kde.qt.QImage flatten(org.kde.qt.QImage image, org.kde.qt.QColor ca, org.kde.qt.QColor cb)
           
static org.kde.qt.QImage flatten(org.kde.qt.QImage image, org.kde.qt.QColor ca, org.kde.qt.QColor cb, int ncols)
          This recolors a pixmap.
static org.kde.qt.QImage gradient(org.kde.qt.QSize size, org.kde.qt.QColor ca, org.kde.qt.QColor cb, int type)
           
static org.kde.qt.QImage gradient(org.kde.qt.QSize size, org.kde.qt.QColor ca, org.kde.qt.QColor cb, int type, int ncols)
          Create a gradient from color a to color b of the specified type.
static org.kde.qt.QImage hash(org.kde.qt.QImage image)
           
static org.kde.qt.QImage hash(org.kde.qt.QImage image, int lite)
           
static org.kde.qt.QImage hash(org.kde.qt.QImage image, int lite, int spacing)
          Build a hash on any given QImage
static org.kde.qt.QImage implode(org.kde.qt.QImage src)
           
static org.kde.qt.QImage implode(org.kde.qt.QImage src, double factor)
           
static org.kde.qt.QImage implode(org.kde.qt.QImage src, double factor, int background)
          Implodes an image by a specified percent.
static org.kde.qt.QImage intensity(org.kde.qt.QImage image, float percent)
          Either brighten or dim the image by a specified percent.
 boolean isDisposed()
          Has the wrapped C++ instance been deleted?
static org.kde.qt.QImage modulate(org.kde.qt.QImage image, org.kde.qt.QImage modImage, boolean reverse, int type, int factor, int channel)
          Modulate the image with a color channel of another image.
static void normalize(org.kde.qt.QImage img)
          Normalises the pixel values to span the full range of color values.
static org.kde.qt.QImage oilPaint(org.kde.qt.QImage src)
           
static org.kde.qt.QImage oilPaint(org.kde.qt.QImage src, int radius)
          This is provided for binary compatability only! Use the above method instead!
static org.kde.qt.QImage oilPaintConvolve(org.kde.qt.QImage src, double radius)
          Produces an oil painting effect.
static org.kde.qt.QImage rotate(org.kde.qt.QImage src, int r)
          Rotates the image by the specified amount
static org.kde.qt.QImage sample(org.kde.qt.QImage src, int w, int h)
          Scales an image using simple pixel sampling.
static org.kde.qt.QImage selectedImage(org.kde.qt.QImage img, org.kde.qt.QColor col)
          Calculate the image for a selected image, for instance a selected icon on the desktop.
static org.kde.qt.QImage shade(org.kde.qt.QImage src)
           
static org.kde.qt.QImage shade(org.kde.qt.QImage src, boolean color_shading)
           
static org.kde.qt.QImage shade(org.kde.qt.QImage src, boolean color_shading, double azimuth)
           
static org.kde.qt.QImage shade(org.kde.qt.QImage src, boolean color_shading, double azimuth, double elevation)
          Shades the image using a distance light source.
static org.kde.qt.QImage sharpen(org.kde.qt.QImage src)
           
static org.kde.qt.QImage sharpen(org.kde.qt.QImage src, double factor)
          This is provided for binary compatability only! Use the above method instead!
static org.kde.qt.QImage sharpen(org.kde.qt.QImage src, double radius, double sigma)
          Sharpens the pixels in the image using pixel neighborhoods.
static void solarize(org.kde.qt.QImage img)
           
static void solarize(org.kde.qt.QImage img, double factor)
          Produces a 'solarization' effect seen when exposing a photographic film to light during the development process.
static org.kde.qt.QImage spread(org.kde.qt.QImage src)
           
static org.kde.qt.QImage spread(org.kde.qt.QImage src, int amount)
          Randomly displaces pixels.
static org.kde.qt.QImage swirl(org.kde.qt.QImage src)
           
static org.kde.qt.QImage swirl(org.kde.qt.QImage src, double degrees)
           
static org.kde.qt.QImage swirl(org.kde.qt.QImage src, double degrees, int background)
          Swirls the image by a specified amount
static void threshold(org.kde.qt.QImage img)
           
static void threshold(org.kde.qt.QImage img, int value)
          Thresholds the reference image.
static org.kde.qt.QImage toGray(org.kde.qt.QImage image)
           
static org.kde.qt.QImage toGray(org.kde.qt.QImage image, boolean fast)
          Convert an image to grayscale.
static org.kde.qt.QImage unbalancedGradient(org.kde.qt.QSize size, org.kde.qt.QColor ca, org.kde.qt.QColor cb, int type)
           
static org.kde.qt.QImage unbalancedGradient(org.kde.qt.QSize size, org.kde.qt.QColor ca, org.kde.qt.QColor cb, int type, int xfactor)
           
static org.kde.qt.QImage unbalancedGradient(org.kde.qt.QSize size, org.kde.qt.QColor ca, org.kde.qt.QColor cb, int type, int xfactor, int yfactor)
           
static org.kde.qt.QImage unbalancedGradient(org.kde.qt.QSize size, org.kde.qt.QColor ca, org.kde.qt.QColor cb, int type, int xfactor, int yfactor, int ncols)
          Create an unbalanced gradient.
static org.kde.qt.QImage wave(org.kde.qt.QImage src)
           
static org.kde.qt.QImage wave(org.kde.qt.QImage src, double amplitude)
           
static org.kde.qt.QImage wave(org.kde.qt.QImage src, double amplitude, double frequency)
           
static org.kde.qt.QImage wave(org.kde.qt.QImage src, double amplitude, double frequency, int background)
          Modifies the pixels along a sine wave.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VerticalGradient

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

See Also:
blend(org.kde.qt.QColor, org.kde.qt.QImage, float), gradient(org.kde.qt.QSize, org.kde.qt.QColor, org.kde.qt.QColor, int, int), unbalancedGradient(org.kde.qt.QSize, org.kde.qt.QColor, org.kde.qt.QColor, int, int, int, int), Constant Field Values

HorizontalGradient

public static final int HorizontalGradient
See Also:
Constant Field Values

DiagonalGradient

public static final int DiagonalGradient
See Also:
Constant Field Values

CrossDiagonalGradient

public static final int CrossDiagonalGradient
See Also:
Constant Field Values

PyramidGradient

public static final int PyramidGradient
See Also:
Constant Field Values

RectangleGradient

public static final int RectangleGradient
See Also:
Constant Field Values

PipeCrossGradient

public static final int PipeCrossGradient
See Also:
Constant Field Values

EllipticGradient

public static final int EllipticGradient
See Also:
Constant Field Values

Red

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

See Also:
blend(org.kde.qt.QColor, org.kde.qt.QImage, float), channelIntensity(org.kde.qt.QImage, float, int), modulate(org.kde.qt.QImage, org.kde.qt.QImage, boolean, int, int, int), Constant Field Values

Green

public static final int Green
See Also:
Constant Field Values

Blue

public static final int Blue
See Also:
Constant Field Values

Gray

public static final int Gray
See Also:
Constant Field Values

All

public static final int All
See Also:
Constant Field Values

NorthLite

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

See Also:
hash(org.kde.qt.QImage, int, int), Constant Field Values

NWLite

public static final int NWLite
See Also:
Constant Field Values

WestLite

public static final int WestLite
See Also:
Constant Field Values

SWLite

public static final int SWLite
See Also:
Constant Field Values

SouthLite

public static final int SouthLite
See Also:
Constant Field Values

SELite

public static final int SELite
See Also:
Constant Field Values

EastLite

public static final int EastLite
See Also:
Constant Field Values

NELite

public static final int NELite
See Also:
Constant Field Values

Intensity

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

See Also:
modulate(org.kde.qt.QImage, org.kde.qt.QImage, boolean, int, int, int), Constant Field Values

Saturation

public static final int Saturation
See Also:
Constant Field Values

HueShift

public static final int HueShift
See Also:
Constant Field Values

Contrast

public static final int Contrast
See Also:
Constant Field Values

UniformNoise

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

See Also:
addNoise(org.kde.qt.QImage, int), Constant Field Values

GaussianNoise

public static final int GaussianNoise
See Also:
Constant Field Values

MultiplicativeGaussianNoise

public static final int MultiplicativeGaussianNoise
See Also:
Constant Field Values

ImpulseNoise

public static final int ImpulseNoise
See Also:
Constant Field Values

LaplacianNoise

public static final int LaplacianNoise
See Also:
Constant Field Values

PoissonNoise

public static final int PoissonNoise
See Also:
Constant Field Values

Rotate90

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

See Also:
rotate(org.kde.qt.QImage, int), Constant Field Values

Rotate180

public static final int Rotate180
See Also:
Constant Field Values

Rotate270

public static final int Rotate270
See Also:
Constant Field Values

Linear

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

See Also:
bumpmap(org.kde.qt.QImage, org.kde.qt.QImage, double, double, int, int, int, int, int, boolean, boolean, int, boolean), Constant Field Values

Spherical

public static final int Spherical
See Also:
Constant Field Values

Sinuosidal

public static final int Sinuosidal
See Also:
Constant Field Values

NoImage

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

See Also:
computeDestinationRect(org.kde.qt.QSize, int, org.kde.qt.QImage), blendOnLower(int, int, org.kde.qt.QImage, org.kde.qt.QImage), Constant Field Values

Centered

public static final int Centered
See Also:
Constant Field Values

Tiled

public static final int Tiled
See Also:
Constant Field Values

CenterTiled

public static final int CenterTiled
See Also:
Constant Field Values

CenteredMaxpect

public static final int CenteredMaxpect
See Also:
Constant Field Values

TiledMaxpect

public static final int TiledMaxpect
See Also:
Constant Field Values

Scaled

public static final int Scaled
See Also:
Constant Field Values

CenteredAutoFit

public static final int CenteredAutoFit
See Also:
Constant Field Values
Constructor Detail

KImageEffect

protected KImageEffect(java.lang.Class dummy)

KImageEffect

public KImageEffect()
Method Detail

gradient

public static org.kde.qt.QImage gradient(org.kde.qt.QSize size,
                                         org.kde.qt.QColor ca,
                                         org.kde.qt.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.

gradient

public static org.kde.qt.QImage gradient(org.kde.qt.QSize size,
                                         org.kde.qt.QColor ca,
                                         org.kde.qt.QColor cb,
                                         int type)

unbalancedGradient

public static org.kde.qt.QImage unbalancedGradient(org.kde.qt.QSize size,
                                                   org.kde.qt.QColor ca,
                                                   org.kde.qt.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.

unbalancedGradient

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

unbalancedGradient

public static org.kde.qt.QImage unbalancedGradient(org.kde.qt.QSize size,
                                                   org.kde.qt.QColor ca,
                                                   org.kde.qt.QColor cb,
                                                   int type,
                                                   int xfactor)

unbalancedGradient

public static org.kde.qt.QImage unbalancedGradient(org.kde.qt.QSize size,
                                                   org.kde.qt.QColor ca,
                                                   org.kde.qt.QColor cb,
                                                   int type)

blend

public static org.kde.qt.QImage blend(org.kde.qt.QColor clr,
                                      org.kde.qt.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.

blend

public static org.kde.qt.QImage blend(org.kde.qt.QImage src,
                                      org.kde.qt.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.

blend

public static org.kde.qt.QImage blend(org.kde.qt.QImage image,
                                      float initial_intensity,
                                      org.kde.qt.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

blend

public static org.kde.qt.QImage blend(org.kde.qt.QImage image,
                                      float initial_intensity,
                                      org.kde.qt.QColor bgnd,
                                      int eff)

blend

public static org.kde.qt.QImage blend(org.kde.qt.QImage image1,
                                      org.kde.qt.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

blend

public static org.kde.qt.QImage blend(org.kde.qt.QImage image1,
                                      org.kde.qt.QImage image2,
                                      int gt,
                                      int xf)

blend

public static org.kde.qt.QImage blend(org.kde.qt.QImage image1,
                                      org.kde.qt.QImage image2,
                                      int gt)

blend

public static org.kde.qt.QImage blend(org.kde.qt.QImage image1,
                                      org.kde.qt.QImage image2,
                                      org.kde.qt.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.

blend

public static boolean blend(org.kde.qt.QImage upper,
                            org.kde.qt.QImage lower,
                            org.kde.qt.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

blend

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

blendOnLower

public static boolean blendOnLower(int x,
                                   int y,
                                   org.kde.qt.QImage upper,
                                   org.kde.qt.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

blendOnLower

public static void blendOnLower(org.kde.qt.QImage upper,
                                org.kde.qt.QPoint upperOffset,
                                org.kde.qt.QImage lower,
                                org.kde.qt.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.

blendOnLower

public static void blendOnLower(org.kde.qt.QImage upper,
                                org.kde.qt.QPoint upperOffset,
                                org.kde.qt.QImage lower,
                                org.kde.qt.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.

computeDestinationRect

public static org.kde.qt.QRect computeDestinationRect(org.kde.qt.QSize lowerSize,
                                                      int disposition,
                                                      org.kde.qt.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.

blendOnLower

public static void blendOnLower(org.kde.qt.QImage upper,
                                org.kde.qt.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.


channelIntensity

public static org.kde.qt.QImage channelIntensity(org.kde.qt.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.

fade

public static org.kde.qt.QImage fade(org.kde.qt.QImage image,
                                     float val,
                                     org.kde.qt.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.

flatten

public static org.kde.qt.QImage flatten(org.kde.qt.QImage image,
                                        org.kde.qt.QColor ca,
                                        org.kde.qt.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.

flatten

public static org.kde.qt.QImage flatten(org.kde.qt.QImage image,
                                        org.kde.qt.QColor ca,
                                        org.kde.qt.QColor cb)

hash

public static org.kde.qt.QImage hash(org.kde.qt.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.

hash

public static org.kde.qt.QImage hash(org.kde.qt.QImage image,
                                     int lite)

hash

public static org.kde.qt.QImage hash(org.kde.qt.QImage image)

intensity

public static org.kde.qt.QImage intensity(org.kde.qt.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.

modulate

public static org.kde.qt.QImage modulate(org.kde.qt.QImage image,
                                         org.kde.qt.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.

toGray

public static org.kde.qt.QImage toGray(org.kde.qt.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.

toGray

public static org.kde.qt.QImage toGray(org.kde.qt.QImage image)

desaturate

public static org.kde.qt.QImage desaturate(org.kde.qt.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.

desaturate

public static org.kde.qt.QImage desaturate(org.kde.qt.QImage image)

contrast

public static org.kde.qt.QImage contrast(org.kde.qt.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.

dither

public static org.kde.qt.QImage dither(org.kde.qt.QImage image,
                                       org.kde.qt.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.

selectedImage

public static org.kde.qt.QImage selectedImage(org.kde.qt.QImage img,
                                              org.kde.qt.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().

contrastHSV

public static void contrastHSV(org.kde.qt.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).

contrastHSV

public static void contrastHSV(org.kde.qt.QImage img)

normalize

public static void normalize(org.kde.qt.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

equalize

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

Parameters:
img - the image that is equalised

threshold

public static void threshold(org.kde.qt.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.

threshold

public static void threshold(org.kde.qt.QImage img)

solarize

public static void solarize(org.kde.qt.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)

solarize

public static void solarize(org.kde.qt.QImage img)

emboss

public static org.kde.qt.QImage emboss(org.kde.qt.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.

emboss

public static org.kde.qt.QImage emboss(org.kde.qt.QImage src)
Convenience method.


despeckle

public static org.kde.qt.QImage despeckle(org.kde.qt.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.

charcoal

public static org.kde.qt.QImage charcoal(org.kde.qt.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.

charcoal

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


charcoal

public static org.kde.qt.QImage charcoal(org.kde.qt.QImage src)

rotate

public static org.kde.qt.QImage rotate(org.kde.qt.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.

sample

public static org.kde.qt.QImage sample(org.kde.qt.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.

addNoise

public static org.kde.qt.QImage addNoise(org.kde.qt.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.

addNoise

public static org.kde.qt.QImage addNoise(org.kde.qt.QImage src)

blur

public static org.kde.qt.QImage blur(org.kde.qt.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.

blur

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


blur

public static org.kde.qt.QImage blur(org.kde.qt.QImage src)

edge

public static org.kde.qt.QImage edge(org.kde.qt.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.

implode

public static org.kde.qt.QImage implode(org.kde.qt.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.

implode

public static org.kde.qt.QImage implode(org.kde.qt.QImage src,
                                        double factor)

implode

public static org.kde.qt.QImage implode(org.kde.qt.QImage src)

oilPaintConvolve

public static org.kde.qt.QImage oilPaintConvolve(org.kde.qt.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.

oilPaint

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


oilPaint

public static org.kde.qt.QImage oilPaint(org.kde.qt.QImage src)

sharpen

public static org.kde.qt.QImage sharpen(org.kde.qt.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.

sharpen

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


sharpen

public static org.kde.qt.QImage sharpen(org.kde.qt.QImage src)

spread

public static org.kde.qt.QImage spread(org.kde.qt.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.

spread

public static org.kde.qt.QImage spread(org.kde.qt.QImage src)

shade

public static org.kde.qt.QImage shade(org.kde.qt.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.

shade

public static org.kde.qt.QImage shade(org.kde.qt.QImage src,
                                      boolean color_shading,
                                      double azimuth)

shade

public static org.kde.qt.QImage shade(org.kde.qt.QImage src,
                                      boolean color_shading)

shade

public static org.kde.qt.QImage shade(org.kde.qt.QImage src)

swirl

public static org.kde.qt.QImage swirl(org.kde.qt.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.

swirl

public static org.kde.qt.QImage swirl(org.kde.qt.QImage src,
                                      double degrees)

swirl

public static org.kde.qt.QImage swirl(org.kde.qt.QImage src)

wave

public static org.kde.qt.QImage wave(org.kde.qt.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.

wave

public static org.kde.qt.QImage wave(org.kde.qt.QImage src,
                                     double amplitude,
                                     double frequency)

wave

public static org.kde.qt.QImage wave(org.kde.qt.QImage src,
                                     double amplitude)

wave

public static org.kde.qt.QImage wave(org.kde.qt.QImage src)

bumpmap

public static org.kde.qt.QImage bumpmap(org.kde.qt.QImage img,
                                        org.kde.qt.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.

finalize

protected void finalize()
                 throws java.lang.InternalError
Deletes the wrapped C++ instance

Overrides:
finalize in class java.lang.Object
Throws:
java.lang.InternalError

dispose

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


isDisposed

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