<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
--></style>
</head>
<body class='hmmessage'>
Could you elaborate what you are doing to crash Krita when painting on the mask?<br><br><hr id="stopSpelling">Date: Sun, 27 Dec 2009 14:08:02 +0300<br>Subject: Re: Consecutive Convolutions<br>From: dimula73@gmail.com<br>To: kimageshop@kde.org<br><br>Well, i seem to have fixed this. Please update.<br><br>There are some crashes when you paint on the mask, i'm investigating this.<br><br><br>A couple of comments about the pacth:<br>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:<br>
KisPaintDeviceSP interm = new KisPaintDevice(src-&gt;colorSpace());<br><br>2) Shared pointers shouldn't be delete'ed. This may cause a crash =)<br><br clear="all">Final working version of the 'if':<br><br>
if ( (horizontalRadius &gt; 0) &amp;&amp; (verticalRadius &gt; 0) )<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; KisPaintDeviceSP interm = new KisPaintDevice(src-&gt;colorSpace());<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; KisConvolutionKernelSP kernelHoriz = KisConvolutionKernel::fromMatrix(horizGaussian, 0, horizGaussian.sum());<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; KisConvolutionKernelSP kernelVertical = KisConvolutionKernel::fromMatrix(verticalGaussian, 0, verticalGaussian.sum());<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; KisConvolutionPainter horizPainter(interm, dstInfo.selection());<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; horizPainter.applyMatrix(kernelHoriz, src, srcTopLeft, srcTopLeft, size, BORDER_REPEAT);<br>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; KisConvolutionPainter verticalPainter(dst, dstInfo.selection());<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; verticalPainter.applyMatrix(kernelVertical, interm, srcTopLeft, dstTopLeft, size, BORDER_REPEAT);<br><br>&nbsp;&nbsp;&nbsp; }<br><br><br>-- <br>Dmitry Kazakov<br>                                               <br /><hr />Windows Live Hotmail:  <a href='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' target='_new'>Your friends can get your Facebook updates, right from HotmailŪ.</a></body>
</html>