added clutter_sine_half_func()

This commit is contained in:
Tomas Frydrych 2007-05-16 13:53:39 +00:00
parent 9a10979e0f
commit 06bf2ddaef
4 changed files with 46 additions and 0 deletions

View File

@ -1,3 +1,10 @@
2007-05-16 Tomas Frydrych <tf@openedhand.com>
* clutter/clutter-alpha.h:
* clutter/clutter-alpha.c:
* doc/reference/clutter-sections.txt:
Added clutter_sine_half().
2007-05-16 Tomas Frydrych <tf@openedhand.com>
* clutter/clutter-alpha.h:

View File

@ -666,6 +666,40 @@ clutter_sine_dec_func (ClutterAlpha *alpha,
return CFX_INT (sine);
}
/**
* clutter_sine_half_func:
* @alpha: a #ClutterAlpha
* @dummy: unused argument
*
* Convenience alpha function for a sine wave over interval <0, pi>.
* You can use this function as the alpha function for
* clutter_alpha_set_func().
*
* Return value: an alpha value.
*
* Since: 0.4
*/
guint32
clutter_sine_half_func (ClutterAlpha *alpha,
gpointer dummy)
{
ClutterTimeline * timeline;
gint frame;
gint n_frames;
ClutterAngle x;
ClutterFixed sine;
timeline = clutter_alpha_get_timeline (alpha);
frame = clutter_timeline_get_current_frame (timeline);
n_frames = clutter_timeline_get_n_frames (timeline);
x = 512 * frame / n_frames;
sine = clutter_sini (x) * CLUTTER_ALPHA_MAX_ALPHA;
return CFX_INT (sine);
}
/**
* clutter_square_func:
* @alpha: a #ClutterAlpha

View File

@ -108,6 +108,7 @@ ClutterTimeline *clutter_alpha_get_timeline (ClutterAlpha *alpha);
#define CLUTTER_ALPHA_SINE clutter_sine_func
#define CLUTTER_ALPHA_SINE_INC clutter_sine_inc_func
#define CLUTTER_ALPHA_SINE_DEC clutter_sine_dec_func
#define CLUTTER_ALPHA_SINE_HALF clutter_sine_half_func
#define CLUTTER_ALPHA_SQUARE clutter_square_func
#define CLUTTER_ALPHA_SMOOTHSTEP clutter_smoothstep_func
@ -137,6 +138,8 @@ guint32 clutter_sine_inc_func (ClutterAlpha *alpha,
gpointer dummy);
guint32 clutter_sine_dec_func (ClutterAlpha *alpha,
gpointer dummy);
guint32 clutter_sine_half_func (ClutterAlpha *alpha,
gpointer dummy);
guint32 clutter_square_func (ClutterAlpha *alpha,
gpointer dummy);
guint32 clutter_smoothstep_func (ClutterAlpha *alpha,

View File

@ -116,6 +116,8 @@ CLUTTER_ALPHA_SINE_INC
clutter_sine_inc_func
CLUTTER_ALPHA_SINE_DEC
clutter_sine_dec_func
CLUTTER_ALPHA_SINE_HALF
clutter_sine_half_func
CLUTTER_ALPHA_SQUARE
clutter_square_func
CLUTTER_ALPHA_SMOOTHSTEP