31 #ifndef __KIMAGE_EFFECT_H
32 #define __KIMAGE_EFFECT_H
34 #include <tdelibs_export.h>
61 CrossDiagonalGradient,
146 static TQImage gradient(
const TQSize &size,
const TQColor &ca,
147 const TQColor &cb, GradientType type,
int ncols=3);
163 static TQImage unbalancedGradient(
const TQSize &size,
const TQColor &ca,
164 const TQColor &cb, GradientType type,
int xfactor = 100,
165 int yfactor = 100,
int ncols = 3);
183 static TQImage& blend(
const TQColor& clr, TQImage& dst,
float opacity);
201 static TQImage& blend(TQImage& src, TQImage& dst,
float opacity);
217 static TQImage& blend(TQImage &image,
float initial_intensity,
218 const TQColor &bgnd, GradientType eff,
219 bool anti_dir=
false);
231 static TQImage& blend(TQImage &image1,TQImage &image2,
232 GradientType gt,
int xf=100,
int yf=100);
246 static TQImage& blend(TQImage &image1, TQImage &image2,
247 TQImage &blendImage, RGBComponent channel);
256 static bool blend(
const TQImage & upper,
const TQImage & lower, TQImage & output);
275 static bool blend(
int &x,
int &y,
const TQImage & upper,
const TQImage & lower, TQImage & output);
287 static bool blendOnLower(
int x,
int y,
const TQImage & upper,
const TQImage & lower);
301 static void blendOnLower(
const TQImage &upper,
const TQPoint &upperOffset,
302 TQImage &lower,
const TQRect &lowerRect);
318 static void blendOnLower(
const TQImage &upper,
const TQPoint &upperOffset,
319 TQImage &lower,
const TQRect &lowerRect,
float opacity);
350 static TQRect computeDestinationRect(
const TQSize &lowerSize,
351 Disposition disposition, TQImage &upper);
359 static void blendOnLower(TQImage &upper, TQImage &lower,
360 Disposition disposition,
float opacity);
371 static TQImage& channelIntensity(TQImage &image,
float percent,
372 RGBComponent channel);
384 static TQImage& fade(TQImage &image,
float val,
const TQColor &color);
397 static TQImage& flatten(TQImage &image,
const TQColor &ca,
398 const TQColor &cb,
int ncols=0);
408 static TQImage& hash(TQImage &image, Lighting lite=NorthLite,
409 unsigned int spacing=0);
424 static TQImage& intensity(TQImage &image,
float percent);
437 static TQImage& modulate(TQImage &image, TQImage &modImage,
bool reverse,
438 ModulationType type,
int factor, RGBComponent channel);
449 static TQImage& toGray(TQImage &image,
bool fast =
false);
458 static TQImage& desaturate(TQImage &image,
float desat = 0.3);
469 static TQImage& contrast(TQImage &image,
int c);
480 static TQImage& dither(TQImage &image,
const TQColor *palette,
int size);
488 static TQImage& selectedImage( TQImage &img,
const TQColor &col );
501 static void contrastHSV(TQImage &img,
bool sharpen=
true);
509 static void normalize(TQImage &img);
517 static void equalize(TQImage &img);
528 static void threshold(TQImage &img,
unsigned int value=128);
538 static void solarize(TQImage &img,
double factor=50.0);
553 static TQImage emboss(TQImage &src,
double radius,
double sigma);
558 static TQImage emboss(TQImage &src);
568 static TQImage despeckle(TQImage &src);
581 static TQImage charcoal(TQImage &src,
double radius,
double sigma);
587 static TQImage charcoal(TQImage &src,
double factor=50.0);
597 static TQImage rotate(TQImage &src, RotateDirection r);
610 static TQImage sample(TQImage &src,
int w,
int h);
620 static TQImage addNoise(TQImage &src, NoiseType type = GaussianNoise);
633 static TQImage blur(TQImage &src,
double radius,
double sigma);
639 static TQImage blur(TQImage &src,
double factor=50.0);
651 static TQImage edge(TQImage &src,
double radius);
663 static TQImage implode(TQImage &src,
double factor=30.0,
664 unsigned int background = 0xFFFFFFFF);
675 static TQImage oilPaintConvolve(TQImage &src,
double radius);
681 static TQImage oilPaint(TQImage &src,
int radius=3);
694 static TQImage sharpen(TQImage &src,
double radius,
double sigma);
700 static TQImage sharpen(TQImage &src,
double factor=30.0);
710 static TQImage spread(TQImage &src,
unsigned int amount=3);
722 static TQImage shade(TQImage &src,
bool color_shading=
true,
double azimuth=30.0,
723 double elevation=30.0);
734 static TQImage swirl(TQImage &src,
double degrees=50.0,
unsigned int background =
748 static TQImage wave(TQImage &src,
double amplitude=25.0,
double frequency=150.0,
749 unsigned int background = 0xFFFFFFFF);
771 static TQImage bumpmap(TQImage &img, TQImage &map,
double azimuth,
double elevation,
772 int depth,
int xofs,
int yofs,
int waterlevel,
773 int ambient,
bool compensate,
bool invert,
774 BumpmapType type,
bool tiled);
784 static TQImage convertToPremultipliedAlpha(TQImage input);
792 static unsigned int lHash(
unsigned int c);
793 static unsigned int uHash(
unsigned int c);
798 static int nearestColor(
int r,
int g,
int b,
const TQColor *pal,
int size );
800 static void hull(
const int x_offset,
const int y_offset,
const int polarity,
801 const int width,
const int height,
802 unsigned int *f,
unsigned int *g);
803 static unsigned int generateNoise(
unsigned int pixel, NoiseType type);
804 static unsigned int interpolateColor(TQImage *image,
double x,
double y,
805 unsigned int background);
807 static int getOptimalKernelWidth(
double radius,
double sigma);
808 static bool convolveImage(TQImage *image, TQImage *dest,
809 const unsigned int order,
810 const double *kernel);
811 static void blurScanLine(
double *kernel,
int width,
812 unsigned int *src,
unsigned int *dest,
814 static int getBlurKernel(
int width,
double sigma,
double **kernel);
Lighting from the top left of the image.
Lighting
This enum provides a lighting direction specification.
ModulationType
This enum provides a modulation type specification.
BumpmapType
This enum lists possible bumpmapping implementations.
Lighting from the bottom right of the image.
Multiplicative Gaussian distribution.
GradientType
This enum provides a gradient type specification.
RGBComponent
This enum provides a RGB channel specification.
Tile top image on bottom image.
Lighting from the left of the image.
Lighting from the top of the image.
RotateDirection
This enum provides a rotation specification.
NoiseType
This enum provides a noise type specification.
This class includes various TQImage based graphical effects.
Center top image on botton image.
Disposition
Disposition of a source image on top of a destination image.
Modulate image saturation.
Lighting from the right of the image.
Center and tile top image on bottom image.
Lighting from the bottom of the image.
Lighting from the bottom left of the image.