BlendFunctionInterface Manual

内容表

关于

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); maxon::BaseArray<maxon::Float> values; 值。 EnsureCapacity (count) iferr_return ;

// 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 ; 值。 Append (value) iferr_return ; pos += step; } DiagnosticOutput ( "@" , values);

延伸阅读

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

Copyright  © 2014-2025 乐数软件    

工业和信息化部: 粤ICP备14079481号-1