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

maxon::Data
Definition: datatypebase.h:1086
iferr_return
#define iferr_return
Definition: resultbase.h:1434
maxon::Data::Get
Result< typename std::conditional< GetCollectionKind< T >::value==COLLECTION_KIND::ARRAY, T, typename ByValueParam< T >::type >::type > Get() const
Definition: datatypebase.h:1291
maxon::Float
Float64 Float
Definition: apibase.h:193
maxon::BaseArray
Definition: basearray.h:366
DiagnosticOutput
#define DiagnosticOutput(formatString,...)
Definition: debugdiagnostics.h:168
maxon::BaseArray::Append
MAXON_ATTRIBUTE_FORCE_INLINE ResultRef< T > Append()
Definition: basearray.h:569
maxon::Int
Int64 Int
signed 32/64 bit int, size depends on the platform
Definition: apibase.h:184
maxon::BaseArray::EnsureCapacity
ResultMem EnsureCapacity(Int requestedCapacity, COLLECTION_RESIZE_FLAGS resizeFlags=COLLECTION_RESIZE_FLAGS::ON_GROW_RESERVE_CAPACITY)
Definition: basearray.h:1188