Consecutive Convolutions

Ed . schumifer at
Sun Dec 27 19:35:54 CET 2009

Could you elaborate what you are doing to crash Krita when painting on the mask?

Date: Sun, 27 Dec 2009 14:08:02 +0300
Subject: Re: Consecutive Convolutions
From: dimula73 at
To: kimageshop at

Well, i seem to have fixed this. Please update.

There are some crashes when you paint on the mask, i'm investigating this.

A couple of comments about the pacth:
1) There is no need to make a copy of a source device as convolution will do this for you one more time. I mean first line should be:

KisPaintDeviceSP interm = new KisPaintDevice(src->colorSpace());

2) Shared pointers shouldn't be delete'ed. This may cause a crash =)
Final working version of the 'if':

if ( (horizontalRadius > 0) && (verticalRadius > 0) )
        KisPaintDeviceSP interm = new KisPaintDevice(src->colorSpace());

        KisConvolutionKernelSP kernelHoriz = KisConvolutionKernel::fromMatrix(horizGaussian, 0, horizGaussian.sum());

        KisConvolutionKernelSP kernelVertical = KisConvolutionKernel::fromMatrix(verticalGaussian, 0, verticalGaussian.sum());

        KisConvolutionPainter horizPainter(interm, dstInfo.selection());
        horizPainter.applyMatrix(kernelHoriz, src, srcTopLeft, srcTopLeft, size, BORDER_REPEAT);

        KisConvolutionPainter verticalPainter(dst, dstInfo.selection());
        verticalPainter.applyMatrix(kernelVertical, interm, srcTopLeft, dstTopLeft, size, BORDER_REPEAT);


Dmitry Kazakov
Windows Live Hotmail: Your friends can get your Facebook updates, right from Hotmail®.
-------------- next part --------------
An HTML attachment was scrubbed...

More information about the kimageshop mailing list