• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdefx
 

tdefx

Public Types | Static Public Member Functions | List of all members
KImageEffect Class Reference

#include <kimageeffect.h>

Public Types

enum  GradientType {
  VerticalGradient , HorizontalGradient , DiagonalGradient , CrossDiagonalGradient ,
  PyramidGradient , RectangleGradient , PipeCrossGradient , EllipticGradient
}
 
enum  RGBComponent {
  Red , Green , Blue , Gray ,
  All
}
 
enum  Lighting {
  NorthLite , NWLite , WestLite , SWLite ,
  SouthLite , SELite , EastLite , NELite
}
 
enum  ModulationType { Intensity , Saturation , HueShift , Contrast }
 
enum  NoiseType {
  UniformNoise =0 , GaussianNoise , MultiplicativeGaussianNoise , ImpulseNoise ,
  LaplacianNoise , PoissonNoise
}
 
enum  RotateDirection { Rotate90 , Rotate180 , Rotate270 }
 
enum  BumpmapType { Linear , Spherical , Sinuosidal }
 
enum  Disposition {
  NoImage = 0 , Centered , Tiled , CenterTiled ,
  CenteredMaxpect , TiledMaxpect , Scaled , CenteredAutoFit
}
 

Static Public Member Functions

static TQImage gradient (const TQSize &size, const TQColor &ca, const TQColor &cb, GradientType type, int ncols=3)
 
static TQImage unbalancedGradient (const TQSize &size, const TQColor &ca, const TQColor &cb, GradientType type, int xfactor=100, int yfactor=100, int ncols=3)
 
static TQImage & blend (const TQColor &clr, TQImage &dst, float opacity)
 
static TQImage & blend (TQImage &src, TQImage &dst, float opacity)
 
static TQImage & blend (TQImage &image, float initial_intensity, const TQColor &bgnd, GradientType eff, bool anti_dir=false)
 
static TQImage & blend (TQImage &image1, TQImage &image2, GradientType gt, int xf=100, int yf=100)
 
static TQImage & blend (TQImage &image1, TQImage &image2, TQImage &blendImage, RGBComponent channel)
 
static bool blend (const TQImage &upper, const TQImage &lower, TQImage &output)
 
static bool blend (int &x, int &y, const TQImage &upper, const TQImage &lower, TQImage &output)
 
static bool blendOnLower (int x, int y, const TQImage &upper, const TQImage &lower)
 
static void blendOnLower (const TQImage &upper, const TQPoint &upperOffset, TQImage &lower, const TQRect &lowerRect)
 
static void blendOnLower (const TQImage &upper, const TQPoint &upperOffset, TQImage &lower, const TQRect &lowerRect, float opacity)
 
static TQRect computeDestinationRect (const TQSize &lowerSize, Disposition disposition, TQImage &upper)
 
static void blendOnLower (TQImage &upper, TQImage &lower, Disposition disposition, float opacity)
 
static TQImage & channelIntensity (TQImage &image, float percent, RGBComponent channel)
 
static TQImage & fade (TQImage &image, float val, const TQColor &color)
 
static TQImage & flatten (TQImage &image, const TQColor &ca, const TQColor &cb, int ncols=0)
 
static TQImage & hash (TQImage &image, Lighting lite=NorthLite, unsigned int spacing=0)
 
static TQImage & intensity (TQImage &image, float percent)
 
static TQImage & modulate (TQImage &image, TQImage &modImage, bool reverse, ModulationType type, int factor, RGBComponent channel)
 
static TQImage & toGray (TQImage &image, bool fast=false)
 
static TQImage & desaturate (TQImage &image, float desat=0.3)
 
static TQImage & contrast (TQImage &image, int c)
 
static TQImage & dither (TQImage &image, const TQColor *palette, int size)
 
static TQImage & selectedImage (TQImage &img, const TQColor &col)
 
static void contrastHSV (TQImage &img, bool sharpen=true)
 
static void normalize (TQImage &img)
 
static void equalize (TQImage &img)
 
static void threshold (TQImage &img, unsigned int value=128)
 
static void solarize (TQImage &img, double factor=50.0)
 
static TQImage emboss (TQImage &src, double radius, double sigma)
 
static TQImage emboss (TQImage &src)
 
static TQImage despeckle (TQImage &src)
 
static TQImage charcoal (TQImage &src, double radius, double sigma)
 
static TQImage charcoal (TQImage &src, double factor=50.0)
 
static TQImage rotate (TQImage &src, RotateDirection r)
 
static TQImage sample (TQImage &src, int w, int h)
 
static TQImage addNoise (TQImage &src, NoiseType type=GaussianNoise)
 
static TQImage blur (TQImage &src, double radius, double sigma)
 
static TQImage blur (TQImage &src, double factor=50.0)
 
static TQImage edge (TQImage &src, double radius)
 
static TQImage implode (TQImage &src, double factor=30.0, unsigned int background=0xFFFFFFFF)
 
static TQImage oilPaintConvolve (TQImage &src, double radius)
 
static TQImage oilPaint (TQImage &src, int radius=3)
 
static TQImage sharpen (TQImage &src, double radius, double sigma)
 
static TQImage sharpen (TQImage &src, double factor=30.0)
 
static TQImage spread (TQImage &src, unsigned int amount=3)
 
static TQImage shade (TQImage &src, bool color_shading=true, double azimuth=30.0, double elevation=30.0)
 
static TQImage swirl (TQImage &src, double degrees=50.0, unsigned int background=0xFFFFFFFF)
 
static TQImage wave (TQImage &src, double amplitude=25.0, double frequency=150.0, unsigned int background=0xFFFFFFFF)
 
static TQImage bumpmap (TQImage &img, TQImage &map, double azimuth, double elevation, int depth, int xofs, int yofs, int waterlevel, int ambient, bool compensate, bool invert, BumpmapType type, bool tiled)
 
static TQImage convertToPremultipliedAlpha (TQImage input)
 

Detailed Description

This class includes various TQImage based graphical effects.

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

Definition at line 50 of file kimageeffect.h.

Member Enumeration Documentation

◆ BumpmapType

enum KImageEffect::BumpmapType

This enum lists possible bumpmapping implementations.

See also
KImageEffect::bumpmap()

Definition at line 129 of file kimageeffect.h.

◆ Disposition

enum KImageEffect::Disposition

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

See also
KImageEffect::computeDestinationRect, KImageEffect::blendOnLower
Since
3.2
Enumerator
NoImage 

Don't overlay.

Centered 

Center top image on botton image.

Tiled 

Tile top image on bottom image.

CenterTiled 

Center and tile top image on bottom image.

CenteredMaxpect 

Center and scale aspect.

TiledMaxpect 

Tile and scale aspect.

Scaled 

Scale.

CenteredAutoFit 

Center and scale or scale aspect.

Definition at line 326 of file kimageeffect.h.

◆ GradientType

enum KImageEffect::GradientType

This enum provides a gradient type specification.

See also
KImageEffect::blend(), KImageEffect::gradient(), KImageEffect::unbalancedGradient()

Definition at line 58 of file kimageeffect.h.

◆ Lighting

enum KImageEffect::Lighting

This enum provides a lighting direction specification.

See also
KImageEffect::hash()
Enumerator
NorthLite 

Lighting from the top of the image.

NWLite 

Lighting from the top left of the image.

WestLite 

Lighting from the left of the image.

SWLite 

Lighting from the bottom left of the image.

SouthLite 

Lighting from the bottom of the image.

SELite 

Lighting from the bottom right of the image.

EastLite 

Lighting from the right of the image.

NELite 

Lighting from the top right of the image.

Definition at line 84 of file kimageeffect.h.

◆ ModulationType

enum KImageEffect::ModulationType

This enum provides a modulation type specification.

See also
KImageEffect::modulate()
Enumerator
Intensity 

Modulate image intensity.

Saturation 

Modulate image saturation.

HueShift 

Modulate image hue.

Contrast 

Modulate image contrast.

Definition at line 98 of file kimageeffect.h.

◆ NoiseType

enum KImageEffect::NoiseType

This enum provides a noise type specification.

See also
KImageEffect::addNoise()
Enumerator
UniformNoise 

Uniform distribution.

GaussianNoise 

Gaussian distribution.

MultiplicativeGaussianNoise 

Multiplicative Gaussian distribution.

ImpulseNoise 

Impulse distribution.

LaplacianNoise 

Laplacian distribution.

PoissonNoise 

Poisson distribution.

Definition at line 108 of file kimageeffect.h.

◆ RGBComponent

enum KImageEffect::RGBComponent

This enum provides a RGB channel specification.

See also
KImageEffect::blend(), KImageEffect::channelIntensity(), KImageEffect::modulate()
Enumerator
Red 

Red channel.

Green 

Green channel.

Blue 

Blue channel.

Gray 

Grey channel.

All 

All channels.

Definition at line 73 of file kimageeffect.h.

◆ RotateDirection

enum KImageEffect::RotateDirection

This enum provides a rotation specification.

See also
KImageEffect::rotate()
Enumerator
Rotate90 

Rotate 90 degrees to the right.

Rotate180 

Rotate 180 degrees.

Rotate270 

Rotate 90 degrees to the left.

Definition at line 120 of file kimageeffect.h.

Member Function Documentation

◆ addNoise()

TQImage KImageEffect::addNoise ( TQImage &  src,
NoiseType  type = GaussianNoise 
)
static

Adds noise to an image.

Parameters
srcThe TQImage to process.
typeThe algorithm used to generate the noise.
Returns
The image with noise added. The original is not changed.
Author
Daniel M. Duley (mosfet)

Definition at line 3112 of file kimageeffect.cpp.

◆ blend() [1/7]

TQImage & KImageEffect::blend ( const TQColor &  clr,
TQImage &  dst,
float  opacity 
)
static

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
clrsource color to be blended into the destination image.
dstdestination image in which the source will be blended into.
opacityopacity (between 0.0 and 1.0) which determines how much the source color will be blended into the destination image.
Returns
The destination image (dst) containing the result.
Author
Karol Szwed (galli.nosp@m.um@k.nosp@m.de.or.nosp@m.g)
Fredrik Höglund (fredr.nosp@m.ik@k.nosp@m.de.or.nosp@m.g)

Definition at line 1067 of file kimageeffect.cpp.

◆ blend() [2/7]

bool KImageEffect::blend ( const TQImage &  upper,
const TQImage &  lower,
TQImage &  output 
)
static

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

Parameters
upperthe "upper" image
lowerthe "lower" image
outputthe target image
Author
Rik Hemsley (rikkus) rik@k.nosp@m.de.o.nosp@m.rg

Definition at line 2378 of file kimageeffect.cpp.

◆ blend() [3/7]

bool KImageEffect::blend ( int &  x,
int &  y,
const TQImage &  upper,
const TQImage &  lower,
TQImage &  output 
)
static

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 TQImage 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
xx-coordinate of lower image
yy-coordinate of lower image
upperthe "upper" image
lowerthe "lower" image
outputthe target image

Definition at line 2450 of file kimageeffect.cpp.

◆ blend() [4/7]

TQImage & KImageEffect::blend ( TQImage &  image,
float  initial_intensity,
const TQColor &  bgnd,
GradientType  eff,
bool  anti_dir = false 
)
static

Blend 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)
imagemust be 32bpp

Definition at line 1537 of file kimageeffect.cpp.

◆ blend() [5/7]

TQImage & KImageEffect::blend ( TQImage &  image1,
TQImage &  image2,
GradientType  gt,
int  xf = 100,
int  yf = 100 
)
static

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

Parameters
image1source1 and result of blending
image2source2 of blending
gtgradient type for blending between source1 and source2
xfx decay length for unbalanced gradient tpye
yfy decay length for unbalanced gradient tpye

Definition at line 1745 of file kimageeffect.cpp.

◆ blend() [6/7]

TQImage & KImageEffect::blend ( TQImage &  image1,
TQImage &  image2,
TQImage &  blendImage,
RGBComponent  channel 
)
static

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

Parameters
image1Source 1 and result of blending
image2Source 2 of blending
blendImageIf 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.
channelThe RBG channel to use for the blending decision.

Definition at line 1763 of file kimageeffect.cpp.

◆ blend() [7/7]

TQImage & KImageEffect::blend ( TQImage &  src,
TQImage &  dst,
float  opacity 
)
static

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
srcsource image to be blended into the destination image.
dstdestination image in which the source will be blended into.
opacityopacity (between 0.0 and 1.0) which determines how much the source image will be blended into the destination image.
Returns
The destination image (dst) containing the result.
Author
Karol Szwed (galli.nosp@m.um@k.nosp@m.de.or.nosp@m.g)
Fredrik Höglund (fredr.nosp@m.ik@k.nosp@m.de.or.nosp@m.g)

Definition at line 1308 of file kimageeffect.cpp.

◆ blendOnLower() [1/4]

void KImageEffect::blendOnLower ( const TQImage &  upper,
const TQPoint &  upperOffset,
TQImage &  lower,
const TQRect &  lowerRect 
)
static

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
upperthe "upper" image
upperOffsetOffset for the part of the upper image to be used.
lowerthe "lower" image
lowerRectRectangle for the part of the lower image where the blending will occur.
Since
3.2

Definition at line 2584 of file kimageeffect.cpp.

◆ blendOnLower() [2/4]

void KImageEffect::blendOnLower ( const TQImage &  upper,
const TQPoint &  upperOffset,
TQImage &  lower,
const TQRect &  lowerRect,
float  opacity 
)
static

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
upperthe "upper" image
upperOffsetOffset for the part of the upper image to be used.
lowerthe "lower" image
lowerRectRectangle for the part of the lower image where the blending will occur.
opacityOpacity (between 0.0 and 1.0) which determines how much the source image will be blended into the destination image.
Since
3.2

Definition at line 2606 of file kimageeffect.cpp.

◆ blendOnLower() [3/4]

bool KImageEffect::blendOnLower ( int  x,
int  y,
const TQImage &  upper,
const TQImage &  lower 
)
static

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
xx-coordinate of lower image
yy-coordinate of lower image
upperthe "upper" image
lowerthe "lower" image, which becomes the output image

Definition at line 2514 of file kimageeffect.cpp.

◆ blendOnLower() [4/4]

void KImageEffect::blendOnLower ( TQImage &  upper,
TQImage &  lower,
Disposition  disposition,
float  opacity 
)
static

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.

Since
3.2

Definition at line 2693 of file kimageeffect.cpp.

◆ blur() [1/2]

TQImage KImageEffect::blur ( TQImage &  src,
double  factor = 50.0 
)
static

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

Definition at line 4254 of file kimageeffect.cpp.

◆ blur() [2/2]

TQImage KImageEffect::blur ( TQImage &  src,
double  radius,
double  sigma 
)
static

Blurs an image by convolving pixel neighborhoods.

Parameters
srcThe TQImage to process.
radiusThe radius of the gaussian not counting the center pixel. Use 0 and a suitable radius will be automatically used.
sigmaThe 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)

Definition at line 4260 of file kimageeffect.cpp.

◆ bumpmap()

TQImage KImageEffect::bumpmap ( TQImage &  img,
TQImage &  map,
double  azimuth,
double  elevation,
int  depth,
int  xofs,
int  yofs,
int  waterlevel,
int  ambient,
bool  compensate,
bool  invert,
BumpmapType  type,
bool  tiled 
)
static

A bumpmapping algorithm.

Parameters
imgthe image you want bumpmap
mapthe map used
azimuthazimuth
elevationelevation
depthdepth (not the depth of the image, but of the map)
xofsX offset
yofsY offset
waterlevellevel that full transparency should represent
ambientambient lighting factor
compensatecompensate for darkening
invertinvert bumpmap
typetype of the bumpmap
tiledtile the bumpmap over the image through the Y offset
Returns
The destination image (dst) containing the result.
Author
Zack Rusin zack@.nosp@m.kde..nosp@m.org
Parameters
imgthe image you want bumpmap
mapthe map used
azimuthazimuth
elevationelevation
depthdepth (not the depth of the image, but of the map)
xofsX offset
yofsY offset
waterlevellevel that full transparency should represent
ambientambient lighting factor
compensatecompensate for darkening
invertinvert bumpmap
typetype of the bumpmap
Returns
The destination image (dst) containing the result.
Author
Zack Rusin zack@.nosp@m.kde..nosp@m.org

Definition at line 4855 of file kimageeffect.cpp.

◆ channelIntensity()

TQImage & KImageEffect::channelIntensity ( TQImage &  image,
float  percent,
RGBComponent  channel 
)
static

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

Parameters
imageThe TQImage to process.
percentPercent value. Use a negative value to dim.
channelWhich channel(s) should be modified
Returns
The image, provided for convenience.
Author
Daniel M. Duley (mosfet)

Definition at line 846 of file kimageeffect.cpp.

◆ charcoal() [1/2]

TQImage KImageEffect::charcoal ( TQImage &  src,
double  factor = 50.0 
)
static

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

Definition at line 3677 of file kimageeffect.cpp.

◆ charcoal() [2/2]

TQImage KImageEffect::charcoal ( TQImage &  src,
double  radius,
double  sigma 
)
static

Produces a neat little "charcoal" effect.

Parameters
srcThe TQImage to process.
radiusThe radius of the gaussian not counting the center pixel. Use 0 and a suitable radius will be automatically used.
sigmaThe 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)

Definition at line 3683 of file kimageeffect.cpp.

◆ computeDestinationRect()

TQRect KImageEffect::computeDestinationRect ( const TQSize &  lowerSize,
Disposition  disposition,
TQImage &  upper 
)
static

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
lowerSizeThe size of the destination image.
dispositionThe wanted disposition.
upperThe upper image. Note that this image may be scaled to adjust to the requested disposition.
Returns
the computed rectangle. Its size may exceed lowerSize.
Since
3.2

Definition at line 2628 of file kimageeffect.cpp.

◆ contrast()

TQImage & KImageEffect::contrast ( TQImage &  image,
int  c 
)
static

Fast, but low quality contrast of an image.

Also see contrastHSV.

Parameters
imageThe TQImage to process.
cA contrast value between -255 to 255.
Returns
The image(), provided for convenience.
Author
Daniel M. Duley (mosfet)

KDE 4: remove

Definition at line 2199 of file kimageeffect.cpp.

◆ contrastHSV()

void KImageEffect::contrastHSV ( TQImage &  img,
bool  sharpen = true 
)
static

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
imgThe TQImage to process.
sharpenIf true sharpness is increase, (spiffed). Otherwise it is decreased, (dulled).
Author
Daniel M. Duley (mosfet)

Definition at line 4618 of file kimageeffect.cpp.

◆ convertToPremultipliedAlpha()

TQImage KImageEffect::convertToPremultipliedAlpha ( TQImage  input)
static

Convert an image with standard alpha to premultiplied alpha.

Parameters
imgthe image you want convert
Returns
The destination image (dst) containing the result.
Author
Timothy Pearson kb9vq.nosp@m.f@pe.nosp@m.arson.nosp@m.comp.nosp@m.uting.nosp@m..net

Definition at line 4941 of file kimageeffect.cpp.

◆ desaturate()

TQImage & KImageEffect::desaturate ( TQImage &  image,
float  desat = 0.3 
)
static

Desaturate an image evenly.

Parameters
imageThe TQImage to process.
desatA value between 0 and 1 setting the degree of desaturation
Returns
Returns the image(), provided for convenience.

Definition at line 2176 of file kimageeffect.cpp.

◆ despeckle()

TQImage KImageEffect::despeckle ( TQImage &  src)
static

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

Parameters
srcThe TQImage to process.
Returns
The despeckled image. The original is not changed.
Author
Daniel M. Duley (mosfet)

Definition at line 2906 of file kimageeffect.cpp.

◆ dither()

TQImage & KImageEffect::dither ( TQImage &  image,
const TQColor *  palette,
int  size 
)
static

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

Parameters
imageThe TQImage to process.
paletteThe color palette to use
sizeThe size of the palette
Returns
Returns the image(), provided for convenience.

Definition at line 2261 of file kimageeffect.cpp.

◆ edge()

TQImage KImageEffect::edge ( TQImage &  src,
double  radius 
)
static

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

Parameters
srcThe TQImage to process.
radiusThe 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)

Definition at line 4003 of file kimageeffect.cpp.

◆ emboss() [1/2]

TQImage KImageEffect::emboss ( TQImage &  src)
static

Convenience method.

Definition at line 4035 of file kimageeffect.cpp.

◆ emboss() [2/2]

TQImage KImageEffect::emboss ( TQImage &  src,
double  radius,
double  sigma 
)
static

Embosses the source image.

This involves highlighting the edges and applying various other enhancements in order to get a metal effect.

Parameters
srcThe TQImage to process.
radiusThe radius of the gaussian not counting the center pixel. Use 0 and a suitable radius will be automatically used.
sigmaThe 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)

Definition at line 4041 of file kimageeffect.cpp.

◆ equalize()

void KImageEffect::equalize ( TQImage &  img)
static

Performs histogram equalisation on the reference image.

Parameters
imgthe image that is equalised
Author
Daniel M. Duley (mosfet)

Definition at line 3903 of file kimageeffect.cpp.

◆ fade()

TQImage & KImageEffect::fade ( TQImage &  image,
float  val,
const TQColor &  color 
)
static

Fade an image to a certain background color.

The number of colors will not be changed.

Parameters
imageThe TQImage to process.
valThe strength of the effect. 0 <= val <= 1.
colorThe background color.
Returns
Returns the image(), provided for convenience.

Definition at line 2044 of file kimageeffect.cpp.

◆ flatten()

TQImage & KImageEffect::flatten ( TQImage &  image,
const TQColor &  ca,
const TQColor &  cb,
int  ncols = 0 
)
static

This recolors a pixmap.

The most dark color will become color a, the most bright one color b, and in between.

Parameters
imageA TQImage to process.
caColor a
cbColor b
ncolsThe number of colors to dither the image to. Pass 0 to prevent dithering.

Definition at line 1947 of file kimageeffect.cpp.

◆ gradient()

TQImage KImageEffect::gradient ( const TQSize &  size,
const TQColor &  ca,
const TQColor &  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.

Definition at line 124 of file kimageeffect.cpp.

◆ hash()

TQImage & KImageEffect::hash ( TQImage &  image,
Lighting  lite = NorthLite,
unsigned int  spacing = 0 
)
static

Build a hash on any given TQImage.

Parameters
imageThe TQImage to process
liteThe hash faces the indicated lighting (cardinal poles).
spacingHow many unmodified pixels in between hashes.
Returns
Returns the image(), provided for convenience.

Definition at line 1866 of file kimageeffect.cpp.

◆ implode()

TQImage KImageEffect::implode ( TQImage &  src,
double  factor = 30.0,
unsigned int  background = 0xFFFFFFFF 
)
static

Implodes an image by a specified percent.

Parameters
srcThe TQImage to process.
factorThe extent of the implosion.
backgroundAn 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)

Definition at line 3242 of file kimageeffect.cpp.

◆ intensity()

TQImage & KImageEffect::intensity ( TQImage &  image,
float  percent 
)
static

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
imageThe TQImage to process.
percentThe percent value. Use a negative value to dim.
Returns
Returns The image(), provided for convenience.
Author
Daniel M. Duley (mosfet)
Benjamin Roe (ben@b.nosp@m.enro.nosp@m.e.com)

Definition at line 654 of file kimageeffect.cpp.

◆ modulate()

TQImage & KImageEffect::modulate ( TQImage &  image,
TQImage &  modImage,
bool  reverse,
ModulationType  type,
int  factor,
RGBComponent  channel 
)
static

Modulate the image with a color channel of another image.

Parameters
imageThe TQImage to modulate and result.
modImageThe TQImage to use for modulation.
reverseInvert the meaning of image/modImage; result is image!
typeThe modulation Type to use.
factorThe modulation amplitude; with 0 no effect [-200;200].
channelThe RBG channel of image2 to use for modulation.
Returns
Returns the image(), provided for convenience.

Definition at line 937 of file kimageeffect.cpp.

◆ normalize()

void KImageEffect::normalize ( TQImage &  img)
static

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

This is a contrast enhancement technique.

Parameters
imgthe image that is normalised
Author
Daniel M. Duley (mosfet)

Definition at line 3693 of file kimageeffect.cpp.

◆ oilPaint()

TQImage KImageEffect::oilPaint ( TQImage &  src,
int  radius = 3 
)
static

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

Definition at line 3606 of file kimageeffect.cpp.

◆ oilPaintConvolve()

TQImage KImageEffect::oilPaintConvolve ( TQImage &  src,
double  radius 
)
static

Produces an oil painting effect.

Parameters
srcThe TQImage to process.
radiusThe 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)

Definition at line 3612 of file kimageeffect.cpp.

◆ rotate()

TQImage KImageEffect::rotate ( TQImage &  src,
RotateDirection  r 
)
static

Rotates the image by the specified amount.

Parameters
srcThe TQImage to process.
rThe rotate direction.
Returns
The rotated image. The original is not changed.
Author
Daniel M. Duley (mosfet)

Definition at line 3323 of file kimageeffect.cpp.

◆ sample()

TQImage KImageEffect::sample ( TQImage &  src,
int  w,
int  h 
)
static

Scales an image using simple pixel sampling.

This does not produce nearly as nice a result as TQImage::smoothScale(), but has the advantage of being much faster - only a few milliseconds.

Parameters
srcThe TQImage to process.
wThe new width.
hThe new height.
Returns
The scaled image. The original is not changed.
Author
Daniel M. Duley (mosfet)

Definition at line 2747 of file kimageeffect.cpp.

◆ selectedImage()

TQImage & KImageEffect::selectedImage ( TQImage &  img,
const TQColor &  col 
)
static

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

Parameters
imgthe TQImage to select
colthe selected color, usually from TQColorGroup::highlight().

Definition at line 2705 of file kimageeffect.cpp.

◆ shade()

TQImage KImageEffect::shade ( TQImage &  src,
bool  color_shading = true,
double  azimuth = 30.0,
double  elevation = 30.0 
)
static

Shades the image using a distance light source.

Parameters
srcThe TQImage to process.
color_shadingIf true do color shading, otherwise do grayscale.
azimuthDetermines the light source and direction.
elevationDetermines the light source and direction.
Returns
The shaded image. The original is not changed.
Author
Daniel M. Duley (mosfet)

Definition at line 4480 of file kimageeffect.cpp.

◆ sharpen() [1/2]

TQImage KImageEffect::sharpen ( TQImage &  src,
double  factor = 30.0 
)
static

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

Definition at line 4434 of file kimageeffect.cpp.

◆ sharpen() [2/2]

TQImage KImageEffect::sharpen ( TQImage &  src,
double  radius,
double  sigma 
)
static

Sharpens the pixels in the image using pixel neighborhoods.

Parameters
srcThe TQImage to process.
radiusThe radius of the gaussian not counting the center pixel. Use 0 and a suitable radius will be automatically used.
sigmaThe 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)

Definition at line 4440 of file kimageeffect.cpp.

◆ solarize()

void KImageEffect::solarize ( TQImage &  img,
double  factor = 50.0 
)
static

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

Parameters
imgThe TQImage to process.
factorThe extent of the solarization (0-99.9)
Author
Daniel M. Duley (mosfet)

Definition at line 3421 of file kimageeffect.cpp.

◆ spread()

TQImage KImageEffect::spread ( TQImage &  src,
unsigned int  amount = 3 
)
static

Randomly displaces pixels.

Parameters
srcThe TQImage to process.
amountThe vicinity for choosing a random pixel to swap.
Returns
The image with pixels displaced. The original is not changed.
Author
Daniel M. Duley (mosfet)

Definition at line 3444 of file kimageeffect.cpp.

◆ swirl()

TQImage KImageEffect::swirl ( TQImage &  src,
double  degrees = 50.0,
unsigned int  background = 0xFFFFFFFF 
)
static

Swirls the image by a specified amount.

Parameters
srcThe TQImage to process.
degreesThe tightness of the swirl.
backgroundAn 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)

Definition at line 3495 of file kimageeffect.cpp.

◆ threshold()

void KImageEffect::threshold ( TQImage &  img,
unsigned int  value = 128 
)
static

Thresholds the reference image.

You can also threshold images by using ThresholdDither in the various QPixmap/TQImage convert methods, but this lets you specify a threshold value.

Parameters
imgThe TQImage to process.
valueThe threshold value.
Author
Daniel M. Duley (mosfet)

Definition at line 2810 of file kimageeffect.cpp.

◆ toGray()

TQImage & KImageEffect::toGray ( TQImage &  image,
bool  fast = false 
)
static

Convert an image to grayscale.

Parameters
imageThe TQImage 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.
Author
Daniel M. Duley (mosfet)

Definition at line 2126 of file kimageeffect.cpp.

◆ unbalancedGradient()

TQImage KImageEffect::unbalancedGradient ( const TQSize &  size,
const TQColor &  ca,
const TQColor &  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 KImageEffect:gradient.

Definition at line 388 of file kimageeffect.cpp.

◆ wave()

TQImage KImageEffect::wave ( TQImage &  src,
double  amplitude = 25.0,
double  frequency = 150.0,
unsigned int  background = 0xFFFFFFFF 
)
static

Modifies the pixels along a sine wave.

Parameters
srcThe TQImage to process.
amplitudeThe amplitude of the sine wave.
frequencyThe frequency of the sine wave.
backgroundAn 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)

Definition at line 3573 of file kimageeffect.cpp.


The documentation for this class was generated from the following files:
  • kimageeffect.h
  • kimageeffect.cpp

tdefx

Skip menu "tdefx"
  • Main Page
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

tdefx

Skip menu "tdefx"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdefx by doxygen 1.9.4
This website is maintained by Timothy Pearson.