krita 1.6 SVN branch: Problems with bumpmap and previewwidget

Schleimer, Ben bensch128 at yahoo.com
Mon Mar 5 12:49:28 CET 2007


--- Boudewijn Rempt <boud at valdyas.org> wrote:

> On Sunday 04 March 2007, Schleimer, Ben wrote:
> > Hi all,
> >   I've been trying to debug the bumpmap filter and make it work again and I
> > started with why the preview didn't show up in the preview dialog. After
> > much playing with ddd, I found that in kis_filter_manager.cc line 352, the
> > original device is set in the preview widget -> creates a scaled
> > previewdevice with m_parentLayer set to NULL.
> > (KisPreviewWidget::zoomChanged line 203) This is a problem because bumpmap
> > filter tries to query src's m_parentLayer for the image it belongs to and
> > the preview device doesn't belong to any layer.
> 
> Is this in 1.6? I've just tried the bumpmap filter and it does preview the 
> bumpmapped image correctly after pressing the button -- the big problem is 
> that the layer names aren't in a combobox but have to be typed in by hand in 
> the bumpmap layer box.

I'm using krita 1.6 from svn and the bumpmap filter definitely does not preview properly if you
are trying to use another layer as the bumpmap image. You can verify this in the code by seeing
that the m_parentlayer is not copied in KisPaintDevice::KisPaintDevice(const KisPaintDevice& rhs)
or in
KisPaintDevice::createThumbnailDevice(Q_INT32 w, Q_INT32 h).

> >
> > The correct solution would be to have the previewwidget build a temporary
> > image from the original, filter that and then scale it down to the preview
> > widgets size during each preview. I talked to BCoppens and he indicated
> > that this is how KisPreviewWidget used to work but was changed because of
> > performance problems. Is there any way to go back to the original behavior
> > and optimize the scaling performance?
> 
> I don't think we ever created a complete scaled down copy of the image stack 
> for the layer preview. But my recollection may be wrong.
> 

Actually, if you want to avoid the cost of doing a scaling operation after evey refresh, then
duplicating and scaling the whole layer would be a valid option. However, it's probably overkill.
Just the scaling needs to be optimized or even better, we don't do any scaling at all but just
clip ala digikam filter preview. That should be the fastest and most reliable.

Cheers
Ben



More information about the kimageshop mailing list