On Fri, Apr 4, 2008 at 7:05 PM, Emanuele Tamponi <<a href="mailto:emanuele@valinor.it">emanuele@valinor.it</a>> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hello,<br>
As I was trying to say to boud in IRC, in these days I had a simple idea on<br>
how to manage in a "easy" way the layering that occours when a KisImage needs<br>
a repaint. boud assured me that the current strategy has a strong<br>
infrastructure, so I don't want to propose a "substitute", but just a<br>
suggestion and if you consider it a really good solution, we can take into<br>
account even the substitution.<br>
<br>
Anyway, now I'll try to explain; as often happens with my explanations, I'm<br>
sure that it will be of almost no use, but still... perhaps with a few images<br>
and some code I'll be a bit more successful :) Let's start.<br>
<br>
Consider a multi-layered image as in this picture:<br>
<br>
<picture1><br>
<br>
Each rect is a layer. When this image is being built, a method finds all<br>
the "simple" (as in not-more-decomponible) regions of the image:<br>
<br>
<picture2><br>
<br>
In this example, as you see in the picture, there are 4 regions. Each "region<br>
object" should contain a list of layers that it contains, from the bottommost<br>
to the topmost (so in a bottom-up order)<br>
<br>
Region 1: Layer I<br>
Region 2: Layer I and II<br>
Region 3: Layer I, II and III<br>
Region 4: Layer I and III<br>
<br>
These region objects calculate a list of the layers that are *visible* in<br>
their region. In the example, consider layer III being completely opaque,<br>
while layers I and II are semi-opaque; and consider layer order being I, III,<br>
II (from bottom to top). Then:<br>
</blockquote><div> </div></div>Isn't it very unlikely that an image contains a completely opaque layer? Even if you take the exact bounds there could be holes inside the layer.<br>And scanning for the biggest opaque rect could be very slow.<br>