Consecutive Convolutions

Dmitry Kazakov dimula73 at gmail.com
Sun Dec 27 19:54:05 CET 2009


I'll commit a workaround tonight.

Just create a blur mask and paint on the layer with a brush with a diameter
smaller than 2*width of a kernel.
The first applyMatrix will return an empty paintDevice, and the second
applyMatrix will crash because of empty interm->extent().


On Sun, Dec 27, 2009 at 9:35 PM, Ed . <schumifer at hotmail.com> wrote:

>  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>
>
> _______________________________________________
> kimageshop mailing list
> kimageshop at kde.org
> https://mail.kde.org/mailman/listinfo/kimageshop
>
>


-- 
Dmitry Kazakov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/kimageshop/attachments/20091227/268ad9c8/attachment.htm 


More information about the kimageshop mailing list