class TColorGradient

template<class COLOR, class TIME>

Common templated class for different color gradient implementations.

Public

Constructors

TColorGradient<COLOR, TIME>

TColorGradient<COLOR, TIME>() = default

TColorGradient<COLOR, TIME>

TColorGradient<COLOR, TIME>(const Color &color)

TColorGradient<COLOR, TIME>

TColorGradient<COLOR, TIME>(const Vector<ColorGradientKey> &keys)

Methods

Evaluate

COLOR Evaluate(float t) const

Evaluates a color at the specified .

SetKeys

void SetKeys(const Vector<ColorGradientKey> &keys, float duration = 1.F)

Keys that control the gradient, sorted by time from first to last.

Key times should be in range [0, 1].

GetKeys

Vector<ColorGradientKey> GetKeys() const

GetNumKeys

u32 GetNumKeys() const

Returns the number of color keys in the gradient.

GetKey

ColorGradientKey GetKey(u32 index) const

Returns the color key at the specified index.

If out of range an empty key is returned.

SetConstant

void SetConstant(const Color &color)

Specify a "gradient" that represents a single color value.

GetDuration

float GetDuration() const

Returns the duration over which the gradient values are interpolated over.

Corresponds to the time value of the final keyframe.

GetTimeRange

std::pair<float, float> GetTimeRange() const

Returns the time of the first and last keyframe in the gradient.

Operators

operator==

bool operator==(const TColorGradient<COLOR, TIME> &rhs) const

operator!=

bool operator!=(const TColorGradient<COLOR, TIME> &rhs) const

Protected

Fields

mColors

COLOR[8] mColors

mTimes

TIME[8] mTimes

mNumKeys

uint32_t mNumKeys

mDuration

float mDuration