qimageblitz
Blitz Class Reference
#include <qimageblitz.h>
Public Types | |
| enum | EffectQuality { Low = 0, High } |
| enum | GradientType { VerticalGradient = 0, HorizontalGradient, DiagonalGradient, CrossDiagonalGradient, PyramidGradient, RectangleGradient, PipeCrossGradient, EllipticGradient } |
| enum | ModulationType { Intensity = 0, Saturation, HueShift, Contrast } |
| enum | RGBChannel { Grayscale = 0, Brightness, Red, Green, Blue, Alpha, All } |
| enum | ScaleFilterType { UndefinedFilter = 0, PointFilter, BoxFilter, TriangleFilter, HermiteFilter, HanningFilter, HammingFilter, BlackmanFilter, GaussianFilter, QuadraticFilter, CubicFilter, CatromFilter, MitchellFilter, LanczosFilter, BesselFilter, SincFilter } |
Static Public Member Functions | |
| static QImage | antialias (QImage &img) |
| static QImage | blur (QImage &img, int radius=3) |
| static QImage & | channelIntensity (QImage &img, float percent, RGBChannel channel) |
| static QImage | charcoal (QImage &img) |
| static QImage & | contrast (QImage &img, bool sharpen, int weight=3) |
| static QImage | convolve (QImage &img, int matrix_size, float *matrix) |
| static QImage | convolveEdge (QImage &img, float radius=0.0, EffectQuality quality=High) |
| static QImage | convolveInteger (QImage &img, int matrix_size, int *matrix, int divisor=0) |
| static QImage & | desaturate (QImage &img, float desat=0.5) |
| static QImage & | despeckle (QImage &img) |
| static QImage | edge (QImage &img) |
| static QImage | emboss (QImage &img, float radius=0.0, float sigma=1.0, EffectQuality quality=High) |
| static bool | equalize (QImage &img) |
| static QImage & | fade (QImage &img, float val, const QColor &color) |
| static QImage & | flatten (QImage &img, const QColor &ca, const QColor &cb) |
| static QImage | gaussianBlur (QImage &img, float radius=0.0, float sigma=1.0) |
| static QImage | gaussianSharpen (QImage &img, float radius=0.0, float sigma=1.0, EffectQuality quality=High) |
| static QImage | gradient (const QSize &size, const QColor &ca, const QColor &cb, GradientType type) |
| static QImage | grayGradient (const QSize &size, unsigned char ca, unsigned char cb, GradientType type) |
| static bool | grayscale (QImage &img, bool reduceDepth=false) |
| static QImage | grayUnbalancedGradient (const QSize &size, unsigned char ca, unsigned char cb, GradientType type, int xfactor=100, int yfactor=100) |
| static QImage | implode (QImage &img, float amount=0.3) |
| static QImage & | intensity (QImage &img, float percent) |
| static bool | invert (QImage &img, QImage::InvertMode mode=QImage::InvertRgb) |
| static QImage & | modulate (QImage &img, QImage &modImg, bool reverse, ModulationType type, int factor, RGBChannel channel) |
| static bool | normalize (QImage &img) |
| static QImage | oilPaint (QImage &img, float radius=0.0, EffectQuality quality=High) |
| static QImage | sharpen (QImage &img, int radius=3) |
| static QImage | smoothScale (QImage &img, int dw, int dh, Qt::AspectRatioMode aspectRatio=Qt::IgnoreAspectRatio) |
| static QImage | smoothScale (QImage &img, const QSize &sz, Qt::AspectRatioMode aspectRatio=Qt::IgnoreAspectRatio) |
| static QImage | smoothScaleFilter (QImage &img, int dwX, int dwY, float blur=1.0, ScaleFilterType filter=BlackmanFilter, Qt::AspectRatioMode aspectRatio=Qt::IgnoreAspectRatio) |
| static QImage | smoothScaleFilter (QImage &img, const QSize &sz, float blur=1.0, ScaleFilterType filter=BlackmanFilter, Qt::AspectRatioMode aspectRatio=Qt::IgnoreAspectRatio) |
| static QImage | swirl (QImage &img, float degrees=60.0) |
| static QImage | threshold (QImage &img, unsigned char thresholdValue=127, RGBChannel channel=Grayscale, unsigned int aboveColor=qRgb(255, 255, 255), unsigned int belowColor=qRgb(0, 0, 0)) |
| static QImage | unbalancedGradient (const QSize &size, const QColor &ca, const QColor &cb, GradientType type, int xfactor=100, int yfactor=100) |
| static QImage | wave (QImage &img, float amplitude=25.0, float frequency=150.0, unsigned int background=0) |
Detailed Description
Definition at line 39 of file qimageblitz.h.
Member Enumeration Documentation
| enum Blitz::EffectQuality |
Definition at line 47 of file qimageblitz.h.
| enum Blitz::GradientType |
- Enumerator:
VerticalGradient HorizontalGradient DiagonalGradient CrossDiagonalGradient PyramidGradient RectangleGradient PipeCrossGradient EllipticGradient
Definition at line 42 of file qimageblitz.h.
Definition at line 55 of file qimageblitz.h.
| enum Blitz::RGBChannel |
Definition at line 46 of file qimageblitz.h.
- Enumerator:
Definition at line 49 of file qimageblitz.h.
Member Function Documentation
Antialiases an image.
- Parameters:
-
img The image to process.
- Returns:
- The processed image. The original is not changed.
Definition at line 1328 of file convolve.cpp.
| QImage & Blitz::channelIntensity | ( | QImage & | img, | |
| float | percent, | |||
| RGBChannel | channel | |||
| ) | [static] |
Modifies the intensity of an image's RGB channel.
- Parameters:
-
img The image to process. percent Percent value. Use a negative value to dim. channel Which channel(s) should be modified. Only Red, Green, and Blue are valid.
- Returns:
- A reference to the image for convenience.
Definition at line 553 of file colors.cpp.
High quality, fast HSV contrast.
- Parameters:
-
img The image to process. sharpen If true sharpness is increase, (spiffed). Otherwise it is decreased, (dulled). weight How much to spiff or dull.
- Returns:
- A reference to the image for convenience.
Definition at line 293 of file colors.cpp.
Convolves an image using a convolution matrix, (kernel), and provides the basis for many different image filters and effects.
- Parameters:
-
img The image to process. matrix_size The size of one side of the convolution matrix, ie: a 3x3 matrix would be 3, not 9. matrix The convolution matrix.
- Returns:
- The processed image. The original is not changed.
Definition at line 95 of file convolve.cpp.
| QImage Blitz::convolveEdge | ( | QImage & | img, | |
| float | radius = 0.0, |
|||
| EffectQuality | quality = High | |||
| ) | [static] |
Detects edges in an image using a convolution matrix.
- Parameters:
-
img The image to process. radius The radius of the gaussian, not counting the center pixel. Use 0, (recommended), and an appropriate one will be used. quality Determines if to use a small or large convolution matrix.
- Returns:
- The processed image. The original is not changed.
Definition at line 1371 of file convolve.cpp.
| QImage Blitz::convolveInteger | ( | QImage & | img, | |
| int | matrix_size, | |||
| int * | matrix, | |||
| int | divisor = 0 | |||
| ) | [static] |
Same as above but with a faster integer matrix.
Definition at line 432 of file convolve.cpp.
Desaturate an image evenly.
- Parameters:
-
img The image to process. desat A value between 0 and 1 setting the degree of desaturation
- Returns:
- A reference to the image for convenience.
Definition at line 650 of file colors.cpp.
| QImage Blitz::emboss | ( | QImage & | img, | |
| float | radius = 0.0, |
|||
| float | sigma = 1.0, |
|||
| EffectQuality | quality = High | |||
| ) | [static] |
Embosses an image.
- Parameters:
-
img The image to process. radius The radius of the gaussian, not counting the center pixel. Use 0, (recommended), and an appropriate one will be used. sigma The standard deviation of the gaussian in pixels. Use 1.0, (recommended), for the default value. quality Determines if to use a small or large convolution matrix.
- Returns:
- The processed image. The original is not changed.
Definition at line 1339 of file convolve.cpp.
| bool Blitz::equalize | ( | QImage & | img | ) | [static] |
Performs histogram equalization.
- Parameters:
-
img The image to equalize.
Definition at line 89 of file histogram.cpp.
Fade an image to a certain background color.
The number of colors will not be changed.
- Parameters:
-
img The image to process. val The strength of the effect. 0 <= val <= 1. color The background color.
- Returns:
- A reference to the image for convenience.
Definition at line 908 of file colors.cpp.
This recolors a pixmap.
The most dark color will become color a, the most bright one color b, and in between.
- Parameters:
-
img The image to process. ca Color a cb Color b
Definition at line 964 of file colors.cpp.
A high quality gaussian/convolve-based blur.
- Parameters:
-
img The image to process. radius The radius of the gaussian, not counting the center pixel. Use 0, (recommended), and an appropriate one will be used. sigma The standard deviation of the gaussian in pixels. Use 1.0, (recommended), for the default value.
- Returns:
- The processed image. The original is not changed.
Definition at line 1230 of file convolve.cpp.
| QImage Blitz::gaussianSharpen | ( | QImage & | img, | |
| float | radius = 0.0, |
|||
| float | sigma = 1.0, |
|||
| EffectQuality | quality = High | |||
| ) | [static] |
Sharpens an image.
- Parameters:
-
img The image to process. radius The radius of the gaussian, not counting the center pixel. Use 0, (recommended), and an appropriate one will be used. sigma The standard deviation of the gaussian in pixels. Use 1.0, (recommended), for the default value. quality Determines if to use a small or large convolution matrix.
- Returns:
- The processed image. The original is not changed.
Definition at line 1296 of file convolve.cpp.
| QImage Blitz::gradient | ( | const QSize & | size, | |
| const QColor & | ca, | |||
| const QColor & | cb, | |||
| GradientType | type | |||
| ) | [static] |
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.
- Returns:
- The gradient.
Definition at line 44 of file gradient.cpp.
| QImage Blitz::grayGradient | ( | const QSize & | size, | |
| unsigned char | ca, | |||
| unsigned char | cb, | |||
| GradientType | type | |||
| ) | [static] |
Creates an 8bit grayscale gradient suitable for use as an alpha channel using QImage::setAlphaChannel().
- Parameters:
-
size The desired size of the gradient. ca The grayscale start value. cb The grayscale end value. type The type of gradient.
- Returns:
- The gradient.
Definition at line 221 of file gradient.cpp.
| bool Blitz::grayscale | ( | QImage & | img, | |
| bool | reduceDepth = false | |||
| ) | [static] |
Grayscales an image.
- Parameters:
-
img The image to grayscale. reduceDepth If true the result will be an 8bit palette image.
Definition at line 66 of file colors.cpp.
| QImage Blitz::grayUnbalancedGradient | ( | const QSize & | size, | |
| unsigned char | ca, | |||
| unsigned char | cb, | |||
| GradientType | type, | |||
| int | xfactor = 100, |
|||
| int | yfactor = 100 | |||
| ) | [static] |
Creates an 8bit grayscale gradient suitable for use as an alpha channel using QImage::setAlphaChannel().
- Parameters:
-
size The desired size of the gradient. type The type of gradient. ca The grayscale start value. cb The grayscale end value. xfactor The x decay length. Use a value between -200 and 200. yfactor The y decay length.
- Returns:
- The gradient.
Definition at line 493 of file gradient.cpp.
Either brighten or dim the image by a specified percent.
For example, 0.50 will modify the colors by 50%.
- Parameters:
-
img The image to process. percent The percent value. Use a negative value to dim.
- Returns:
- A reference to the image for convenience.
Definition at line 363 of file colors.cpp.
| bool Blitz::invert | ( | QImage & | img, | |
| QImage::InvertMode | mode = QImage::InvertRgb | |||
| ) | [static] |
Inverts an image.
If the machine supports MMX this can do two pixels at a time, otherwise it's the same as QImage::invertPixels().
- Parameters:
-
img The image to invert. mode If to invert the alpha channel or not.
Definition at line 227 of file colors.cpp.
| QImage & Blitz::modulate | ( | QImage & | img, | |
| QImage & | modImg, | |||
| bool | reverse, | |||
| ModulationType | type, | |||
| int | factor, | |||
| RGBChannel | channel | |||
| ) | [static] |
Modulate the image with a color channel of another image.
- Parameters:
-
img The QImage to modulate and result. modImg 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.
| bool Blitz::normalize | ( | QImage & | img | ) | [static] |
Normalizes the pixel values to span the full range of color values.
This is a contrast enhancement technique.
- Parameters:
-
img The image to normalize
Definition at line 193 of file histogram.cpp.
| QImage Blitz::oilPaint | ( | QImage & | img, | |
| float | radius = 0.0, |
|||
| EffectQuality | quality = High | |||
| ) | [static] |
Produces an oil painting effect.
- Parameters:
-
img The image to process. radius The radius of the gaussian, not counting the center pixel. Use 0, (recommended), and an appropriate one will be used. quality Determines if to use a small or large convolution matrix.
- Returns:
- The processed image. The original is not changed.
Definition at line 347 of file histogram.cpp.
| QImage Blitz::smoothScaleFilter | ( | QImage & | img, | |
| int | dwX, | |||
| int | dwY, | |||
| float | blur = 1.0, |
|||
| ScaleFilterType | filter = BlackmanFilter, |
|||
| Qt::AspectRatioMode | aspectRatio = Qt::IgnoreAspectRatio | |||
| ) | [static] |
Definition at line 654 of file scalefilter.cpp.
| QImage Blitz::smoothScaleFilter | ( | QImage & | img, | |
| const QSize & | sz, | |||
| float | blur = 1.0, |
|||
| ScaleFilterType | filter = BlackmanFilter, |
|||
| Qt::AspectRatioMode | aspectRatio = Qt::IgnoreAspectRatio | |||
| ) | [static] |
Smoothscales an image using a high-quality filter.
- Parameters:
-
img The image to smoothscale. sz The size to scale to. blur A blur factor. Values greater than 1.0 blur while values less than 1.0 sharpen. filter The filter type. aspectRatio What aspect ratio to use, if any.
- Returns:
- The processed image. The original is not changed.
Definition at line 661 of file scalefilter.cpp.
| QImage Blitz::threshold | ( | QImage & | img, | |
| unsigned char | thresholdValue = 127, |
|||
| RGBChannel | channel = Grayscale, |
|||
| unsigned int | aboveColor = qRgb(255, 255, 255), |
|||
| unsigned int | belowColor = qRgb(0, 0, 0) | |||
| ) | [static] |
Thresholds an image based on a given channel and threshold value.
- Parameters:
-
img The image to process. thresholdValue The value that separates "on" colors from "off" ones. channel The channel to use when thresholding. aboveColor The color to use for values at or above the threshold. belowColor The color to use for values below the threshold.
- Returns:
- The processed image. The original is not changed.
Definition at line 702 of file colors.cpp.
| QImage Blitz::unbalancedGradient | ( | const QSize & | size, | |
| const QColor & | ca, | |||
| const QColor & | cb, | |||
| GradientType | type, | |||
| int | xfactor = 100, |
|||
| int | yfactor = 100 | |||
| ) | [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:
-
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.
- Returns:
- The gradient.
Definition at line 335 of file gradient.cpp.
| QImage Blitz::wave | ( | QImage & | img, | |
| float | amplitude = 25.0, |
|||
| float | frequency = 150.0, |
|||
| unsigned int | background = 0 | |||
| ) | [static] |
Modifies the pixels along a sine wave.
- Parameters:
-
img The image 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 processed image. The original is not changed.
The documentation for this class was generated from the following files:
KDE 4.4 API Reference