diff options
author | Kenneth Russel <[email protected]> | 2008-02-18 08:58:39 +0000 |
---|---|---|
committer | Kenneth Russel <[email protected]> | 2008-02-18 08:58:39 +0000 |
commit | 87d4a5f27faffd2bdd74a444d39f967ab5aa0e8b (patch) | |
tree | ef45811ebd69acff36ebff5aa80955b6b8d2b31a /src/classes/com/sun/opengl | |
parent | c57463e795d02f234e85bc2075fd81b29887ccbf (diff) |
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
Diffstat (limited to 'src/classes/com/sun/opengl')
-rwxr-xr-x | src/classes/com/sun/opengl/util/texture/Texture.java | 22 |
1 files changed, 22 insertions, 0 deletions
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 @@ -112,6 +112,28 @@ import com.sun.opengl.util.texture.spi.*; gl.glColor4f(r, g, b, a); </pre> * + * 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: + * +<CENTER> +<TABLE WIDTH="75%"> +<TR> <TD> Rule <TD> Source <TD> Dest +<TR> <TD> Clear <TD> GL_ZERO <TD> GL_ZERO +<TR> <TD> Src <TD> GL_ONE <TD> GL_ZERO +<TR> <TD> SrcOver <TD> GL_ONE <TD> GL_ONE_MINUS_SRC_ALPHA +<TR> <TD> DstOver <TD> GL_ONE_MINUS_DST_ALPHA <TD> GL_ONE +<TR> <TD> SrcIn <TD> GL_DST_ALPHA <TD> GL_ZERO +<TR> <TD> DstIn <TD> GL_ZERO <TD> GL_SRC_ALPHA +<TR> <TD> SrcOut <TD> GL_ONE_MINUS_DST_ALPHA <TD> GL_ZERO +<TR> <TD> DstOut <TD> GL_ZERO <TD> GL_ONE_MINUS_SRC_ALPHA +<TR> <TD> Dst <TD> GL_ZERO <TD> GL_ONE +<TR> <TD> SrcAtop <TD> GL_DST_ALPHA <TD> GL_ONE_MINUS_SRC_ALPHA +<TR> <TD> DstAtop <TD> GL_ONE_MINUS_DST_ALPHA <TD> GL_SRC_ALPHA +<TR> <TD> AlphaXor <TD> GL_ONE_MINUS_DST_ALPHA <TD> GL_ONE_MINUS_SRC_ALPHA +</TABLE> +</CENTER> + * * @author Chris Campbell * @author Kenneth Russell */ |