For alpha compositing consistency, all layers should affect alpha in the
* app/gegl/gimpoperationadditionmode.c: For alpha compositing consistency, all layers should affect alpha in the same way independent of layer mode. Replace the compositing algorithm with a version without the flaws discovered so far in the previous ones. Don't use it yet though as it requires premultiplied data. svn path=/trunk/; revision=27382
This commit is contained in:
@ -1,3 +1,11 @@
|
||||
2008-10-24 Martin Nordholts <martinn@svn.gnome.org>
|
||||
|
||||
* app/gegl/gimpoperationadditionmode.c: For alpha compositing
|
||||
consistency, all layers should affect alpha in the same way
|
||||
independent of layer mode. Replace the compositing algorithm with
|
||||
a version without the flaws discovered so far in the previous
|
||||
ones. Don't use it yet though as it requires premultiplied data.
|
||||
|
||||
2008-10-24 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* app/paint-funcs/scale-region.c (scale): use the inverse of the
|
||||
|
||||
@ -72,12 +72,21 @@ gimp_operation_addition_mode_process (GeglOperation *operation,
|
||||
while (samples--)
|
||||
{
|
||||
#if 1
|
||||
// Best so far (maybe even correct?)
|
||||
// Wrong, for alpha compositing consistency all layers should
|
||||
// affect alpha in the same way independent of layer mode
|
||||
out[RED] = in[RED] + layer[RED] * layer[ALPHA];
|
||||
out[GREEN] = in[GREEN] + layer[GREEN] * layer[ALPHA];
|
||||
out[BLUE] = in[BLUE] + layer[BLUE] * layer[ALPHA];
|
||||
out[ALPHA] = in[ALPHA];
|
||||
#else
|
||||
// A very nice combination of correctness and speed for
|
||||
// premultiplied data without any of the issues the previous
|
||||
// versions had
|
||||
out[RED] = in[RED] + layer[RED];
|
||||
out[GREEN] = in[GREEN] + layer[GREEN];
|
||||
out[BLUE] = in[BLUE] + layer[BLUE];
|
||||
out[ALPHA] = in[ALPHA] + layer[ALPHA] - in[ALPHA] * layer[ALPHA];
|
||||
|
||||
// Wrong, doesn't take layer opacity of Addition-mode layer into
|
||||
// account
|
||||
out[RED] = in[RED] + layer[RED];
|
||||
|
||||
Reference in New Issue
Block a user