Implementing offset layer operation

Dmitry Kazakov dimula73 at gmail.com
Tue Feb 19 21:35:55 UTC 2013


Hi, Lukas!

Yes, the mirror node action is just not ported to strokes. You need to
implement a processing visitor and then just apply it to the nodes you
need. The processing framework will also allow you to change image
size safely (see parameters for rotate node) and do recursive
application of the action.

On 2/19/13, Lukast dev <lukast.dev at gmail.com> wrote:
> Hello,
>
> I'm trying to implement offset layer operation
> https://bugs.kde.org/show_bug.cgi?id=315367
> In Gimp it is in Layer -> Transform -> Offset
>
> In Krita I want to implement it only with warp mode.
> Other modes in GIMP are combos of move tool + fill tool (filling with
> color or with transparent pixels)
>
> I want to implement it simply, something like mirror layer operation.
> I'm little bit out of sync what is the current status of implementing
> it correctly.
>
> When I look how ROTATE is implemented, it goes like this:
>
> Let's start in ...
> RotateImage::slotRotateLayer() ( rotateimage.cpp ) calls
> KisNodeManager::rotate calls
> KisLayerManager::rotateLayer calls
> KisImage::rotateNode calls
> KisImage::rotateImpl calls
> lot of processing framework related classes, interesting ones are
> KisProcessingApplicator and KisProcessingVisitor
> (KisTransformProcessingVisitor) and calls
> KisProcessingApplicator::applyVisitor
>
> When I look how MIRROR Horizontally is implemented, it goes like this:
>
> KisNodeManager::mirrorNodeX() calls
> KisNodeManager::mirrorNode calls
> KisNode::accept(KisMirrorVisitor) calls
> KisNodeVisitor::visit
>
> Hint: Offset operation is almost like mirror horrizontally operation
> e.g. in GIMP
> it does not transform masks.
>
> I'm not sure if I understand it correctly.
> The ROTATE implementation is way to go? Or MIRROR code is way to go?
> It seems to me that mirror operation is not ported to processing
> framework, is that right?
>
> Best regards,
> Lukas
> _______________________________________________
> kimageshop mailing list
> kimageshop at kde.org
> https://mail.kde.org/mailman/listinfo/kimageshop
>


-- 
Dmitry Kazakov


More information about the kimageshop mailing list