On Fri, Apr 4, 2008 at 7:05 PM, Emanuele Tamponi &lt;<a href="mailto:emanuele@valinor.it">emanuele@valinor.it</a>&gt; 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 &quot;easy&quot; 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&#39;t want to propose a &quot;substitute&quot;, 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&#39;ll try to explain; as often happens with my explanations, I&#39;m<br>
sure that it will be of almost no use, but still... perhaps with a few images<br>
and some code I&#39;ll be a bit more successful :) Let&#39;s start.<br>
<br>
Consider a multi-layered image as in this picture:<br>
<br>
&lt;picture1&gt;<br>
<br>
Each rect is a layer. When this image is being built, a method finds all<br>
the &quot;simple&quot; (as in not-more-decomponible) regions of the image:<br>
<br>
&lt;picture2&gt;<br>
<br>
In this example, as you see in the picture, there are 4 regions. Each &quot;region<br>
object&quot; 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>&nbsp;</div></div>Isn&#39;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>