29 #ifndef _CEGUITplInterpolators_h_
30 #define _CEGUITplInterpolators_h_
32 #include "CEGUI/Base.h"
33 #include "CEGUI/Interpolator.h"
34 #include "CEGUI/PropertyHelper.h"
84 typename Helper::return_type val1 = Helper::fromString(value1);
85 typename Helper::return_type val2 = Helper::fromString(value2);
87 const T result =
static_cast<const T
>(val1 * (1.0f - position) + val2 * (position));
89 return Helper::toString(result);
98 typename Helper::return_type bas = Helper::fromString(base);
99 typename Helper::return_type val1 = Helper::fromString(value1);
100 typename Helper::return_type val2 = Helper::fromString(value2);
102 const T result =
static_cast<const T
>(bas + (val1 * (1.0f - position) + val2 * (position)));
104 return Helper::toString(result);
113 typename Helper::return_type bas = Helper::fromString(base);
117 const float mul = val1 * (1.0f - position) + val2 * (position);
119 const T result =
static_cast<const T
>(bas * mul);
121 return Helper::toString(result);
150 typename Helper::return_type val1 = Helper::fromString(value1);
151 typename Helper::return_type val2 = Helper::fromString(value2);
153 typename Helper::return_type result = position < 0.5 ? val1 : val2;;
155 return Helper::toString(result);
165 typename Helper::return_type val1 = Helper::fromString(value1);
166 typename Helper::return_type val2 = Helper::fromString(value2);
168 typename Helper::return_type result = position < 0.5 ? val1 : val2;
170 return Helper::toString(result);
179 typename Helper::return_type bas = Helper::fromString(base);
186 return Helper::toString(bas);
217 typename Helper::return_type bas = Helper::fromString(base);
218 typename Helper::return_type val1 = Helper::fromString(value1);
219 typename Helper::return_type val2 = Helper::fromString(value2);
221 typename Helper::return_type result = bas + (position < 0.5 ? val1 : val2);
223 return Helper::toString(result);
229 #endif // end of guard _CEGUITplInterpolators_h_
virtual ~TplDiscreteRelativeInterpolator()
destructor
Definition: TplInterpolators.h:209
virtual ~TplInterpolatorBase()
destructor
Definition: TplInterpolators.h:48
virtual ~TplLinearInterpolator()
destructor
Definition: TplInterpolators.h:77
Main namespace for Crazy Eddie's GUI Library.
Definition: arch_overview.dox:1
virtual const String & getType() const
returns type string of this interpolator
Definition: TplInterpolators.h:51
virtual String interpolateAbsolute(const String &value1, const String &value2, float position)
Definition: TplInterpolators.h:80
Definition: TplInterpolators.h:40
virtual String interpolateRelative(const String &base, const String &value1, const String &value2, float position)
Definition: TplInterpolators.h:212
virtual String interpolateRelativeMultiply(const String &base, const String &value1, const String &value2, float position)
Definition: TplInterpolators.h:108
Generic discrete interpolator class.
Definition: TplInterpolators.h:133
Helper class used to convert various data types to and from the format expected in Property strings...
Definition: ForwardRefs.h:84
virtual ~TplDiscreteInterpolator()
destructor
Definition: TplInterpolators.h:143
virtual String interpolateRelativeMultiply(const String &base, const String &, const String &, float)
Definition: TplInterpolators.h:174
Generic discrete relative interpolator class.
Definition: TplInterpolators.h:199
Defines a 'interpolator' class.
Definition: Interpolator.h:53
virtual String interpolateRelative(const String &, const String &value1, const String &value2, float position)
Definition: TplInterpolators.h:159
virtual String interpolateRelative(const String &base, const String &value1, const String &value2, float position)
Definition: TplInterpolators.h:93
virtual String interpolateAbsolute(const String &value1, const String &value2, float position)
Definition: TplInterpolators.h:146
String class used within the GUI system.
Definition: String.h:62
Generic linear interpolator class.
Definition: TplInterpolators.h:67