class KImageEffect

This class includes various QImage based graphical effects. More...

Definition#include <kimageeffect.h>
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Types

Public Static Methods


Detailed Description

This class includes various QImage based graphical effects. Everything is static, so there is no need to create an instance of this class. You can just call the static methods. They are encapsulated here merely to provide a common namespace.

QImage gradient (const QSize &size, const QColor &ca, const QColor &cb, GradientType type, int ncols=3)
[static]

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

Parameters:
sizeThe desired size of the gradient.
caColor a
cbColor b
typeThe type of gradient.
ncolsThe 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.

QImage unbalancedGradient (const QSize &size, const QColor &ca, const QColor &cb, GradientType type, int xfactor = 100, int yfactor = 100, int ncols = 3)
[static]

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:
sizeThe desired size of the gradient.
caColor a
cbColor b
typeThe type of gradient.
xfactorThe x decay length. Use a value between -200 and 200.
yfactorThe y decay length.
ncolsThe number of colors. See KPixmapEffect:gradient.

QImage& blend (QImage &image, float initial_intensity, const QColor &bgnd, GradientType eff, bool anti_dir=false)
[static]

Blends the provided image into a background of the indicated color

Parameters:
initial_intensitythis 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
bgndindicates the color of the background to blend in
efflets you choose what kind of blending you like
anti_dirblend in the opposite direction (makes no much sense with concentric blending effects)

QImage& channelIntensity (QImage &image, float percent, RGBComponent channel)
[static]

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

Parameters:
imageThe QImage to process.
percentpercent value. Use a negative value to dim.
channelwhich channel(s) should be modified

Returns: Returns the image, provided for convenience.

QImage& fade (QImage &img, float val, const QColor &color)
[static]

Fade an image to a certain background color. The number of colors will not be changed.

Parameters:
imageThe QImage to process.
valThe strength of the effect. 0 <= val <= 1.
colorThe background color.

Returns: Returns the image, provided for convenience.

QImage& flatten (QImage &image, const QColor &ca, const QColor &cb, int ncols=0)
[static]

This recolors an image. The most dark color will become color a, This recolors a pixmap. The most dark color will become color a, the most bright one color b, and in between.

Parameters:
imageA QImage to process.
caColor a
cbColor b

QImage& hash (QImage &image, Lighting lite=NorthLite, unsigned int spacing=0)
[static]

Builds a hash on any given QImage

Parameters:
imageThe QImage to process
lite- the hash faces the indicated lighting (cardinal poles)
spacing- how many unmodified pixels inbetween hashes

Returns: Returns the image, provided for convenience.

QImage& intensity (QImage &image, float percent)
[static]

Either brightens or dims the image by a specified percent. For example, .5 will modify the colors by 50%.

Parameters:
imageThe QImage to process.
percentthe percent value. Use a negative value to dim.

Returns: Returns the image, provided for convenience.

QImage& toGray (QImage &image, bool fast = false)
[static]

Converts an image to grayscale.

Parameters:
imageThe QImage to process.
fastSet 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.

QImage& desaturate (QImage &image, float desat = 0.3)
[static]

Desaturates an image evenly.

Parameters:
imageThe QImage to process.
desatA value between 0 and 1 setting the degree of desaturation

Returns: Returns the image, provided for convenience.

QImage& contrast (QImage &image, int c)
[static]

Modifies the contrast of an image.

Parameters:
imageThe QImage to process.
cA contrast value between -255 to 255.

Returns: Returns the image, provided for convenience.


Generated by: root@tantive.terraplex.com on Sun Feb 27 17:39:25 2000, using kdoc 2.0a33.