1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-24 07:02:30 +01:00

wrlib: Improvement in the alpha channel support.

There are some problems in the alpha channel support, as is
reported at http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=72917

This patch add a new RCombineAlpha function, based on Gimp. This
function is called when needed in the raster.c functions.

This patch is based on the Brad Jorsch <anomie@users.sourceforge.net>
patch for the 0.62.1-0.1 version.

[crmafra: v1 was sent by Rodolfo kix Garcia <kix@kix.es>]
This commit is contained in:
Christophe CURIS
2012-01-15 20:45:54 +01:00
committed by Carlos R. Mafra
parent e06b3005e8
commit 3ed409cbd0
5 changed files with 142 additions and 92 deletions

View File

@@ -143,6 +143,7 @@ static void operatePixel(RImage * image, int ofs, int operation, RColor * color)
*sr = (((int)*sr * nalpha) + ((int)color->red * alpha)) / 256;
*sg = (((int)*sg * nalpha) + ((int)color->green * alpha)) / 256;
*sb = (((int)*sb * nalpha) + ((int)color->blue * alpha)) / 256;
*sa = alpha + ((int)*sa * nalpha) / 256;
}
break;
case RAddOperation: