Added functions for blurring and scaling images and changing the alpha value

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@494 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2007-07-05 21:58:09 +00:00
parent d7898faa8c
commit 801dc3db39
12 changed files with 360 additions and 15 deletions
+10
View File
@@ -86,3 +86,13 @@ void set_alpha(Image& img, const Image& img_alpha) {
im[i] = (im[i] * al[i*3]) / 255;
}
}
void set_alpha(Image& img, double alpha) {
if (!img.HasAlpha()) img.InitAlpha();
Byte b_alpha = alpha * 255;
Byte *im = img.GetAlpha();
UInt size = img.GetWidth() * img.GetHeight();
for (UInt i = 0 ; i < size ; ++i) {
im[i] = (im[i] * b_alpha) / 255;
}
}