-// @todo think about alternative ways of passing around
-struct AlphaFuncStruct
-{
- const char* const name;
- AlphaFunction alphaFunc;
-};
-/**
- * Contains a list of alpha functions that can be used.
- * We use a stl map as lookup to map a string name to the function
- */
-const AlphaFuncStruct AlphaFunctionTable[]=
-{
- {"default" , AlphaFunctions::Default },
- {"linear" , AlphaFunctions::Linear },
- {"square" , AlphaFunctions::Square },
- {"reverse" , AlphaFunctions::Reverse },
- {"easeIn" , AlphaFunctions::EaseIn },
- {"easeOut" , AlphaFunctions::EaseOut },
- {"easeInOut" , AlphaFunctions::EaseInOut },
- {"easeInSine" , AlphaFunctions::EaseInSine },
- {"easeOutSine" , AlphaFunctions::EaseOutSine },
- {"easeInOutSine" , AlphaFunctions::EaseInOutSine },
- {"easeInSine33" , AlphaFunctions::EaseInSine33 },
- {"easeOutSine33" , AlphaFunctions::EaseOutSine33 },
- {"easeInOutSine33" , AlphaFunctions::EaseInOutSine33 },
- {"easeInOutSine50" , AlphaFunctions::EaseInOutSine50 },
- {"easeInOutSine60" , AlphaFunctions::EaseInOutSine60 },
- {"easeInOutSine70" , AlphaFunctions::EaseInOutSine70 },
- {"easeInOutSine80" , AlphaFunctions::EaseInOutSine80 },
- {"easeInOutSine90" , AlphaFunctions::EaseInOutSine90 },
- {"doubleEaseInOutSine60" , AlphaFunctions::DoubleEaseInOutSine60},
- {"easeOutQuint50" , AlphaFunctions::EaseOutQuint50 },
- {"easeOutQuint80" , AlphaFunctions::EaseOutQuint80 },
- {"bounce" , AlphaFunctions::Bounce },
- {"bounceBack" , AlphaFunctions::BounceBack },
- {"easeInBack" , AlphaFunctions::EaseInBack },
- {"easeOutBack" , AlphaFunctions::EaseOutBack },
- {"easeInOutBack" , AlphaFunctions::EaseInOutBack },
- {"sin" , AlphaFunctions::Sin },
- {"sin2x" , AlphaFunctions::Sin2x }
-};
-const unsigned int AlphaFunctionTableCount = sizeof(AlphaFunctionTable)/sizeof(AlphaFunctionTable[0]);
-const char* const DEFAULT_ALPHA_NAME = "default";
-static AlphaFunction DEFAULT_ALPHA_FUNCTION = AlphaFunctions::Default;
-
-
-
-AlphaFunction GetAlphaFunction( const std::string& alphaFuncName )
-{
- // This will normally get called just a few times during the application, so no point in doing anything clever
- for( unsigned int i = 0; i < AlphaFunctionTableCount; i++)
- {
- const AlphaFuncStruct& alphaStruct( AlphaFunctionTable[i] );
-
- if( std::strcmp( alphaStruct.name , alphaFuncName.c_str() ) == 0 )
- {
- return alphaStruct.alphaFunc;
- }
- }
-
- DALI_LOG_ERROR("Failed to find alpha func |%s| \n", alphaFuncName.c_str() );
- return AlphaFunctions::Default;
-}
-
-const char* const GetAlphaFunctionName( AlphaFunction alphaFunc )
-{
- // This may get called 3 times during the application, so no point
- // in doing anything clever
-
- for( unsigned int i = 0; i < AlphaFunctionTableCount; i++)
- {
- const AlphaFuncStruct& alphaStruct( AlphaFunctionTable[i] );
-
-
- if( alphaStruct.alphaFunc == alphaFunc )
- {
- return alphaStruct.name;
- }
- }
- return "default";
-}
-
-