Gaussian filter bounds problems

Ed . schumifer at hotmail.com
Mon May 3 19:46:15 CEST 2010


Hi again,

you have to apply the filter for the edges to become transparent.

Date: Mon, 3 May 2010 10:28:06 +0400
Subject: Gaussian filter bounds problems
From: dimula73 at gmail.com
To: schumifer at hotmail.com
CC: kimageshop at kde.org

Hi, Edward!

I tried to reproduce the bug with png image bounds today and i failed. Everything seems to work with Blur and Gaussian Blur filters added as masks and adjustment layers. Could you describe  how to reproduce it here?



Btw, i found a bug in Gaussian Blur filter. Try to apply it to an image that is bigger than 512x512 pixels. You get a border effect.
The cause is this code, i think:
 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.setChannelFlags(channelFlags);        horizPainter.setProgress(progressUpdater);
        horizPainter.applyMatrix(kernelHoriz, src, srcTopLeft, srcTopLeft, size, BORDER_REPEAT);
        KisConvolutionPainter verticalPainter(dst, dstInfo.selection());        verticalPainter.setChannelFlags(channelFlags);
        verticalPainter.setProgress(progressUpdater);        verticalPainter.applyMatrix(kernelVertical, interm, srcTopLeft, dstTopLeft, size, BORDER_REPEAT);
    }

The problem is, when you convolve the second time, there is no needRect prepared for the convolution. src device has this additional data (it is prepared by walkers), while interm doesn't. I see the only way out in bitBlt'ing src into interm, but this will be very inefficient. Or writing a special RepeatIteratorFactory that might be too complex task...



-- 
Dmitry Kazakov
 		 	   		  
_________________________________________________________________
Hotmail: Powerful Free email with security by Microsoft.
https://signup.live.com/signup.aspx?id=60969
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/kimageshop/attachments/20100503/80f1b465/attachment.htm 


More information about the kimageshop mailing list