BlendFunctionInterface Manual

About

The maxon::BlendFunctionInterface is a simple interface that allows to blend between a minimum and maximum value. Various implementations for different interpolation modes exist.

Classes

Various implementations of maxon::BlendFunctionInterface can be found under maxon::BlendFunctions:

Linear interpolation:

  • maxon::BlendFunctions::Linear

Quadratic interpolation:

  • maxon::BlendFunctions::EaseInQuad
  • maxon::BlendFunctions::EaseOutQuad
  • maxon::BlendFunctions::EaseInOutQuad
  • maxon::BlendFunctions::EaseOutInQuad

Cubic interpolation:

  • maxon::BlendFunctions::EaseInCubic
  • maxon::BlendFunctions::EaseOutCubic
  • maxon::BlendFunctions::EaseInOutCubic
  • maxon::BlendFunctions::EaseOutInCubic

Quartic interpolation:

  • maxon::BlendFunctions::EaseInQuart
  • maxon::BlendFunctions::EaseOutQuart
  • maxon::BlendFunctions::EaseInOutQuart
  • maxon::BlendFunctions::EaseOutInQuart

Quintic interpolation:

  • maxon::BlendFunctions::EaseInQuint
  • maxon::BlendFunctions::EaseOutQuint
  • maxon::BlendFunctions::EaseInOutQuint
  • maxon::BlendFunctions::EaseOutInQuint

Sextic interpolation:

  • maxon::BlendFunctions::EaseInSext
  • maxon::BlendFunctions::EaseOutSext
  • maxon::BlendFunctions::EaseInOutSext
  • maxon::BlendFunctions::EaseOutInSext

Sinusoidal interpolation:

  • maxon::BlendFunctions::EaseInSine
  • maxon::BlendFunctions::EaseOutSine
  • maxon::BlendFunctions::EaseInOutSine
  • maxon::BlendFunctions::EaseOutInSine

Exponential interpolation:

  • maxon::BlendFunctions::EaseInExpo
  • maxon::BlendFunctions::EaseOutExpo
  • maxon::BlendFunctions::EaseInOutExpo
  • maxon::BlendFunctions::EaseOutInExpo

Circular interpolation:

  • maxon::BlendFunctions::EaseInCirc
  • maxon::BlendFunctions::EaseOutCirc
  • maxon::BlendFunctions::EaseInOutCirc
  • maxon::BlendFunctions::EaseOutInCirc

Elastic interpolation:

  • maxon::BlendFunctions::EaseInElastic
  • maxon::BlendFunctions::EaseOutElastic
  • maxon::BlendFunctions::EaseInOutElastic
  • maxon::BlendFunctions::EaseOutInElastic

Back interpolation:

  • maxon::BlendFunctions::EaseInBack
  • maxon::BlendFunctions::EaseOutBack
  • maxon::BlendFunctions::EaseInOutBack
  • maxon::BlendFunctions::EaseOutInBack

Bounce interpolation:

  • maxon::BlendFunctions::EaseInBounce
  • maxon::BlendFunctions::EaseOutBounce
  • maxon::BlendFunctions::EaseInOutBounce
  • maxon::BlendFunctions::EaseOutInBounce

BlendFunctionInterface

The function represented by maxon::BlendFunctionInterface is used with:

// This example samples the interpolation curve defined by the given blend function.
// get BlendFunctionRef for EaseInOutQuad
const maxon::BlendFunctionRef& easeInOut = maxon::BlendFunctions::EaseInOutQuad();
// prepare sampling the function
const maxon::Float step = 1.0 / maxon::Float(count);
maxon::Float pos = 0.0;
const maxon::Data min(0.0);
const maxon::Data max(10.0);
// sample the function
for (maxon::Int i = 0; i < count; ++i)
{
const maxon::Data res = easeInOut.MapValue(pos, min, max) iferr_return;
const maxon::Float value = res.Get<maxon::Float>() iferr_return;
values.Append(value) iferr_return;
pos += step;
}
DiagnosticOutput("@", values);

Further Reading