Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

PieceImageEffect Class Reference

This class performs some effects on images used for PieceImage objects. More...

#include <piece_image_effect.h>

List of all members.

Public Methods

 PieceImageEffect ()
 PieceImageEffect (QDomElement const &dom_element)
QImage apply (QImage const &image) const
bool operator== (PieceImageEffect const &other_effect) const

Private Types

enum  EffectType {
  MOVE, ROTATE_LEFT, ROTATE_RIGHT, UTURN,
  HMIRROR, VMIRROR, BLEND_RGB, BLEND_RGBA,
  BLEND_ALPHA, COLORIZE, SCALE, CROP
}

Private Methods

void putFactor (QDomElement const &element, QString const &name, int scale)
void putColor (QDomElement const &element)
void rotate90 (QImage &image) const
void rotate180 (QImage &image) const
void rotate270 (QImage &image) const
void horizontalMirror (QImage &image) const
void verticalMirror (QImage &image) const
void blendRgb (QImage &image, int factor, int red, int green, int blue) const
void blendRgba (QImage &image, int factor, int red, int green, int blue, int alpha) const
void blendAlpha (QImage &image, int factor, int alpha) const
void colorize (QImage &image, int factor, int red, int green, int blue) const
void crop (QImage &image, int x_offset, int y_offset, int width, int height) const
void move (QImage &image, int x_offset, int y_offset) const
void scale (QImage &image, int width, int height) const

Private Attributes

std::vector< int > m_effects
std::vector< int > m_parameters


Detailed Description

This class performs some effects on images used for PieceImage objects.

Author:
Ralf Schmelter (ralfs@pc2a.chemie.uni-dortmund.de).
Version:
0.1


Member Enumeration Documentation

enum PieceImageEffect::EffectType [private]
 

The type of effects.

Enumeration values:
MOVE   Move effect.
ROTATE_LEFT   Rotate left effect.
ROTATE_RIGHT   Rotate right effect.
UTURN   Uturn effect (rotate 180 degrees).
HMIRROR   Horizontal mirror effect.
VMIRROR   Vertical mirror effect.
BLEND_RGB   Blend rgb effect.
BLEND_RGBA   Blend rgba effect.
BLEND_ALPHA   Blend alpha effect.
COLORIZE   Colorize effect.
SCALE   Scale effect.
CROP   Crop effect.


Constructor & Destructor Documentation

PieceImageEffect::PieceImageEffect
 

Creates an empty object with no effects.

PieceImageEffect::PieceImageEffect QDomElement const & dom_element
 

Creates the effect from an dom element.

Parameters:
dom_element   The dom element to use.


Member Function Documentation

QImage PieceImageEffect::apply QImage const & image const
 

Returns a new version of a given image, with all effects specified applied.

Parameters:
image   The image to use.

void PieceImageEffect::blendAlpha QImage & image,
int factor,
int alpha
const [private]
 

Blends the alpha channel of the image to a specific value.

Parameters:
image   The image to use.
factor   The ammount of blending (in the range [0:256]).
alpha   The alpha component to blend to.

void PieceImageEffect::blendRgb QImage & image,
int factor,
int red,
int green,
int blue
const [private]
 

Blends the image to a color.

Parameters:
image   The image to use.
factor   The ammount of blending (in the range [0:256]).
red   The red component of the blend color.
green   The green component of the blend color.
blue   The blue component of the blend color.

void PieceImageEffect::blendRgba QImage & image,
int factor,
int red,
int green,
int blue,
int alpha
const [private]
 

Blends the image to a color.

Parameters:
image   The image to use.
factor   The ammount of blending (in the range [0:256]).
red   The red component of the blend color.
green   The green component of the blend color.
blue   The blue component of the blend color.
alpha   The alpha component of the blend color.

void PieceImageEffect::colorize QImage & image,
int factor,
int red,
int green,
int blue
const [private]
 

Colorizes the image to a color.

Parameters:
image   The image to use.
factor   The ammount of colorizing (in the range [0:256]).
red   The red component of the colorize color.
green   The green component of the colorize color.
blue   The blue component of the colorize color.

void PieceImageEffect::crop QImage & image,
int x_offset,
int y_offset,
int width,
int height
const [private]
 

Crops the image.

Parameters:
image   The image to use.
x_offset   The x-offset.
y_offset   The y-offset.
width   The new width.
height   The new height.

void PieceImageEffect::horizontalMirror QImage & image const [private]
 

Does horizontal mirroring.

void PieceImageEffect::move QImage & image,
int x_offset,
int y_offset
const [private]
 

Moves the image.

Parameters:
image   The image to use.
x_offset   The x-offset.
y_offset   The y-offset.

bool PieceImageEffect::operator== PieceImageEffect const & other_effect const
 

Returns true if the two piece image effects are equal.

Parameters:
other_effect   The other effect.

void PieceImageEffect::putColor QDomElement const & element [private]
 

Puts the color (rgba values) to the parameter list.

Parameters:
dom_element   The dom_element to use.

void PieceImageEffect::putFactor QDomElement const & element,
QString const & name,
int scale
[private]
 

Puts a to an integer converted double factor to the parameter list.

Parameters:
dom_element   The dom_element to use.
name   The name of the attribute to use.
scale   The scale factor multiplied with the value before converted to an integer.

void PieceImageEffect::rotate180 QImage & image const [private]
 

Does rotate 180.

void PieceImageEffect::rotate270 QImage & image const [private]
 

Does rotate 270.

void PieceImageEffect::rotate90 QImage & image const [private]
 

Does rotate 90.

void PieceImageEffect::scale QImage & image,
int width,
int height
const [private]
 

Scales the image.

Parameters:
image   The image to use.
width   The new width.
height   The new height.

void PieceImageEffect::verticalMirror QImage & image const [private]
 

Does vertical mirroring.


Member Data Documentation

std::vector<int> PieceImageEffect::m_effects [private]
 

The effects.

std::vector<int> PieceImageEffect::m_parameters [private]
 

The parameters of the effects.


The documentation for this class was generated from the following file:
Generated at Sun Jan 6 18:49:12 2002 for EasySok by doxygen1.2.9.1 written by Dimitri van Heesch, © 1997-2001