Purge underscored header file barriers
[platform/core/uifw/dali-core.git] / dali / internal / event / animation / progress-value.h
index 1022e61..0a7ca11 100644 (file)
@@ -1,8 +1,8 @@
-#ifndef __DALI_INTERNAL_PROGRESS_VALUE_H__
-#define __DALI_INTERNAL_PROGRESS_VALUE_H__
+#ifndef DALI_INTERNAL_PROGRESS_VALUE_H
+#define DALI_INTERNAL_PROGRESS_VALUE_H
 
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  */
 
 // INTERNAL INCLUDES
+#include <dali/public-api/math/angle-axis.h>
 #include <dali/public-api/math/quaternion.h>
+#include <dali/public-api/math/vector2.h>
 #include <dali/public-api/math/vector3.h>
-#include <dali/public-api/math/radian.h>
-#include <dali/public-api/math/degree.h>
+#include <dali/public-api/math/vector4.h>
 
 namespace Dali
 {
@@ -62,30 +63,6 @@ public:
   T mValue;          ///< value this animation channel should take
 };
 
-typedef ProgressValue<Quaternion>                       ProgressQuaternion;
-typedef std::vector<ProgressQuaternion>                 ProgressQuaternionContainer;
-
-typedef ProgressValue<AngleAxis>                        ProgressAngleAxis;
-typedef std::vector<AngleAxis>                          ProgressAngleAxisContainer;
-
-typedef ProgressValue<bool>                             ProgressBoolean;
-typedef std::vector<ProgressBoolean>                    ProgressBooleanContainer;
-
-typedef ProgressValue<float>                            ProgressNumber;
-typedef std::vector<ProgressNumber>                     ProgressNumberContainer;
-
-typedef ProgressValue<int>                              ProgressInteger;
-typedef std::vector<ProgressInteger>                    ProgressIntegerContainer;
-
-typedef ProgressValue<Vector2>                          ProgressVector2;
-typedef std::vector<ProgressVector2>                    ProgressVector2Container;
-
-typedef ProgressValue<Vector3>                          ProgressVector3;
-typedef std::vector<ProgressVector3>                    ProgressVector3Container;
-
-typedef ProgressValue<Vector4>                          ProgressVector4;
-typedef std::vector<ProgressVector4>                    ProgressVector4Container;
-
 inline void Interpolate (Quaternion& result, const Quaternion& a, const Quaternion& b, float progress)
 {
   result = Quaternion::Slerp(a, b, progress);
@@ -106,14 +83,14 @@ inline void Interpolate (bool& result, bool a, bool b, float progress)
   result = progress < 0.5f ? a : b;
 }
 
-inline void Interpolate (float& result, float a, float b, float progress)
+inline void Interpolate (int32_t& result, int a, int b, float progress)
 {
-  result = a + (b-a) * progress;
+  result = static_cast<int>(static_cast<float>( a ) + static_cast<float>(b - a) * progress + 0.5f);
 }
 
-inline void Interpolate (int& result, int a, int b, float progress)
+inline void Interpolate (float& result, float a, float b, float progress)
 {
-  result = static_cast<int>(a + (b - a) * progress + 0.5f);
+  result = a + (b-a) * progress;
 }
 
 inline void Interpolate (Vector2& result, const Vector2& a,  const Vector2& b, float progress)
@@ -138,13 +115,13 @@ inline void Interpolate (Vector4& result, const Vector4& a, const Vector4& b, fl
  * Restrictions: f(0)=p1   f(1)=p2   f'(0)=(p2-p0)*0.5   f'(1)=(p3-p1)*0.5
  */
 
-inline void CubicInterpolate( int& result, int p0, int p1, int p2, int p3, float progress )
+inline void CubicInterpolate( int32_t& result, int32_t p0, int32_t p1, int32_t p2, int32_t p3, float progress )
 {
-  float a3 = p3*0.5f - p2*1.5f + p1*1.5f - p0*0.5f;
-  float a2 = p0 - p1*2.5f + p2*2.0f - p3*0.5f;
-  float a1 = (p2-p0)*0.5f;
+  float a3 = static_cast<float>( p3 ) * 0.5f - static_cast<float>( p2 ) * 1.5f + static_cast<float>( p1 ) * 1.5f - static_cast<float>( p0 ) * 0.5f;
+  float a2 = static_cast<float>( p0 ) - static_cast<float>( p1 ) * 2.5f + static_cast<float>( p2 ) * 2.0f - static_cast<float>( p3 ) * 0.5f;
+  float a1 = static_cast<float>( p2 - p0 ) * 0.5f;
 
-  result = static_cast<int>( a3*progress*progress*progress + a2*progress*progress + a1*progress + p1 + 0.5f );
+  result = static_cast<int>( a3*progress*progress*progress + a2*progress*progress + a1*progress + static_cast<float>( p1 ) + 0.5f );
 }
 
 inline void CubicInterpolate( float& result, float p0, float p1, float  p2, float  p3, float progress )
@@ -202,4 +179,4 @@ inline void CubicInterpolate( AngleAxis& result, const AngleAxis& p0, const Angl
 
 } // namespace Dali
 
-#endif //__DALI_PROGRESS_VALUE_H__
+#endif // DALI_INTERNAL_PROGRESS_VALUE_H