Summer of Code

Boudewijn Rempt boud at valdyas.org
Fri Mar 21 09:40:33 CET 2008


On Thursday 20 March 2008, David Herman wrote:
> On Thursday 20 March 2008, Matthew Woehlke wrote:
> > Matthew Woehlke wrote:
> > > Valerie wrote:
> > >> That said, here's an alternate point of view, an interface
> > >> proposal from someone who has no idea how the underlying
> > >> algorithmics work: [snip]
>
> ------------snip---------
>
> > ...this would be where I decide I should read Boudewijn's thread
> > on the subject first :-). (So... will we be able to paint filters
> > with a bristle brush or airbrush? ;-) )
>
> Actually that was a feature of photogenics on the amiga that I
> always hoped to see developed more fully (in krita). I've just
> never gotten around to asking if it was possible.

Well, painting with filters has been possible for ages. I haven't been able to 
run Photogenics for a long time (it used to work on Linux, but as a binary 
only package it broke ages ago). 

However, we do have an architectural issue here. Krita is designed like this:

KisTool: determines the begin and the end point point of a line that will be 
painted:

KisPaintOp: brush engine: completely determines what actually happens between 
the begin and th end that KisTool told KisPaintOp to paint.

The key here is "completely". It is impossible to constrain what KisPaintOp 
does. It needn't even use the composite op or opacity setting in the tool's 
option widget.

Painting with filters is implemented as a KisPaintOp that uses KisBrush 
derived classes to determine the mask that will be filtered. That means that 
all the other paintops cannot be used to determine the mask that will be 
filtered -- they stand next to each other. It would be easy enough to extend 
KisFilterOp::KisPaintOp with code that determines the mask in another way but 
quite hard to make it use other paintops to determine the mask. The real 
trick here is circularity: if the filter op uses the the dynamic paintop to 
determine the footprint, but the active program for the dynamic paintop uses 
the filter paintop, we're stuffed.

There's another possibility and that is to replace the filter paintop with a 
filter composite op (or blending mode), but that only works for paintops that 
actually use composite ops -- which is not necessarily all of them.


-- 
Boudewijn Rempt 
http://www.valdyas.org/fading/index.cgi



More information about the kimageshop mailing list