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:
committed by
Carlos R. Mafra
parent
e06b3005e8
commit
3ed409cbd0
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user