<br><br><div class="gmail_quote">On Thu, May 6, 2010 at 1:26 PM, Cyrille Berger <span dir="ltr">&lt;<a href="mailto:cberger@cberger.net">cberger@cberger.net</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Lets try to keep it on the list :) Since it is a very interesting subject ;)<br>
<div class="im"><br>
On Thursday 06 May 2010, you wrote:<br>
</div><div class="im">&gt; Yeah, good point...<br>
&gt; In the beginning i thought it should look like<br>
&gt; QPainter::CompositionMode_Source. But in such a case we will clear all the<br>
&gt; image outside the selection...<br>
&gt;<br>
&gt; I guess, a testcase for a bug is:<br>
&gt;<br>
&gt; Imagine that one of the filter&#39;s tasks is to make a circle of transparency<br>
&gt; in the center of the image. It&#39;s selection is rectangular.<br>
&gt;<br>
&gt; The expected result of direct application of this filter to the image is:<br>
&gt; - all the pixles of the rectangle are filtered (e.g. some brightness)<br>
&gt; - in the center of the image there is a transparent circular hole<br>
&gt;<br>
&gt; If we use COMPOSITE_OVER we would get the following:<br>
&gt; - all the pixels of the rectangle are filtered<br>
&gt; - BUT we see the source image instead of a transparent hole in the center<br>
<br>
</div>Hum indeed, that would break the color-to-alpha filter. So what we need is a<br>
composite op that do like COMPOSITE_OVER for color channels but copy the ALPHA<br>
channel of the filter result into the destination.<br></blockquote><div><br>Argh.. Gmail doesn&#39;t add the CC&#39;s when replying.<br><br>Btw, don&#39;t all the composites should be fixed then?<br><br>I think the composition should look like with two stages:<br>
1) we blend two devices, not counting any selections and write in to the temporary device<br>2) then we blend the result into the destination device using the selection value as an alpha channel for temporary device. At this stage the original alpha channel of the temporary device will be dealt as a regular channel.<br>
<br><br></div></div>-- <br>Dmitry Kazakov<br>