Consecutive Convolutions
Dmitry Kazakov
dimula73 at gmail.com
Sun Dec 27 12:08:02 CET 2009
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/kimageshop/attachments/20091227/e70fb424/attachment.htm
More information about the kimageshop
mailing list