Phew... I think I've gone a bit mad with the blending modes :D.
I added a few. When counting everything together there should be
nearly 40 compositing modes now.
All modes should trait partly transparent layers as Photoshop is
doing it and all modes should
respect the channel flags.
But there are two problems with this patch:
1. I used a pretty generic approach. So it relies on the compiler to
do proper inlining. And i didn't use the optimized multiply
functions. I had a few problems with those functions, because it
seems the give no correct results but approximations. So I still
need to check out which composite modes will work with the optimized
functions. I just want to say that it could be that this is a
bit/much slower then the current implementation (i don't know how
much time you spend in optimizing this).
I personally haven't noticed any speed impact but I've got a 3GHz
quad core, so i think i will be the last
who will notice this.
2. The "Hue" and "Saturation" modes are not working correctly but
the "Luminosity" and "Color" modes work exactly as in Photoshop. I
coded the algorithms after the ISO 3200-1 spec. Adobe released the
texts they gave to the ISO committee for specification. You can find
them here:
http://www.adobe.com/devnet/pdf.html
http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/PDF32000_2008.pdf
(direct link)
go to the category "Transparency" -> "Basic Composition
Computations". This spec is of course for PDFs but it seems that
Photoshop uses the same formulas.
Since "Luminosity" and "Color" modes are working i think i made some
mistake in implementing the
"setSat" function (on page 327). Maybe someone else has an
enlightenment, because I'm working in the dark right now :D.
But apart from this two problems everything else should work fine
(hopefully).