Consecutive Convolutions

Ed . schumifer at hotmail.com
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 gmail.com
To: kimageshop at kde.org

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®.
http://www.microsoft.com/middleeast/windows/windowslive/see-it-in-action/social-network-basics.aspx?ocid=PID23461::T:WLMTAGL:ON:WL:en-xm:SI_SB_4:092009
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/kimageshop/attachments/20091227/80bb4f9e/attachment.htm 


More information about the kimageshop mailing list