Walkers pt.2

Dmitry Kazakov dimula73 at gmail.com
Fri Jan 8 14:52:11 CET 2010


Hi, All!

I've been working on the system which will merge layers, taking into account
all the needRects and changeRects. And here is the first (well, second =) )
preliminary result for you consideration.

WARNING: this patchset does not replaces current merge mechanism yet! More
than that IT BREAKS THE ONE!
At the moment walkers are working inside isolated tests only, not in Krita
itself.

(i won't be able to code for 4-5 days due to exam so i decided to publish it
unfinished and listen to some opinions :) )


Ok, what is done:
KisGraphWalker and KisMergeWalker - are classes for performing a loop
through all the layers and collecting all the needed information for merge.
The most important information is stored in KisMergeWalker::m_mergeTask. It
consists of a structures describing a layer and a rect we need from it. This
structure stores the position of the layer inside a stack as well. The
positions can be:
N_NORMAL - the layer is filthy or lays above filthy node
N_LOWER - the leyer lays below filthy node
N_TOPMOST - the highest layer of the group layer's childs
N_BOTTOMMOST - the lowest layer of the group layer's childs

These two classes are splitted by the task they do: KisGraphWalker just
iterates through nodes while KisMergeWalker does actual work - it collects
rects.

After execution of KisMergeWalker::collectRects the walker will have all
needed information for a merge. This information will be given to
KisAsyncMerger.
The Merger will iterate reversely through the stack and merge the image.


How to test this:
There are two unit-tests written. One for walkers and another one for
merger.
You can see them here:
krita/image/tests/kis_graph_walker_test.cpp
krita/image/tests/kis_async_merger_test.cpp


The thing i'm most unsure is naming of the classes.

If you have any ideas or comments - you are welcome!

-- 
Dmitry Kazakov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/kimageshop/attachments/20100108/624e9f82/attachment-0001.htm 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: walkers_preliminary_patchset.tgz
Type: application/x-gzip
Size: 18183 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/kimageshop/attachments/20100108/624e9f82/attachment-0001.gz 


More information about the kimageshop mailing list