composite ops

Boudewijn Rempt boud at valdyas.org
Wed Aug 23 20:56:58 CEST 2006


Bart and I had a little discussion inspired by Ilmari Heikkinen today 
about composite ops. Basically, it would be grand if colorspaces could
 extend the number of composite ops they offer above the ones listed 
in the enumeration of composite ops (e.g., we've got COPY_RED, but not
 COPY_WET or COPY_L). And it would be especially grand if there were a 
plugin system to make extending the number of composite ops more dynamic.

And I think I've got the solution, and one that removes a function call 
and the big case statement from the colorspaces. Something like, in 
pseudo-code:

KisPainter p;
p.begin();
p.setCompositeOp(curColorSpace.getCompositeOp("COPY_WET"); // returns a function pointer
p.bitBlt(dx, ddy, src, sx, sy, sw, sh); // calls the composite function
p.end();

A central compositeop registry can be called by plugins to add a compositeop
to a colorspace; we get rid of the long enum and of the long case statement, in 
favour of a per-colorspace registry of known composite ops (we already have
virtual KisCompositeOpList userVisiblecompositeOps() const;). Of course, most
composite will not be in plugins. But it's nice to have the opportunity.

-- 
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: 191 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/kimageshop/attachments/20060823/a23897f2/attachment.pgp 


More information about the kimageshop mailing list