00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
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