koffice/krita/image
Boudewijn Rempt
boud at valdyas.org
Fri Oct 2 14:30:05 CEST 2009
On Friday 02 October 2009, you wrote:
> SVN commit 1030020 by rempt:
>
> fix convolution based filters and masks
>
> M +6 -1 kis_mask.cc
>
>
> --- trunk/koffice/krita/image/kis_mask.cc #1030019:1030020
> @@ -111,8 +111,13 @@
> KisPaintDeviceSP cacheDevice =
> new KisPaintDevice(projection->colorSpace());
>
> + // some filters only write out selected or affected pixels to dst,
> so copy
> + KisPainter p1(cacheDevice);
> +
> p1.setCompositeOp(cacheDevice->colorSpace()->compositeOp(COMPOSITE_COPY));
> + p1.bitBlt(rc.topLeft(), projection, rc);
> + p1.end();
> +
> KisPainter gc(projection);
> - //gc.beginTransaction("");
> QRect updatedRect = decorateRect(projection, cacheDevice, rc);
>
> /**
>
I'll cc the the mailing list, since this is a broader issue.
> Could you explain me how does this change help blur filter?
Not really, maybe Cyrille can -- it's something to do with the convolution
painter.
> The point is, we can't do a bitBlt() here as needRect of the filter might
> be much bigger than actual rc, given to this function. Actual needRect is
> calculated in KisLayer::updateProjection and is know only there.
Maybe it's better to have it in kis_filter_mask instead? For now it's
unfortunately needed, and I think a refactor of this thing should wait until
2.2.
> Why does a filter needs a destination device to be prepared? Doesn't it
> mean that the filter reads source information from it?
Not necessarily, the reason why the dst device needs to be a copy of the src
device is that not all filters copy all pixels, even the ones they don't
touch, to the dst device.
--
Boudewijn Rempt | http://www.valdyas.org
More information about the kimageshop
mailing list