com.threerings.opengl.effect
Class ColorFunction

java.lang.Object
  extended by com.threerings.util.DeepObject
      extended by com.threerings.opengl.effect.ColorFunction
All Implemented Interfaces:
Exportable, com.threerings.io.Streamable, Copyable, Cloneable
Direct Known Subclasses:
ColorFunction.Constant, ColorFunction.InAndOut, ColorFunction.Linear, ColorFunction.Multipoint, ColorFunction.ThreePoint

@EditorTypes(value={ColorFunction.Constant.class,ColorFunction.Linear.class,ColorFunction.InAndOut.class,ColorFunction.ThreePoint.class,ColorFunction.Multipoint.class})
public abstract class ColorFunction
extends DeepObject
implements Exportable, com.threerings.io.Streamable

Provides a color based on a parameter ranging from 0 to 1.


Nested Class Summary
static class ColorFunction.Constant
          A color function that always returns the same color.
static class ColorFunction.InAndOut
          A color function that blends linearly from a start color to an end color, then back to the start color.
static class ColorFunction.Linear
          A color function that blends linearly between two colors.
static class ColorFunction.Multipoint
          A color function that blends between an arbitrary number of colors.
static class ColorFunction.ThreePoint
          A color function that blends linearly from a start color to a middle color, then to an end color.
 
Nested classes/interfaces inherited from interface com.threerings.io.Streamable
com.threerings.io.Streamable.Closure
 
Constructor Summary
ColorFunction()
           
 
Method Summary
abstract  ColorFunction copy(ColorFunction result)
          Copies this function.
abstract  Color4f getValue(float t, Color4f result)
          Computes the value at the specified time.
 
Methods inherited from class com.threerings.util.DeepObject
clone, copy, copy, equals, hashCode, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ColorFunction

public ColorFunction()
Method Detail

getValue

public abstract Color4f getValue(float t,
                                 Color4f result)
Computes the value at the specified time.

Returns:
a reference to the result color, for chaining.

copy

public abstract ColorFunction copy(ColorFunction result)
Copies this function.

Parameters:
result - an object to repopulate, if possible.
Returns:
either the result object, if it could be repopulated, or a new object containing the result.


Copyright © 2011. All Rights Reserved.