Filters and selections

Boudewijn Rempt boud at valdyas.org
Fri Jan 7 10:11:54 CET 2005


On Friday 07 January 2005 10:05, Michael Thaler wrote:
> Hi,
>
> right now, if a part of an image is selected, the filters still work on the
> whole image (I actually only tried it with the gaussian blur and the invert
> filter). I suppose, the filters should only be applied to the selected
> region.

That's right.

> If I have some time tonight, I would like to change one of the filters
> (maybe the invert, it is probably the easiest one), so that it does respect
> selections. The easiest solution would probably to use the
> iteratorPixelSelectionBegin iterators. Do they actually work? Or is there
> another way to do this?

I think so, Cyrille was working on making the iterators 'obey' the selections, 
but wanted to first wait for Casper's low-level iterators.

> Another thing comes to mind: for non-rectangular selections, applying
> filters might not work because you often need the neighbour pixels. So it
> would be fine if there would be a method to get the smallest rectangular
> region covered by a selection, apply the filter to that and then replace
> the selected area. Or is there a better way?

I think that would work. You'd need the smallest rectangle containig the 
selection for more things, for instance in order to determine the spread of a 
gradient. However, even if there's a method to get the selected rect, it's 
not good. I cannot seem to come up with an algorithm to determine accurately 
the smallest rect around a selection.

-- 
Boudewijn Rempt 
http://www.valdyas.org/fading/index.cgi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/kimageshop/attachments/20050107/146c68ce/attachment.pgp


More information about the kimageshop mailing list