[Gimp-docs] FW: Layer mode Overlay - technical question

Sally C. Barry scbarry at gis.net
Tue Sep 5 06:02:21 PDT 2006


Hello All!

I'm looking at the Layer Modes for the Glossary and one of my references
is the C source code.  I have a question about it which is mainly aimed
at any technically-oriented people (developers) on the list.

In app/composite/composite-generic.c, the comments for the function
gimp_composite_overlay_any_any_any_generic() say:

 * Perform an RGB[A] overlay operation between the pixel sources
 * ctx->A and ctx->B, using the generalised algorithm:
 *
 * D =  A * (B + (2 * B) * (255 - A))

But the code does:

          dest[b] = INT_MULT(src1[b], src1[b] + INT_MULT(2 * src2[b], 255 -
src1[b], tmpM), tmp);

which looks to me like:

 D = A * (A + (2 * B) * (255 - A))

Is this an error in the code, or simply an error in the comment, does
anyone know?

Thank you!

Sally



More information about the Gimp-docs mailing list