From 87d4a5f27faffd2bdd74a444d39f967ab5aa0e8b Mon Sep 17 00:00:00 2001 From: Kenneth Russel Date: Mon, 18 Feb 2008 08:58:39 +0000 Subject: Added table of Porter-Duff compositing rules in the face of premultiplied alpha based on some code from the Java 2D OpenGL pipeline git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@1535 232f8b59-042b-4e1e-8c03-345bb8c30851 --- .../com/sun/opengl/util/texture/Texture.java | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/classes/com/sun/opengl') diff --git a/src/classes/com/sun/opengl/util/texture/Texture.java b/src/classes/com/sun/opengl/util/texture/Texture.java index d634f66fb..f4a0a8be2 100755 --- a/src/classes/com/sun/opengl/util/texture/Texture.java +++ b/src/classes/com/sun/opengl/util/texture/Texture.java @@ -111,6 +111,28 @@ import com.sun.opengl.util.texture.spi.*; float b = b * a; gl.glColor4f(r, g, b, a); + * + * For reference, here is a list of the Porter-Duff compositing rules + * and the associated OpenGL blend functions (source and destination + * factors) to use in the face of premultiplied alpha: + * +
+ +
Rule Source Dest +
Clear GL_ZERO GL_ZERO +
Src GL_ONE GL_ZERO +
SrcOver GL_ONE GL_ONE_MINUS_SRC_ALPHA +
DstOver GL_ONE_MINUS_DST_ALPHA GL_ONE +
SrcIn GL_DST_ALPHA GL_ZERO +
DstIn GL_ZERO GL_SRC_ALPHA +
SrcOut GL_ONE_MINUS_DST_ALPHA GL_ZERO +
DstOut GL_ZERO GL_ONE_MINUS_SRC_ALPHA +
Dst GL_ZERO GL_ONE +
SrcAtop GL_DST_ALPHA GL_ONE_MINUS_SRC_ALPHA +
DstAtop GL_ONE_MINUS_DST_ALPHA GL_SRC_ALPHA +
AlphaXor GL_ONE_MINUS_DST_ALPHA GL_ONE_MINUS_SRC_ALPHA +
+
* * @author Chris Campbell * @author Kenneth Russell -- cgit v1.2.3