com.threerings.opengl.effect
Class ColorFunction.ThreePoint

java.lang.Object
  extended by com.threerings.util.DeepObject
      extended by com.threerings.opengl.effect.ColorFunction
          extended by com.threerings.opengl.effect.ColorFunction.ThreePoint
All Implemented Interfaces:
Exportable, com.threerings.io.Streamable, Copyable, Cloneable
Enclosing class:
ColorFunction

public static class ColorFunction.ThreePoint
extends ColorFunction

A color function that blends linearly from a start color to a middle color, then to an end color.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.threerings.opengl.effect.ColorFunction
ColorFunction.Constant, ColorFunction.InAndOut, ColorFunction.Linear, ColorFunction.Multipoint, ColorFunction.ThreePoint
 
Nested classes/interfaces inherited from interface com.threerings.io.Streamable
com.threerings.io.Streamable.Closure
 
Field Summary
 Color4f end
          The end color.
 float in
          The proportional time to spend blending into the middle color.
 Color4f middle
          The middle color.
 float out
          The proportional time to spend blending into the end color.
 Color4f start
          The starting color.
 
Constructor Summary
ColorFunction.ThreePoint()
          No-arg constructor for deserialization, etc.
ColorFunction.ThreePoint(ColorFunction.InAndOut function)
          Creates a three point function with the other function's parameters.
ColorFunction.ThreePoint(ColorFunction function)
          Creates a three point function with the other function's start, middle, and end.
 
Method Summary
 ColorFunction copy(ColorFunction result)
          Copies this function.
 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
 

Field Detail

start

@Editable(mode="%INHERIT%")
public Color4f start
The starting color.


middle

@Editable(mode="%INHERIT%")
public Color4f middle
The middle color.


end

@Editable(mode="%INHERIT%")
public Color4f end
The end color.


in

@Editable(min=0.0,
          max=1.0,
          step=0.01)
public float in
The proportional time to spend blending into the middle color.


out

@Editable(min=0.0,
          max=1.0,
          step=0.01)
public float out
The proportional time to spend blending into the end color.

Constructor Detail

ColorFunction.ThreePoint

public ColorFunction.ThreePoint(ColorFunction function)
Creates a three point function with the other function's start, middle, and end.


ColorFunction.ThreePoint

public ColorFunction.ThreePoint(ColorFunction.InAndOut function)
Creates a three point function with the other function's parameters.


ColorFunction.ThreePoint

public ColorFunction.ThreePoint()
No-arg constructor for deserialization, etc.

Method Detail

getValue

public Color4f getValue(float t,
                        Color4f result)
Description copied from class: ColorFunction
Computes the value at the specified time.

Specified by:
getValue in class ColorFunction
Returns:
a reference to the result color, for chaining.

copy

public ColorFunction copy(ColorFunction result)
Description copied from class: ColorFunction
Copies this function.

Specified by:
copy in class ColorFunction
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.