Footprint algorithms: in the stamp, or in the paintop?

Cyrille Berger cberger at cberger.net
Wed Mar 26 11:26:57 CET 2008


On Wednesday 26 March 2008, Emanuele Tamponi wrote:
> To make things a little clearer, I'll make here the point that we are come
> to - if I got it correctly. I'll try to use pseudo-code since it looks like
> it's the better way to explain things :)
>
> !."A line of code is worth one thousand words".!
Especially for geeks :D (and we all speak better C++ than english ;p )

> 1) Stamp calculation is separated from paintops (this is true for natural
> brushes too):
>
> KisBrushManipulator::createStamp(stampObject,colorSource,pointerData)
> {
>    [ manipulate the stampObject to obtain the final brush stamp ];
>    return manipulatedStampObject;
> }
>
> KisPencilManipulator::createStamp(stampObject,colorSource,pointerData)
> {
>    [ manipulate the stampObject to obtain the final pencil stamp ];
>    return manipulatedStampObject;
> }

Maybe you mean something else than me by Pencil, but for me (and it's the 
current Krita vocabulary), a Pencil is nothing more than a Brush with integer 
precision, so whatever can manipulate a Brush can manipulate a Pencil.

> KisNaturalManipulator::createStamp(stampObject,colorSource,pointerData)
> {
>    [ manipulate the stampObject to obtain the final natural-looking stamp
> ]; return manipulatedStampObject;
> }
>
> 2) A nice UI will let the user select the "current" manipulator: being it a
> brush, a pencil, a natural brush or an image of a pepper.
I guess from this that for you a Brush in an AutoBrush ?

> 3) KisPaintOps can - *if they want* - use the current stamp (but there will
> be paintops that don't need a stamp at all, if you can imagine them):
indeed.

> 4) I'd like to point out that this integrates perfectly both with current
> code and with boud's work (if I understand correctly), because we can use
> preset to have a "currentManipulator" depending on the paintop preset used.
yup. And I will just have to rework the dynamic brush in beeing a provider of 
more fancy manipulator.

On a side node, the curve settings from Bart would go into the manipulator.

> 5) Another thing I want to point out is what I mean as "stamp": this can be
> what we currently call in krita tree a "KisBrush", but it could eventually
> come to another set of classes: the important thing is that this "stamp" is
> the footprint upon which the paintop will behave. It has a shape, a size, a
> position, an hotspot, can have color(s) on it, whatever: but the shape,
> size and position of the stamp has to be "retrieved" by the paintop, using
> a "current" manipulator, so it's not dependant on the paintop (except for
> the use of paintop presets).

Agree.

> In my very honest opinion, I don't think this is a great difference from
> what we have currently, nor it's is from what you have planned.

Indeed, as far as I can see, it's merely about providing some convenient 
functions to the paintop.

-- 
Cyrille Berger


More information about the kimageshop mailing list