[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-kimageshop
Subject:    Re: Patch: don't save tiles that are equal to the default tile
From:       Dmitry Kazakov <dimula73 () gmail ! com>
Date:       2010-03-16 16:03:43
Message-ID: ae32c1ef1003160903t3c6c7e4dna4c2b0da0d7f1faf () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


On Tue, Mar 16, 2010 at 6:42 PM, Cyrille Berger <cberger@cberger.net> wrote:

> On Tuesday 16 March 2010, Dmitry Kazakov wrote:
> > Selections and cutting should use KisDataManager::clear(), through
> > KisPaintDevice::fill() [1]. This method uses tiles to fill the rect and
> > substitutes default tile, if the fill-pixel is default.
> Should really the data manager knows about selection ? Or maybe we could
> call
> a data manager function to tell it check that area for "default" tiles.
>

Of course it should know nothing! ;) At least not more than we agreed during
filter api discussion.
Selections even don't need the access to datamanager. The only thing they
need:

KisPaintDevice::fill(color, rect)
KisPaintDevice::setDefaultPixel(color)
KisPaintDevice::defaultPixel()
KisPaintDevice::region() [not implemented yet]

Changing the default pixel to e.g. QColor(255,255,255) would create an
infinite selection. And selectedRect() will start to return image->bounds()
instead of empty rect.

Changing the default pixel to QColor(0,0,0) will select nothing by default.

Calling fill() will just select/deselect a rect.

region() is what we were discussing on sprint.

Why do you think data manager should know anything?



>
> > The eraser tool can use clear() too.
> That is starting to be difficult, since it is done through the eraser
> composite
> op (that you can anyway select with any paintop...) But that would be
> marginal, main problem is cutting.
>
yeah...

Well, maybe this deleting default tiles can be useful in some rare
circumstances, but i think this feature should be done at the different
level. It should be something like: KisTileHashTable::purge(). And we
needn't call it every time we save an image, as it is too expensive.


-- 
Dmitry Kazakov

[Attachment #5 (text/html)]

<br><br><div class="gmail_quote">On Tue, Mar 16, 2010 at 6:42 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="border-left: 1px solid rgb(204, 204, \
204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> <div class="im">On Tuesday 16 \
March 2010, Dmitry Kazakov wrote:<br> </div><div class="im">&gt; Selections and \
cutting should use KisDataManager::clear(), through<br> &gt; KisPaintDevice::fill() \
[1]. This method uses tiles to fill the rect and<br> &gt; substitutes default tile, \
if the fill-pixel is default.<br> </div>Should really the data manager knows about \
selection ? Or maybe we could call<br> a data manager function to tell it check that \
area for &quot;default&quot; tiles.<br></blockquote><div><br>Of course it should know \
nothing! ;) At least not more than we agreed during filter api \
discussion.<br>Selections even don&#39;t need the access to datamanager. The only \
thing they need:<br> <br>KisPaintDevice::fill(color, \
rect)<br>KisPaintDevice::setDefaultPixel(color)<br>KisPaintDevice::defaultPixel()<br>KisPaintDevice::region() \
[not implemented yet]<br><br>Changing the default pixel to e.g. QColor(255,255,255) \
would create an infinite selection. And selectedRect() will start to return \
image-&gt;bounds() instead of empty rect.<br> <br>Changing the default pixel to \
QColor(0,0,0) will select nothing by default.<br><br>Calling fill() will just \
select/deselect a rect.<br><br>region() is what we were discussing on \
sprint.<br><br>Why do you think data manager should know anything?<br> <br>  \
</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, \
204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> <div class="im"><br>
&gt; The eraser tool can use clear() too.<br>
</div>That is starting to be difficult, since it is done through the eraser \
composite<br> op (that you can anyway select with any paintop...) But that would \
be<br> marginal, main problem is cutting.<br>
</blockquote></div>yeah...<br><br>Well, maybe this deleting default tiles can be \
useful in some rare circumstances, but i think this feature should be done at the \
different level. It should be something like: KisTileHashTable::purge(). And we \
needn&#39;t call it every time we save an image, as it is too expensive.<br> <br \
clear="all"><br>-- <br>Dmitry Kazakov<br>



_______________________________________________
kimageshop mailing list
kimageshop@kde.org
https://mail.kde.org/mailman/listinfo/kimageshop


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic