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

image_effect.h

00001 /*
00002  *   EasySok --- A(nother) sokoban game for KDE.
00003  *
00004  *   Copyright (C) 2001 by Ralf Schmelter (ralfs@pc2a.chemie.uni-dortmund.de).
00005  *
00006  *   This program is free software; you can redistribute it and/or modify
00007  *   it under the terms of the GNU General Public License version 2 as
00008  *   published by the Free Software Foundation.
00009  *
00010  *   This program is distributed in the hope that it will be useful,
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  *   GNU General Public License for more details.
00014  *
00015  *   You should have received a copy of the GNU General Public License
00016  *   along with this program; if not, write to the Free Software
00017  *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00018  */
00019 
00020 
00021 #ifndef EASYSOK_IMAGE_EFFECT_INC_GUARD_H
00022 #define EASYSOK_IMAGE_EFFECT_INC_GUARD_H
00023 
00024 
00025 #include <vector>
00026 
00027 #include <qcolor.h>
00028 
00029 
00030 class QImage;
00031 
00032 
00033 
00034 
00042 class ImageEffect
00043 {
00044 public:
00045 
00061     static void blendOnLower(int x_offset, int y_offset, QImage const & upper, QImage & lower);
00062 
00063 
00074     static void blend(QImage & image, float val, QRgb color, bool fade_rgb, bool fade_alpha);
00075 
00076 
00081     static void blend(QImage & image, int val, QRgb color, bool fade_rgb, bool fade_alpha);
00082 
00083 
00094     static void colorize(QImage & image, float val, QRgb color);
00095 
00096 
00101     static void colorize(QImage & image, int val, QRgb color);
00102 
00103 
00112     static void scale(QImage & image, int new_width, int new_height);
00113 
00114 
00115 private:
00116 
00129     static void calcScaleFactors(int from_pixels, int to_pixels, int sum, std::vector<int> & lengths,
00130                                  std::vector<int> & starts, std::vector<int> & factor_offsets,
00131                                  std::vector<Q_UINT32> & factors);
00132 };
00133 
00134 
00135 #endif

Generated at Sun Jan 6 18:49:09 2002 for EasySok by doxygen1.2.9.1 written by Dimitri van Heesch, © 1997-2001