org.jrabbit.base.graphics
Class GLSettings.Blend

java.lang.Object
  extended by org.jrabbit.base.graphics.GLSettings.Blend
Enclosing class:
GLSettings

public static class GLSettings.Blend
extends java.lang.Object

A static class containing some methods to set the default blending functions.

Author:
Chris Molini

Constructor Summary
GLSettings.Blend()
           
 
Method Summary
static void additive()
          Sets additive blending.
static void colorMask(boolean red, boolean green, boolean blue, boolean alpha)
          Defines the OpenGL color mask.
static void normal()
          Sets normal blending.
static void overlay()
          Sets overlay blending.
static void premultiplied()
          Sets blending to work with premultiplied alpha images.
static void replace()
          Sets replacement blending.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GLSettings.Blend

public GLSettings.Blend()
Method Detail

normal

public static void normal()
Sets normal blending.

See Also:
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)

replace

public static void replace()
Sets replacement blending.

See Also:
glBlendFunc(GL_ONE, GL_ZERO)

additive

public static void additive()
Sets additive blending.

See Also:
glBlendFunc(GL_SRC_ALPHA, GL_ONE)

overlay

public static void overlay()
Sets overlay blending. NOTE: This does not work well without premultiplied alpha images. It is safe to use with completely opaque images, but using alpha becomes difficult.

See Also:
glBlendFunc(GL_DST_COLOR, GL_ONE_MINUS_SRC_ALPHA)

premultiplied

public static void premultiplied()
Sets blending to work with premultiplied alpha images. Don't use it with images that are not premultiplied alpha.

See Also:
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA)

colorMask

public static void colorMask(boolean red,
                             boolean green,
                             boolean blue,
                             boolean alpha)
Defines the OpenGL color mask. This flags which color channels can be altered in rendering.

Parameters:
red - Whether or not to allow changes to the red channel.
green - Whether or not to allow changes to the green channel.
blue - Whether or not to allow changes to the blue channel.
alpha - Whether or not to allow changes to the alpha channel.