#include </home/clem/local/src/opie/libopie2/opieui/oimageeffect.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 } |
Static Public Member Functions | |
| static QImage | gradient (const QSize &size, const QColor &ca, const QColor &cb, GradientType type, int ncols=3) |
| static QImage | unbalancedGradient (const QSize &size, const QColor &ca, const QColor &cb, GradientType type, int xfactor=100, int yfactor=100, int ncols=3) |
| static QImage & | blend (const QColor &clr, QImage &dst, float opacity) |
| static QImage & | blend (QImage &src, QImage &dst, float opacity) |
| static QImage & | blend (QImage &image, float initial_intensity, const QColor &bgnd, GradientType eff, bool anti_dir=false) |
| static QImage & | blend (QImage &image1, QImage &image2, GradientType gt, int xf=100, int yf=100) |
| static QImage & | blend (QImage &image1, QImage &image2, QImage &blendImage, RGBComponent channel) |
| static bool | blend (const QImage &upper, const QImage &lower, QImage &output) |
| static bool | blend (int &x, int &y, const QImage &upper, const QImage &lower, QImage &output) |
| static bool | blendOnLower (int x, int y, const QImage &upper, const QImage &lower) |
| static QImage & | channelIntensity (QImage &image, float percent, RGBComponent channel) |
| static QImage & | fade (QImage &img, float val, const QColor &color) |
| static QImage & | flatten (QImage &image, const QColor &ca, const QColor &cb, int ncols=0) |
| static QImage & | hash (QImage &image, Lighting lite=NorthLite, unsigned int spacing=0) |
| static QImage & | intensity (QImage &image, float percent) |
| static QImage & | modulate (QImage &image, QImage &modImage, bool reverse, ModulationType type, int factor, RGBComponent channel) |
| static QImage & | toGray (QImage &image, bool fast=false) |
| static QImage & | desaturate (QImage &image, float desat=0.3) |
| static QImage & | contrast (QImage &image, int c) |
| static QImage & | dither (QImage &img, const QColor *palette, int size) |
| static QImage & | selectedImage (QImage &img, const QColor &col) |
| static void | contrastHSV (QImage &img, bool sharpen=true) |
| static void | normalize (QImage &img) |
| static void | equalize (QImage &img) |
| static void | threshold (QImage &img, unsigned int value=128) |
| static void | solarize (QImage &img, double factor=50.0) |
| static QImage | emboss (QImage &src) |
| static QImage | despeckle (QImage &src) |
| static QImage | charcoal (QImage &src, double factor=50.0) |
| static QImage | rotate (QImage &src, RotateDirection r) |
| static QImage | sample (QImage &src, int w, int h) |
| static QImage | addNoise (QImage &src, NoiseType type=GaussianNoise) |
| static QImage | blur (QImage &src, double factor=50.0) |
| static QImage | edge (QImage &src, double factor=50.0) |
| static QImage | implode (QImage &src, double factor=30.0, unsigned int background=0xFFFFFFFF) |
| static QImage | oilPaint (QImage &src, int radius=3) |
| static QImage | sharpen (QImage &src, double factor=30.0) |
| static QImage | spread (QImage &src, unsigned int amount=3) |
| static QImage | shade (QImage &src, bool color_shading=true, double azimuth=30.0, double elevation=30.0) |
| static QImage | swirl (QImage &src, double degrees=50.0, unsigned int background=0xFFFFFFFF) |
| static QImage | wave (QImage &src, double amplitude=25.0, double frequency=150.0, unsigned int background=0xFFFFFFFF) |
Static Private Member Functions | |
| static unsigned int | lHash (unsigned int c) |
| static unsigned int | uHash (unsigned int c) |
| static int | nearestColor (int r, int g, int b, const QColor *pal, int size) |
| static void | hull (const int x_offset, const int y_offset, const int polarity, const int width, const int height, unsigned int *f, unsigned int *g) |
| static unsigned int | generateNoise (unsigned int pixel, NoiseType type) |
| static unsigned int | interpolateColor (QImage *image, double x, double y, unsigned int background) |
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 53 of file oimageeffect.h.
|
|
Definition at line 56 of file oimageeffect.h. |
|
|
Definition at line 62 of file oimageeffect.h. |
|
|
Definition at line 65 of file oimageeffect.h. |
|
|
Definition at line 67 of file oimageeffect.h. |
|
|
Definition at line 60 of file oimageeffect.h. |
|
|
Definition at line 70 of file oimageeffect.h. |
|
||||||||||||
|
Adds noise to an image.
Definition at line 2589 of file oimageeffect.cpp. References Opie::MM::dest, Opie::MM::destData, generateNoise(), Opie::MM::srcData, Opie::MM::x, and Opie::MM::y. |
|
||||||||||||||||||||||||
|
Blend an image into another one, using alpha in the expected way and over coordinates Definition at line 1834 of file oimageeffect.cpp. |
|
||||||||||||||||
|
Blend an image into another one, using alpha in the expected way.
Definition at line 1764 of file oimageeffect.cpp. |
|
||||||||||||||||||||
|
Blend an image into another one, using a color channel of a third image for the decision of blending from one to another.
Definition at line 1165 of file oimageeffect.cpp. References Blue, g, Green, odebug, oendl, Red, Opie::MM::x, and Opie::MM::y. |
|
||||||||||||||||||||||||
|
Blend an image into another one, using a gradient type for blending from one to another.
Definition at line 1147 of file oimageeffect.cpp. References blend(), Red, and unbalancedGradient(). |
|
||||||||||||||||||||||||
|
Blend the provided image into a background of the indicated color.
Definition at line 943 of file oimageeffect.cpp. References CrossDiagonalGradient, data, DiagonalGradient, EllipticGradient, g, HorizontalGradient, intensity(), odebug, oendl, RectangleGradient, sqrt(), VerticalGradient, Opie::MM::x, and Opie::MM::y. |
|
||||||||||||||||
|
Blend the src image into the destination image, using an opacity value for blending one into another. Very fast direct pixel manipulation is used.
Definition at line 895 of file oimageeffect.cpp. |
|
||||||||||||||||
|
Blends a color into the destination image, using an opacity value for blending one into another. Very fast direct pixel manipulation is used.
Definition at line 854 of file oimageeffect.cpp. References data, depth, i, odebug, and oendl. Referenced by Opie::Ui::OPixmapEffect::blend(), blend(), and selectedImage(). |
|
||||||||||||||||||||
|
Blend an image into another one, using alpha in the expected way and over coordinates Definition at line 1898 of file oimageeffect.cpp. References i. |
|
||||||||||||
|
Blurs an image by convolving pixel neighborhoods.
Definition at line 3632 of file oimageeffect.cpp. References Blur, Blur256, Opie::MM::dest, p, s, Opie::MM::x, and Opie::MM::y. Referenced by charcoal(). |
|
||||||||||||||||
|
Modifies the intensity of a pixmap's RGB channel component.
Definition at line 637 of file oimageeffect.cpp. References data, Green, i, odebug, oendl, and Red. Referenced by Opie::Ui::OPixmapEffect::channelIntensity(). |
|
||||||||||||
|
Produces a neat little "charcoal" effect.
Definition at line 2291 of file oimageeffect.cpp. References blur(), Opie::MM::dest, edge(), normalize(), and toGray(). |
|
||||||||||||
|
Fast, but low quality contrast of an image. Also see contrastHSV.
Definition at line 1597 of file oimageeffect.cpp. |
|
||||||||||||
|
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.
Definition at line 3734 of file oimageeffect.cpp. |
|
||||||||||||
|
Desaturate an image evenly.
Definition at line 1574 of file oimageeffect.cpp. Referenced by Opie::Ui::OPixmapEffect::desaturate(). |
|
|
Minimizes speckle noise in the source image using the 8 hull algorithm.
Definition at line 2383 of file oimageeffect.cpp. References Opie::MM::dest, Opie::MM::destData, hull(), i, Opie::MM::srcData, X, Opie::MM::x, and Opie::MM::y. |
|
||||||||||||||||
|
Dither an image using Floyd-Steinberg dithering for low-color situations.
Definition at line 1647 of file oimageeffect.cpp. References i, and nearestColor(). Referenced by Opie::Ui::OPixmapEffect::blend(), Opie::Ui::OPixmapEffect::dither(), Opie::Ui::OGradientSelector::drawContents(), Opie::Ui::OValueSelector::drawPalette(), Opie::Ui::OHSSelector::drawPalette(), flatten(), gradient(), Opie::Ui::OPixmapEffect::hash(), and unbalancedGradient(). |
|
||||||||||||
|
Detects edges in an image using pixel neighborhoods and an edge detection mask.
Definition at line 3152 of file oimageeffect.cpp. References Opie::MM::dest, Edge, Edge256, MaxRGB, p, s, Opie::MM::x, and Opie::MM::y. Referenced by charcoal(). |
|
|
Embosses the source image. This involves highlighting the edges and applying various other enhancements in order to get a metal effect.
Definition at line 3400 of file oimageeffect.cpp. References Opie::MM::dest, Emboss, Emboss256, MaxRGB, normalize(), p, s, toGray(), Opie::MM::x, and Opie::MM::y. |
|
|
Performs histogram equalization on the reference image.
Definition at line 2097 of file oimageeffect.cpp. References colors, data, i, Opie::Ui::intensityValue(), low, MaxRGB, oendl, owarn, Opie::MM::x, and Opie::MM::y. |
|
||||||||||||||||
|
Fade an image to a certain background color. The number of colors will not be changed.
Definition at line 1442 of file oimageeffect.cpp. References col, data, g, i, Opie::MM::x, and Opie::MM::y. Referenced by Opie::Ui::OPixmapEffect::fade(). |
|
||||||||||||||||||||
|
This recolors a pixmap. The most dark color will become color a, the most bright one color b, and in between.
Definition at line 1345 of file oimageeffect.cpp. References col, dither(), g, i, max, min, Opie::MM::x, and Opie::MM::y. Referenced by Opie::Ui::OPixmapEffect::pattern(). |
|
||||||||||||
|
Definition at line 2494 of file oimageeffect.cpp. References alpha, GaussianNoise, i, ImpulseNoise, LaplacianNoise, M_PI, MaxRGB, MultiplicativeGaussianNoise, NoiseEpsilon, NoiseMask, PoissonNoise, SigmaGaussian, SigmaImpulse, SigmaLaplacian, SigmaMultiplicativeGaussian, SigmaPoisson, SigmaUniform, sqrt(), TauGaussian, and UniformNoise. Referenced by addNoise(). |
|
||||||||||||||||||||||||
|
Create a gradient from color a to color b of the specified type.
Definition at line 62 of file oimageeffect.cpp. References abs, CrossDiagonalGradient, DiagonalGradient, dither(), EllipticGradient, HorizontalGradient, i, image, odebug, oendl, p, PipeCrossGradient, PyramidGradient, RectangleGradient, sqrt(), VerticalGradient, Opie::MM::x, and Opie::MM::y. Referenced by Opie::Ui::OPixmapEffect::gradient(). |
|
||||||||||||||||
|
Build a hash on any given QImage
Definition at line 1266 of file oimageeffect.cpp. References data, EastLite, lHash(), NELite, NorthLite, NWLite, odebug, oendl, SELite, SouthLite, SWLite, uHash(), WestLite, Opie::MM::x, and Opie::MM::y. Referenced by Opie::Ui::OPixmapEffect::hash(). |
|
||||||||||||||||||||||||||||||||
|
Definition at line 2303 of file oimageeffect.cpp. References NULL, p, s, v, Opie::MM::x, and Opie::MM::y. Referenced by despeckle(). |
|
||||||||||||||||
|
Implodes an image by a specified percent.
Definition at line 2719 of file oimageeffect.cpp. References Opie::MM::dest, Opie::MM::destData, interpolateColor(), M_PI, sqrt(), Opie::MM::srcData, Opie::MM::x, and Opie::MM::y. |
|
||||||||||||
|
Either brighten or dim the image by a specified percent. For example, .50 will modify the colors by 50%.
Definition at line 573 of file oimageeffect.cpp. References data, g, i, odebug, and oendl. Referenced by blend(), and Opie::Ui::OPixmapEffect::intensity(). |
|
||||||||||||||||||||
|
Definition at line 2628 of file oimageeffect.cpp. References alpha, colorTable, p, s, t, Opie::MM::x, and Opie::MM::y. |
|
|
Helper function to fast calc some altered (lighten, shaded) colors Definition at line 1238 of file oimageeffect.cpp. References g. Referenced by hash(). |
|
||||||||||||||||||||||||||||
|
Modulate the image with a color channel of another image.
Definition at line 726 of file oimageeffect.cpp. References All, Blue, Contrast, g, Gray, Green, HueShift, Intensity, mod, odebug, oendl, Red, s, Saturation, v, Opie::MM::x, and Opie::MM::y. |
|
||||||||||||||||||||||||
|
Helper function to find the nearest color to the RBG triplet Definition at line 1734 of file oimageeffect.cpp. References i. Referenced by dither(). |
|
|
Normalizes the pixel values to span the full range of color values. This is a contrast enhancement technique.
Definition at line 1981 of file oimageeffect.cpp. References colors, data, i, Opie::Ui::intensityValue(), low, MaxRGB, oendl, owarn, Opie::MM::x, and Opie::MM::y. Referenced by charcoal(), and emboss(). |
|
||||||||||||
|
Produces an oil painting effect.
Definition at line 3076 of file oimageeffect.cpp. References Opie::MM::dest, Opie::MM::destData, i, Opie::Ui::intensityValue(), MaxRGB, oendl, owarn, s, Opie::MM::srcData, Opie::MM::x, and Opie::MM::y. |
|
||||||||||||
|
Rotates the image by the specified amount
Definition at line 2800 of file oimageeffect.cpp. References Opie::MM::dest, Opie::MM::destData, Opie::MM::destTable, Rotate180, Rotate270, Rotate90, Opie::MM::srcData, Opie::MM::srcTable, Opie::MM::x, and Opie::MM::y. |
|
||||||||||||||||
|
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.
Definition at line 2182 of file oimageeffect.cpp. References Opie::MM::dest, Opie::MM::destData, oendl, owarn, Opie::MM::srcData, Opie::MM::x, and Opie::MM::y. |
|
||||||||||||
|
Calculate the image for a selected image, for instance a selected icon on the desktop.
Definition at line 1969 of file oimageeffect.cpp. References blend(). Referenced by Opie::Ui::OPixmapEffect::selectedPixmap(). |
|
||||||||||||||||||||
|
Shades the image using a distance light source.
Definition at line 3498 of file oimageeffect.cpp. References DegreesToRadians, Opie::MM::dest, fabs(), Opie::Ui::intensityValue(), MaxRGB, p, sqrt(), Opie::MM::x, and Opie::MM::y. |
|
||||||||||||
|
Sharpens the pixels in the image using pixel neighborhoods.
Definition at line 3249 of file oimageeffect.cpp. References Opie::MM::dest, g, MaxRGB, p, s, Sharpen, Sharpen256, Opie::MM::x, and Opie::MM::y. |
|
||||||||||||
|
Produces a 'solarization' effect seen when exposing a photographic film to light during the development process.
Definition at line 2898 of file oimageeffect.cpp. References data, i, MaxRGB, and threshold(). |
|
||||||||||||
|
Randomly displaces pixels.
Definition at line 2921 of file oimageeffect.cpp. References Opie::MM::dest, p, Opie::MM::x, and Opie::MM::y. |
|
||||||||||||||||
|
Swirls the image by a specified amount
Definition at line 2972 of file oimageeffect.cpp. References DegreesToRadians, Opie::MM::dest, interpolateColor(), p, sqrt(), Opie::MM::x, and Opie::MM::y. |
|
||||||||||||
|
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.
Definition at line 2275 of file oimageeffect.cpp. References Qt::black, data, i, Opie::Ui::intensityValue(), and Qt::white. Referenced by solarize(). |
|
||||||||||||
|
Convert an image to grayscale.
Definition at line 1524 of file oimageeffect.cpp. References data, end, g, i, and val. Referenced by charcoal(), emboss(), and Opie::Ui::OPixmapEffect::toGray(). |
|
|
Definition at line 1252 of file oimageeffect.cpp. References g. Referenced by hash(). |
|
||||||||||||||||||||||||||||||||
|
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.
Definition at line 324 of file oimageeffect.cpp. References abs, CrossDiagonalGradient, DiagonalGradient, dither(), EllipticGradient, false, HorizontalGradient, i, image, odebug, oendl, p, PipeCrossGradient, PyramidGradient, RectangleGradient, sqrt(), VerticalGradient, Opie::MM::x, and Opie::MM::y. Referenced by blend(), and Opie::Ui::OPixmapEffect::unbalancedGradient(). |
|
||||||||||||||||||||
|
Modifies the pixels along a sine wave.
Definition at line 3050 of file oimageeffect.cpp. References Opie::MM::dest, fabs(), interpolateColor(), M_PI, Opie::MM::x, and Opie::MM::y. |
1.4.2