<div dir="ltr"><div>Most likely what happened is that pixman_image_create_bits()
returned NULL because the stride (not the width) was not divisible by 4
(such images are not supported by pixman). If you then used this NULL
pointer as the mask in a pixman_image_composite() operation, it would
indeed look like the mask was completely ignored.<br><div><br></div><div>Using
a mask is the right way to change the alpha value for an image. It's
best to use a mask created with pixman_image_create_solid() because that
will be more likely to hit various optimized routines. (You can also
use an mask that is 1x1 and has repeat set to hit those routines, but
using create_solid() is recommended).</div><br>[Sorry about the duplicate -- I forgot to copy the list on the first mail]<br><br></div>Søren<br><div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Aug 22, 2015 at 4:38 PM, Jonathan Meson <span dir="ltr"><<a href="mailto:jona@visualblasters.com" target="_blank">jona@visualblasters.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Ah, never mind I resolved this by using a mask! <div><br></div><div>I did notice a particular bug with using a PIXMAN_a8 mask on images of sizes not divisible by 4 such as a width 854. The alpha of the mask was completely ignored. I was using composite with PIXMAN_OP_OVER and running an arm build neon disabled.<br></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Aug 21, 2015 at 11:39 AM, Jonathan Meson <span dir="ltr"><<a href="mailto:jona@visualblasters.com" target="_blank">jona@visualblasters.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hey guys, I'm new to the list. I'm very excited about this powerful library and slowly understanding how to use it properly.<div><br></div><div>So, I'm looking to modify the opacity of an image but I'm not sure how. I attempted to do some research and try some things but it was a bit hard finding documentation or samples.<div><br></div><div>The simple formula to set opacity at 50% is:</div><div>float alpha = 0.5f;</div><div>C = c*alpha;</div><div>A = a*alpha;<br clear="all"><div><br></div><div>However, I'm not sure how to achieve this using pixman_image_composite or any other method from the pixman library.</div><div><br></div><div>Thanks for any details or guidance with respect to this.</div><span><font color="#888888"><div><br></div>-- <br><div><div dir="ltr"><div><div><i><b style="background-color:rgb(255,255,255)"><font color="#3d85c6">Jonathan Meson</font></b></i></div><div><i><font color="#999999">CEO and Lead Engineer</font></i></div><div><font color="#999999">Visual Blasters LLC</font></div><div><font color="#999999"><a href="tel:717-813-4287" value="+17178134287" target="_blank">717-813-4287</a></font></div></div></div></div>
</font></span></div></div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div><div dir="ltr"><div><div><i><b style="background-color:rgb(255,255,255)"><font color="#3d85c6">Jonathan Meson</font></b></i></div><div><i><font color="#999999">CEO and Lead Engineer</font></i></div><div><font color="#999999">Visual Blasters LLC</font></div><div><font color="#999999"><a href="tel:717-813-4287" value="+17178134287" target="_blank">717-813-4287</a></font></div></div></div></div>
</div>
</div></div><br>_______________________________________________<br>
Pixman mailing list<br>
<a href="mailto:Pixman@lists.freedesktop.org">Pixman@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/pixman" rel="noreferrer" target="_blank">http://lists.freedesktop.org/mailman/listinfo/pixman</a><br>
<br></blockquote></div><br></div></div></div>