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 authored and Carlos R. Mafra committed 2012-01-18 12:04:57 +00:00
1 parent e06b3005e8
commit 3ed409cbd0
5 files changed
+142 -92

No files matched your search

+1
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: