com.threerings.opengl.effect
Enum AlphaMode

java.lang.Object
  extended by java.lang.Enum<AlphaMode>
      extended by com.threerings.opengl.effect.AlphaMode
All Implemented Interfaces:
Serializable, Comparable<AlphaMode>

public enum AlphaMode
extends Enum<AlphaMode>

The alpha mode, which determines how to convert colors to premultiplied alpha format.


Enum Constant Summary
ADDITIVE
          Multiply by alpha and set alpha to zero.
OPAQUE
          Multiply by alpha and set alpha to one.
PREMULTIPLIED
          Leave everything unchanged.
TRANSLUCENT
          Multiply by alpha and leave alpha unchanged.
 
Method Summary
abstract  Color4f apply(Color4f color)
          Applies the computed color's alpha according to this mode's rules.
static AlphaMode valueOf(String name)
          Returns the enum constant of this type with the specified name.
static AlphaMode[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

OPAQUE

public static final AlphaMode OPAQUE
Multiply by alpha and set alpha to one.


TRANSLUCENT

public static final AlphaMode TRANSLUCENT
Multiply by alpha and leave alpha unchanged.


ADDITIVE

public static final AlphaMode ADDITIVE
Multiply by alpha and set alpha to zero.


PREMULTIPLIED

public static final AlphaMode PREMULTIPLIED
Leave everything unchanged.

Method Detail

values

public static AlphaMode[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (AlphaMode c : AlphaMode.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static AlphaMode valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

apply

public abstract Color4f apply(Color4f color)
Applies the computed color's alpha according to this mode's rules.

Returns:
a reference to the color, for chaining.


Copyright © 2011. All Rights Reserved.