Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

Opie::Ui::OImageEffect Class Reference

#include </home/clem/local/src/opie/libopie2/opieui/oimageeffect.h>

List of all members.

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)


Detailed Description

This class includes various QImage 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 53 of file oimageeffect.h.


Member Enumeration Documentation

enum Opie::Ui::OImageEffect::GradientType
 

Enumeration values:
VerticalGradient 
HorizontalGradient 
DiagonalGradient 
CrossDiagonalGradient 
PyramidGradient 
RectangleGradient 
PipeCrossGradient 
EllipticGradient 

Definition at line 56 of file oimageeffect.h.

enum Opie::Ui::OImageEffect::Lighting
 

Enumeration values:
NorthLite 
NWLite 
WestLite 
SWLite 
SouthLite 
SELite 
EastLite 
NELite 

Definition at line 62 of file oimageeffect.h.

enum Opie::Ui::OImageEffect::ModulationType
 

Enumeration values:
Intensity 
Saturation 
HueShift 
Contrast 

Definition at line 65 of file oimageeffect.h.

enum Opie::Ui::OImageEffect::NoiseType
 

Enumeration values:
UniformNoise 
GaussianNoise 
MultiplicativeGaussianNoise 
ImpulseNoise 
LaplacianNoise 
PoissonNoise 

Definition at line 67 of file oimageeffect.h.

enum Opie::Ui::OImageEffect::RGBComponent
 

Enumeration values:
Red 
Green 
Blue 
Gray 
All 

Definition at line 60 of file oimageeffect.h.

enum Opie::Ui::OImageEffect::RotateDirection
 

Enumeration values:
Rotate90 
Rotate180 
Rotate270 

Definition at line 70 of file oimageeffect.h.


Member Function Documentation

QImage Opie::Ui::OImageEffect::addNoise QImage &  src,
NoiseType  type = GaussianNoise
[static]
 

Adds noise to an image.

Author:
Daniel M. Duley (mosfet)
Parameters:
src The QImage to process.
type The algorithm used to generate the noise.
Returns:
The image with noise added. The original is not changed.

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.

bool Opie::Ui::OImageEffect::blend int &  x,
int &  y,
const QImage &  upper,
const QImage &  lower,
QImage &  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 QImage 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.

Definition at line 1834 of file oimageeffect.cpp.

References i, and o.

bool Opie::Ui::OImageEffect::blend const QImage &  upper,
const QImage &  lower,
QImage &  output
[static]
 

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

Author:
Rik Hemsley (rikkus) <rik@kde.org>

Definition at line 1764 of file oimageeffect.cpp.

References col, i, o, odebug, oendl, and row.

QImage & Opie::Ui::OImageEffect::blend QImage &  image1,
QImage &  image2,
QImage &  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:
image1 Source 1 and result of blending
image2 Source 2 of blending
blendImage If 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 inbetween, a corresponding blending is used.
channel The RBG channel to use for the blending decision.

Definition at line 1165 of file oimageeffect.cpp.

References Blue, g, Green, odebug, oendl, Red, Opie::MM::x, and Opie::MM::y.

QImage & Opie::Ui::OImageEffect::blend QImage &  image1,
QImage &  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:
image1 source1 and result of blending
image2 source2 of blending
gt gradient type for blending between source1 and source2
xf x decay length for unbalanced gradient tpye
yf y decay length for unbalanced gradient tpye

Definition at line 1147 of file oimageeffect.cpp.

References blend(), Red, and unbalancedGradient().

QImage & Opie::Ui::OImageEffect::blend QImage &  image,
float  initial_intensity,
const QColor &  bgnd,
GradientType  eff,
bool  anti_dir = false
[static]
 

Blend the provided image into a background of the indicated color.

Parameters:
initial_intensity this 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
bgnd indicates the color of the background to blend in
eff lets you choose what kind of blending you like
anti_dir blend in the opposite direction (makes no much sense with concentric blending effects)
image must be 32bpp

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.

QImage & Opie::Ui::OImageEffect::blend QImage &  src,
QImage &  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.

Author:
Karol Szwed (gallium@kde.org)
Parameters:
src source image to be blended into the destination image.
dst destination image in which the source will be blended into.
opacity opacity (in percent) which determines how much the source image will be blended into the destination image.
Returns:
The destination image (dst) containing the result.

Definition at line 895 of file oimageeffect.cpp.

References i, odebug, and oendl.

QImage & Opie::Ui::OImageEffect::blend const QColor &  clr,
QImage &  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.

Author:
Karol Szwed (gallium@kde.org)
Parameters:
clr source color to be blended into the destination image.
dst destination image in which the source will be blended into.
opacity opacity (in percent) which determines how much the source color will be blended into the destination image.
Returns:
The destination image (dst) containing the result.

Definition at line 854 of file oimageeffect.cpp.

References data, depth, i, odebug, and oendl.

Referenced by Opie::Ui::OPixmapEffect::blend(), blend(), and selectedImage().

bool Opie::Ui::OImageEffect::blendOnLower int  x,
int  y,
const QImage &  upper,
const QImage &  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.

Definition at line 1898 of file oimageeffect.cpp.

References i.

QImage Opie::Ui::OImageEffect::blur QImage &  src,
double  factor = 50.0
[static]
 

Blurs an image by convolving pixel neighborhoods.

Author:
Daniel M. Duley (mosfet)
Parameters:
src The QImage to process.
factor The percent weight to give to the center pixel.
Returns:
The blurred image. The original is not changed.

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().

QImage & Opie::Ui::OImageEffect::channelIntensity QImage &  image,
float  percent,
RGBComponent  channel
[static]
 

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

Author:
Daniel M. Duley (mosfet)
Parameters:
image The QImage to process.
percent Percent value. Use a negative value to dim.
channel Which channel(s) should be modified
Returns:
The image, provided for convenience.

Definition at line 637 of file oimageeffect.cpp.

References data, Green, i, odebug, oendl, and Red.

Referenced by Opie::Ui::OPixmapEffect::channelIntensity().

QImage Opie::Ui::OImageEffect::charcoal QImage &  src,
double  factor = 50.0
[static]
 

Produces a neat little "charcoal" effect.

Author:
Daniel M. Duley (mosfet)
Parameters:
src The QImage to process.
factor The factor for detecting lines (0-99.0).
Returns:
The charcoal image. The original is not changed.

Definition at line 2291 of file oimageeffect.cpp.

References blur(), Opie::MM::dest, edge(), normalize(), and toGray().

QImage & Opie::Ui::OImageEffect::contrast QImage &  image,
int  c
[static]
 

Fast, but low quality contrast of an image. Also see contrastHSV.

Author:
Daniel M. Duley (mosfet)
Parameters:
image The QImage to process.
c A contrast value between -255 to 255.
Returns:
The image(), provided for convenience.

Definition at line 1597 of file oimageeffect.cpp.

References data, g, and i.

void Opie::Ui::OImageEffect::contrastHSV QImage &  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.

Author:
Daniel M. Duley (mosfet)
Parameters:
img The QImage to process.
sharpen If true sharpness is increase, (spiffed). Otherwise it is decreased, (dulled).

Definition at line 3734 of file oimageeffect.cpp.

References data, i, M_PI, s, scale(), and v.

QImage & Opie::Ui::OImageEffect::desaturate QImage &  image,
float  desat = 0.3
[static]
 

Desaturate an image evenly.

Parameters:
image The QImage to process.
desat A value between 0 and 1 setting the degree of desaturation
Returns:
Returns the image(), provided for convenience.

Definition at line 1574 of file oimageeffect.cpp.

References data, i, s, and v.

Referenced by Opie::Ui::OPixmapEffect::desaturate().

QImage Opie::Ui::OImageEffect::despeckle QImage &  src  )  [static]
 

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

Author:
Daniel M. Duley (mosfet)
Parameters:
src The QImage to process.
Returns:
The despeckled image. The original is not changed.

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.

QImage & Opie::Ui::OImageEffect::dither QImage &  img,
const QColor *  palette,
int  size
[static]
 

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

Parameters:
img The QImage to process.
palette The color palette to use
size The size of the palette
Returns:
Returns the image(), provided for convenience.

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().

QImage Opie::Ui::OImageEffect::edge QImage &  src,
double  factor = 50.0
[static]
 

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

Author:
Daniel M. Duley (mosfet)
Parameters:
src The QImage to process.
factor The percent weight to give to the center pixel.
Returns:
The image with edges detected. The original is not changed.

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().

QImage Opie::Ui::OImageEffect::emboss QImage &  src  )  [static]
 

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

Author:
Daniel M. Duley (mosfet)
Parameters:
src The QImage to process.
Returns:
The embossed image. The original is not changed.

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.

void Opie::Ui::OImageEffect::equalize QImage &  img  )  [static]
 

Performs histogram equalization on the reference image.

Author:
Daniel M. Duley (mosfet)

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.

QImage & Opie::Ui::OImageEffect::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 QImage to process.
val The strength of the effect. 0 <= val <= 1.
color The background color.
Returns:
Returns the image(), provided for convenience.

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().

QImage & Opie::Ui::OImageEffect::flatten QImage &  image,
const QColor &  ca,
const QColor &  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:
image A QImage to process.
ca Color a
cb Color b

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().

unsigned int Opie::Ui::OImageEffect::generateNoise unsigned int  pixel,
NoiseType  type
[static, private]
 

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().

QImage Opie::Ui::OImageEffect::gradient const QSize &  size,
const QColor &  ca,
const QColor &  cb,
GradientType  type,
int  ncols = 3
[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.
ncols The 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 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().

QImage & Opie::Ui::OImageEffect::hash QImage &  image,
Lighting  lite = NorthLite,
unsigned int  spacing = 0
[static]
 

Build a hash on any given QImage

Parameters:
image The QImage to process
lite The hash faces the indicated lighting (cardinal poles).
spacing How many unmodified pixels inbetween hashes.
Returns:
Returns the image(), provided for convenience.

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().

void Opie::Ui::OImageEffect::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, private]
 

Definition at line 2303 of file oimageeffect.cpp.

References NULL, p, s, v, Opie::MM::x, and Opie::MM::y.

Referenced by despeckle().

QImage Opie::Ui::OImageEffect::implode QImage &  src,
double  factor = 30.0,
unsigned int  background = 0xFFFFFFFF
[static]
 

Implodes an image by a specified percent.

Author:
Daniel M. Duley (mosfet)
Parameters:
src The QImage to process.
factor The extent of the implosion.
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 imploded image. The original is not changed.

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.

QImage & Opie::Ui::OImageEffect::intensity QImage &  image,
float  percent
[static]
 

Either brighten or dim the image by a specified percent. For example, .50 will modify the colors by 50%.

Author:
Daniel M. Duley (mosfet)
Parameters:
image The QImage to process.
percent The percent value. Use a negative value to dim.
Returns:
Returns The image(), provided for convenience.

Definition at line 573 of file oimageeffect.cpp.

References data, g, i, odebug, and oendl.

Referenced by blend(), and Opie::Ui::OPixmapEffect::intensity().

unsigned int Opie::Ui::OImageEffect::interpolateColor QImage *  image,
double  x,
double  y,
unsigned int  background
[static, private]
 

Definition at line 2628 of file oimageeffect.cpp.

References alpha, colorTable, p, s, t, Opie::MM::x, and Opie::MM::y.

Referenced by implode(), swirl(), and wave().

unsigned int Opie::Ui::OImageEffect::lHash unsigned int  c  )  [static, private]
 

Helper function to fast calc some altered (lighten, shaded) colors

Definition at line 1238 of file oimageeffect.cpp.

References g.

Referenced by hash().

QImage & Opie::Ui::OImageEffect::modulate QImage &  image,
QImage &  modImage,
bool  reverse,
ModulationType  type,
int  factor,
RGBComponent  channel
[static]
 

Modulate the image with a color channel of another image.

Parameters:
image The QImage to modulate and result.
modImage 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 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.

int Opie::Ui::OImageEffect::nearestColor int  r,
int  g,
int  b,
const QColor *  pal,
int  size
[static, private]
 

Helper function to find the nearest color to the RBG triplet

Definition at line 1734 of file oimageeffect.cpp.

References i.

Referenced by dither().

void Opie::Ui::OImageEffect::normalize QImage &  img  )  [static]
 

Normalizes the pixel values to span the full range of color values. This is a contrast enhancement technique.

Author:
Daniel M. Duley (mosfet)

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().

QImage Opie::Ui::OImageEffect::oilPaint QImage &  src,
int  radius = 3
[static]
 

Produces an oil painting effect.

Author:
Daniel M. Duley (mosfet)
Parameters:
src The QImage to process.
radius The radius of the pixel neighborhood used in applying the effect.
Returns:
The new image. The original is not changed.

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.

QImage Opie::Ui::OImageEffect::rotate QImage &  src,
RotateDirection  r
[static]
 

Rotates the image by the specified amount

Author:
Daniel M. Duley (mosfet)
Parameters:
src The QImage to process.
r The rotate direction.
Returns:
The rotated image. The original is not changed.

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.

QImage Opie::Ui::OImageEffect::sample QImage &  src,
int  w,
int  h
[static]
 

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.

Author:
Daniel M. Duley (mosfet)
Parameters:
src The QImage to process.
w The new width.
h The new height.
Returns:
The scaled image. The original is not changed.

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.

QImage & Opie::Ui::OImageEffect::selectedImage QImage &  img,
const QColor &  col
[static]
 

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

Parameters:
img the QImage to select
col the selected color, usually from QColorGroup::highlight().

Definition at line 1969 of file oimageeffect.cpp.

References blend().

Referenced by Opie::Ui::OPixmapEffect::selectedPixmap().

QImage Opie::Ui::OImageEffect::shade QImage &  src,
bool  color_shading = true,
double  azimuth = 30.0,
double  elevation = 30.0
[static]
 

Shades the image using a distance light source.

Author:
Daniel M. Duley (mosfet)
Parameters:
src The QImage to process.
color_shading If true do color shading, otherwise do grayscale.
azimuth Determines the light source and direction.
elevation Determines the light source and direction.
Returns:
The shaded image. The original is not changed.

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.

QImage Opie::Ui::OImageEffect::sharpen QImage &  src,
double  factor = 30.0
[static]
 

Sharpens the pixels in the image using pixel neighborhoods.

Author:
Daniel M. Duley (mosfet)
Parameters:
src The QImage to process.
factor The percent weight to give to the center pixel.
Returns:
The sharpened image. The original is not changed.

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.

void Opie::Ui::OImageEffect::solarize QImage &  img,
double  factor = 50.0
[static]
 

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

Author:
Daniel M. Duley (mosfet)
Parameters:
img The QImage to process.
factor The extent of the solarization (0-99.9)

Definition at line 2898 of file oimageeffect.cpp.

References data, i, MaxRGB, and threshold().

QImage Opie::Ui::OImageEffect::spread QImage &  src,
unsigned int  amount = 3
[static]
 

Randomly displaces pixels.

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

Definition at line 2921 of file oimageeffect.cpp.

References Opie::MM::dest, p, Opie::MM::x, and Opie::MM::y.

QImage Opie::Ui::OImageEffect::swirl QImage &  src,
double  degrees = 50.0,
unsigned int  background = 0xFFFFFFFF
[static]
 

Swirls the image by a specified amount

Author:
Daniel M. Duley (mosfet)
Parameters:
src The QImage to process.
degrees The tightness of the swirl.
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 swirled image. The original is not changed.

Definition at line 2972 of file oimageeffect.cpp.

References DegreesToRadians, Opie::MM::dest, interpolateColor(), p, sqrt(), Opie::MM::x, and Opie::MM::y.

void Opie::Ui::OImageEffect::threshold QImage &  img,
unsigned int  value = 128
[static]
 

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.

Author:
Daniel M. Duley (mosfet)
Parameters:
img The QImage to process.
value The threshold value.

Definition at line 2275 of file oimageeffect.cpp.

References Qt::black, data, i, Opie::Ui::intensityValue(), and Qt::white.

Referenced by solarize().

QImage & Opie::Ui::OImageEffect::toGray QImage &  image,
bool  fast = false
[static]
 

Convert an image to grayscale.

Author:
Daniel M. Duley (mosfet)
Parameters:
image The QImage to process.
fast Set 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.

Definition at line 1524 of file oimageeffect.cpp.

References data, end, g, i, and val.

Referenced by charcoal(), emboss(), and Opie::Ui::OPixmapEffect::toGray().

unsigned int Opie::Ui::OImageEffect::uHash unsigned int  c  )  [static, private]
 

Definition at line 1252 of file oimageeffect.cpp.

References g.

Referenced by hash().

QImage Opie::Ui::OImageEffect::unbalancedGradient const QSize &  size,
const QColor &  ca,
const QColor &  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:
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.
ncols The number of colors. See OPixmapEffect:gradient.

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().

QImage Opie::Ui::OImageEffect::wave QImage &  src,
double  amplitude = 25.0,
double  frequency = 150.0,
unsigned int  background = 0xFFFFFFFF
[static]
 

Modifies the pixels along a sine wave.

Author:
Daniel M. Duley (mosfet)
Parameters:
src The QImage to process.
amplitude The amplitude of the sine wave.
frequency The frequency of the sine wave.
Returns:
The new image. The original is not changed.

Definition at line 3050 of file oimageeffect.cpp.

References Opie::MM::dest, fabs(), interpolateColor(), M_PI, Opie::MM::x, and Opie::MM::y.


The documentation for this class was generated from the following files:
Generated on Sat Nov 5 18:01:55 2005 for OPIE by  doxygen 1.4.2