mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-11 05:07:00 -04:00
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:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user