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

Emanuele Tamponi emanuele at valinor.it
Tue Mar 25 20:46:51 CET 2008


Il Tuesday 25 March 2008 19:38:30 Cyrille Berger ha scritto:
> Wrong, with my proposal it would be
>
> KisPenOp::paintAt(information)
> {
>     stampDevice = manipulation->createStamp(stampobject, information,
> currentColor); // yes currentColor need to be set at stamp creation
>      bitBlt(stampDevice to canvasDevice);
> }
>
> KisCloneOp::paintAt(information)
> {
>     stampDevice = manipulation->createStamp(stampobject, information,
> sourceDevice); // again no need to copy the source device to the stamp
> device bitBlt(stampDevice to canvasDevice);
> }

That's ok;

> It could even be :
>
> KisDrawingOp::paintAt(information)
> {
>     stampDevice = manipulation->createStamp(stampobject, information,
> colorSource); // again no need to copy the source device to the stamp
> device bitBlt(stampDevice to canvasDevice);
> }
>
> No clone op, no filter op, no brush op, no pencil op. Brush op and pencil
> op are replaced by a KisBrushStamp and KisPencilStamp (like in your
> proposal), clone, filter and plain color happen in the color source.

Well, I'm not sure how you want to realize this with only one paintop; I think 
that a good compromise is to have a paintop per each colorsource:

1) KisDrawingOp calls manipulation->createStamp with the current color as 
colorSource
2) KisCloneOp calls createStamp with the to-be-cloned area as colorSource
3) KisHistoryOp calls createStamp with the history contents
4) etc etc etc

I mean:

KisDrawingOp::paintAt(information)
{
    colorSource = currentColorOrWhatever;
    
    stampDevice = manipulation->createStamp(stampobject, information,
                  colorSource);

    bitBlt(stampDevice to canvasDevice);
}

KisCloneOp::paintAt(information)
{
    colorSource = canvasDevice->area(x,y,w,h);
    
    stampDevice = manipulation->createStamp(stampobject, information,
                  colorSource);

    bitBlt(stampDevice to canvasDevice);
}

KisHistoryOp::paintAt(information)
{
    ...
}


By the way, I really like your idea about mapped features/signals for the 
dynamic paintop!


More information about the kimageshop mailing list