• Skip to content
  • Skip to link menu
KDE 4.4 API Reference
  • KDE API Reference
  • KDE Support
  • Sitemap
  • Contact Us
 

qimageblitz

Blitz Class Reference

#include <qimageblitz.h>

List of all members.

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
Enumerator:
Low 
High 

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.

enum Blitz::ModulationType
Enumerator:
Intensity 
Saturation 
HueShift 
Contrast 

Definition at line 55 of file qimageblitz.h.

enum Blitz::RGBChannel
Enumerator:
Grayscale 
Brightness 
Red 
Green 
Blue 
Alpha 
All 

Definition at line 46 of file qimageblitz.h.

enum Blitz::ScaleFilterType
Enumerator:
UndefinedFilter 
PointFilter 
BoxFilter 
TriangleFilter 
HermiteFilter 
HanningFilter 
HammingFilter 
BlackmanFilter 
GaussianFilter 
QuadraticFilter 
CubicFilter 
CatromFilter 
MitchellFilter 
LanczosFilter 
BesselFilter 
SincFilter 

Definition at line 49 of file qimageblitz.h.


Member Function Documentation

QImage Blitz::antialias ( QImage &  img  )  [static]

Antialiases an image.

Parameters:
img The image to process.
Returns:
The processed image. The original is not changed.
Author:
Daniel M. Duley (mosfet)

Definition at line 1328 of file convolve.cpp.

QImage Blitz::blur ( QImage &  img,
int  radius = 3 
) [static]

A fast blur algorithm.

Parameters:
img The image to process.
radius The radius of the blur. Larger values blur more.
Returns:
The processed image. The original is not changed.
Author:
Daniel M. Duley (mosfet)

Definition at line 197 of file blitz.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.
Author:
Daniel M. Duley (mosfet)

Definition at line 553 of file colors.cpp.

QImage Blitz::charcoal ( QImage &  img  )  [static]

Produces a "charcoal" image effect.

Parameters:
img The image to process.
Returns:
The processed image. The original is not changed.
Author:
Daniel M. Duley (mosfet)

Definition at line 730 of file blitz.cpp.

QImage & Blitz::contrast ( QImage &  img,
bool  sharpen,
int  weight = 3 
) [static]

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

Definition at line 293 of file colors.cpp.

QImage Blitz::convolve ( QImage &  img,
int  matrix_size,
float *  matrix 
) [static]

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

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

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.

QImage & Blitz::desaturate ( QImage &  img,
float  desat = 0.5 
) [static]

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

Definition at line 650 of file colors.cpp.

QImage & Blitz::despeckle ( QImage &  img  )  [static]

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

Parameters:
img The image to process.
Returns:
A reference to the image for convenience.
Author:
Daniel M. Duley (mosfet)

Definition at line 86 of file blitz.cpp.

QImage Blitz::edge ( QImage &  img  )  [static]

Detects edges in an image using the Sobel algorithm.

Parameters:
img The image to process.
Returns:
The processed image. The original is not changed.
Author:
Daniel M. Duley (mosfet)

Definition at line 402 of file blitz.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.
Author:
Daniel M. Duley (mosfet)

Definition at line 1339 of file convolve.cpp.

bool Blitz::equalize ( QImage &  img  )  [static]

Performs histogram equalization.

Parameters:
img The image to equalize.
Author:
Daniel M. Duley (mosfet)

Definition at line 89 of file histogram.cpp.

QImage & Blitz::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:
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.

QImage & Blitz::flatten ( QImage &  img,
const QColor &  ca,
const QColor &  cb 
) [static]

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.

QImage Blitz::gaussianBlur ( QImage &  img,
float  radius = 0.0,
float  sigma = 1.0 
) [static]

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

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

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

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.

QImage Blitz::implode ( QImage &  img,
float  amount = 0.3 
) [static]

Implodes an image by a specified percent.

Parameters:
img The QImage to process.
amount The extent of the implosion.
Returns:
The processed image. The original is not changed.
Author:
Daniel M. Duley (mosfet)

Definition at line 824 of file blitz.cpp.

QImage & Blitz::intensity ( QImage &  img,
float  percent 
) [static]

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.
Author:
Daniel M. Duley (mosfet)
Benjamin Roe (ben@benroe.com)

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

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.

Definition at line 941 of file blitz.cpp.

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

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

Definition at line 347 of file histogram.cpp.

QImage Blitz::sharpen ( QImage &  img,
int  radius = 3 
) [static]

A cheap, fast sharpen.

Parameters:
radius The radius. Larger values sharpen more.
Returns:
The processed image. The original is not changed.
Author:
Daniel M. Duley (mosfet)

Definition at line 311 of file blitz.cpp.

QImage Blitz::smoothScale ( QImage &  img,
int  dw,
int  dh,
Qt::AspectRatioMode  aspectRatio = Qt::IgnoreAspectRatio 
) [static]

Definition at line 88 of file scale.cpp.

QImage Blitz::smoothScale ( QImage &  img,
const QSize &  sz,
Qt::AspectRatioMode  aspectRatio = Qt::IgnoreAspectRatio 
) [static]

A fast smoothscale method with MMX support.

Parameters:
img The image to smoothscale.
sz The size to scale to.
aspectRatio What aspect ratio to use, if any.
Returns:
The processed image. The original is not changed.
Author:
Daniel M. Duley (mosfet)

Definition at line 94 of file scale.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.
Author:
Daniel M. Duley (mosfet)

Definition at line 661 of file scalefilter.cpp.

QImage Blitz::swirl ( QImage &  img,
float  degrees = 60.0 
) [static]

Swirls the image by a specified amount.

Parameters:
img The image to process.
degrees The tightness of the swirl.
Returns:
The processed image. The original is not changed.
Author:
Daniel M. Duley (mosfet)

Definition at line 740 of file blitz.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.
Author:
Daniel M. Duley (mosfet)

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

Definition at line 909 of file blitz.cpp.


The documentation for this class was generated from the following files:
  • qimageblitz.h
  • blitz.cpp
  • colors.cpp
  • convolve.cpp
  • gradient.cpp
  • histogram.cpp
  • scale.cpp
  • scalefilter.cpp

qimageblitz

Skip menu "qimageblitz"
  • Main Page
  • Namespace List
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members

KDE Support

Skip menu "KDE Support"
  • akonadi
  • Decibel
  • grantlee
  • kdewin
  • phonon
  •     Backend
  • polkit-qt
  • qca
  • qimageblitz
  • soprano
  • strigi
  •     searchclient
  •     streamanalyzer
  •     streams
Generated for KDE Support by doxygen 1.5.9-20090814
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal