Page 1 of 1

Where are the composite formula come from and why so complic

Posted: 2013-12-25T19:36:25-07:00
by clhsieh
Full title: Where are the composite formula come from and why so complicated?

I am trying to implement my own composite program but cannot get the ideal result at the edge of the object until I saw your source code.
The operation like multiply is just mention as A*B in every blending document but in your code it is:

Code: Select all

static  inline MagickRealType Multiply(const MagickRealType Sca,
  const MagickRealType Sa,const MagickRealType Dca,const MagickRealType Da)
{
  return(Sca*Dca+Sca*(1.0-Da)+Dca*(1.0-Sa));
}
Why it will be so complicated? Is there any reason that I can deduce to other operation?

Re: Where are the composite formula come from and why so com

Posted: 2013-12-25T22:25:02-07:00
by snibgo
They come from the SVG Compositing Specification: http://www.w3.org/TR/2009/WD-SVGCompositing-20090430/

Re: Where are the composite formula come from and why so com

Posted: 2013-12-25T22:32:10-07:00
by clhsieh
Thanks, I will test it