[animation] Move the alpha value to floating point
The current Alpha value is an unsigned integer that can be used implicitly as a fixed point value. This makes writing an alpha function overshooting below and above the current range basically impossible without complicating an already complex code, and creating weird corner cases. For this reason, the Alpha value should be defined as a floating point normalized value, spanning a range between 0.0 and 1.0; in order to allow overshooting, the valid range is extended one unit below and one unit above, thus making it -1.0 .. 2.0. This commit updates the various users of the ClutterAlpha API and the tests cases. This commit also removes all the current alpha functions exposed in the public API.
This commit is contained in:
@ -528,30 +528,8 @@ static const struct
|
||||
ClutterAlphaFunc symbol;
|
||||
} clutter_alphas[] = {
|
||||
#define ALPHA_FUNC(func,nick) { #func, nick, func }
|
||||
ALPHA_FUNC (clutter_ramp_inc_func, "ramp-inc"),
|
||||
ALPHA_FUNC (clutter_ramp_dec_func, "ramp-dec"),
|
||||
ALPHA_FUNC (clutter_ramp_func, "ramp"),
|
||||
ALPHA_FUNC (clutter_sine_inc_func, "sine-inc"),
|
||||
ALPHA_FUNC (clutter_sine_dec_func, "sine-dec"),
|
||||
ALPHA_FUNC (clutter_sine_half_func, "sine-half"),
|
||||
ALPHA_FUNC (clutter_sine_in_func, "sine-in"),
|
||||
ALPHA_FUNC (clutter_sine_out_func, "sine-out"),
|
||||
ALPHA_FUNC (clutter_sine_in_out_func, "sine-in-out"),
|
||||
ALPHA_FUNC (clutter_sine_func, "sine"),
|
||||
ALPHA_FUNC (clutter_square_func, "square"),
|
||||
ALPHA_FUNC (clutter_smoothstep_inc_func, "smoothstep-inc"),
|
||||
ALPHA_FUNC (clutter_smoothstep_dec_func, "smoothstep-dec"),
|
||||
ALPHA_FUNC (clutter_exp_inc_func, "exp-inc"),
|
||||
ALPHA_FUNC (clutter_exp_dec_func, "exp-dec"),
|
||||
ALPHA_FUNC (clutter_ramp_inc_func, "linear"),
|
||||
ALPHA_FUNC (clutter_ease_in_func, "ease-in"),
|
||||
ALPHA_FUNC (clutter_ease_out_func, "ease-out"),
|
||||
ALPHA_FUNC (clutter_ease_in_out_func, "ease-in-out"),
|
||||
ALPHA_FUNC (clutter_exp_in_func, "exp-in"),
|
||||
ALPHA_FUNC (clutter_exp_out_func, "exp-out"),
|
||||
ALPHA_FUNC (clutter_exp_in_out_func, "exp-in-out"),
|
||||
ALPHA_FUNC (clutter_smoothstep_inc_func, "smooth-in-out")
|
||||
#undef ALPHA_FUNC
|
||||
{ NULL, NULL, NULL }
|
||||
};
|
||||
|
||||
static const gint n_clutter_alphas = G_N_ELEMENTS (clutter_alphas);
|
||||
|
Reference in New Issue
Block a user