[Pixman] Op. when compositing

Søren Sandmann soren.sandmann at gmail.com
Wed Jun 11 12:49:34 PDT 2014


Eric Nicolas <erik.nicolas at gmail.com> writes:

> Hello,
>  
> I have a question about the OP modes when compositing with Pixman. I had a look at the source code, but this part of the code is quite complex, so I couldn’t find the answer there.
>  
> What I would like to do is :
> -          Use a plain color via a pixman_image_create_solid_fill on a RGBA color ;
> -          Use a PIXMAN_a8 mask ;
> -          Modify a target PIXMAN_r8g8b8a8 image.
> So I do a pixman_image_composite(OP, fill, mask, target, …).
>  
> My problem is that I cannot find an OP which would allow me to blend fill and mask together into target. I mean if ‘fill’ color has an alpha (for instance 0x80), mask is also an alpha (for instance 0x80), I expect the target to be blent with the color modified with an alpha of 0x40 (full fill color x mask alpha => blent to target).
>
> The closest I found is PIXMAN_OP_ATOP, but it always use the RGB from
> the fill color and the A from the mask, it never blends the color with
> the mask before compositing onto the target.

The PIXMAN_OP_OVER operator used with a solid color, a PIXMAN_a8 mask
and a PIXMAN_r8g8b8a8 target will multiply the fill color with the pixel
from the a8 mask and then blend the result onto the target image.

But maybe this is not what you want to do. If not, it might be helpful
if you could post images showing what you would like to get, and what
you are getting.


Søren


More information about the Pixman mailing list