TINMAN 3D / REALTIME TERRAIN
Software Development Kit - User Manual

class ColorRampBase in Tinman.Terrain.Util

Abstract base class for IColorRamp implementations.

abstract class ColorRampBase implements IColorRamp
  extends SerializableBase
  base of ColorRamp

Configuration

ToConfig

Returns the configuration value that describes this object.

public abstract method ToConfig ()
type ConfigValue
returns [not-null] The configuration value.
implements IConfigurable.ToConfig

Remarks:

All configurable objects need to implement this interface. For simple types, it is preferable to delegate to ToValue.

The returned value may be of type Invalid, which means that this object in its current state cannot be described with the configuration API.

Before returning the resulting configuration value, Cache must be called on it, passing this IConfigurable object as parameter.

Public / Attributes

Range

Returns the coordinate range of this color ramp.

public abstract property Range { get }
type RangeD
value The coordinate range.
implements IColorRamp.Range

SerialType

Returns the serial type of this object.

public property SerialType { get }
type ISerialTypeInfo
value [not-null] The serial type.
inherited SerializableBase.SerialType

SerialVersion

Returns the serial data version.

public virtual property SerialVersion { get }
type int32
value [>=1] The serial data version tag.
inherited SerializableBase.SerialVersion

Remarks:

An ISerializable implementation is required to support all versions up to the one returned by SerialVersion.

See also:

ISerializable.Serialize
ISerializable.Deserialize

Public / Methods

Deserialize

Initializes the state of this object from the given data stream.

public virtual method Deserialize (int32 serialVersion, ISerializer data)
type ISerializable
params serialVersion [>=1] The serial data version.
  data [not-null] The serial data stream.
returns [not-null] The deserialized object. This will typically be this, but in some circumstances, another instance may be returned (e.g. singletons).
inherited SerializableBase.Deserialize

Remarks:

The Deserialize method will be called immediately after the object has been instantiated via its default constructor.

The provided serialVersion number is guaranteed to be equal to or less than the SerialVersion returned by this object (i.e. ISerializable object must provide backwards compatibility).

See also:

ISerializable.Serialize
ISerializable.SerialVersion

Equals

Compares this object with the given one.

[Pure]
public abstract method Equals (IColorRamp other)
type bool
params other The object to compare to.
returns true if this object is equal to other, false if not.
implements IEquatable.Equals

Get

Returns an interpolated color on this color ramp.

public abstract method Get (float64 x)
type int64
params x Coordinate of color to return.
returns The color value.
implements IColorRamp.Get

Index

Returns a color index on this color ramp.

public abstract method Index (float64 x)
type float64
params x Coordinate of color to return.
returns The color index.
implements IColorRamp.Index

Modulate

Modulates the colors in this color ramp.

public virtual method Modulate (int64 color)
type IColorRamp
params color The color to modulate with.
returns [not-null] The resulting color ramp.
implements IColorRamp.Modulate

Serialize

Serializes the current state of this object to the given data stream.

public virtual method Serialize (ISerializer data)
params data [not-null] The serial data stream.
inherited SerializableBase.Serialize

See also:

ISerializable.Deserialize
ISerializable.SerialVersion

Transform

Transforms the input coordinate of this color ramp.

public virtual method Transform (float64 offset, float64 scale = 1)
type IColorRamp
params offset Offset value to add to scaled input X-coordinates.
  scale Scale factor to apply to input X-coordinates. Defaults to 1.
returns [not-null] The resulting color ramp.
implements IColorRamp.Transform

Remarks:

Input X-coordinates are transformed as follows:

xOut = offset + scale * xIn
xIn  = (xOut - offset) / scale
     = xOut / scale - offset / scale
where xIn refers to the coordinate passed to the returned color ramp and xOut is the coordinate that is passed to this color ramp.

Protected / Constructors

ColorRampBase

Creates a new instance of ColorRampBase.

protected constructor ColorRampBase (ISerialTypeInfo serialType)
params serialType [not-null] The serial ID.