mirror of
https://github.com/brl/mutter.git
synced 2025-01-03 16:22:15 +00:00
added clutter_sine_half_func()
This commit is contained in:
parent
9a10979e0f
commit
06bf2ddaef
@ -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>
|
2007-05-16 Tomas Frydrych <tf@openedhand.com>
|
||||||
|
|
||||||
* clutter/clutter-alpha.h:
|
* clutter/clutter-alpha.h:
|
||||||
|
@ -666,6 +666,40 @@ clutter_sine_dec_func (ClutterAlpha *alpha,
|
|||||||
return CFX_INT (sine);
|
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:
|
* clutter_square_func:
|
||||||
* @alpha: a #ClutterAlpha
|
* @alpha: a #ClutterAlpha
|
||||||
|
@ -108,6 +108,7 @@ ClutterTimeline *clutter_alpha_get_timeline (ClutterAlpha *alpha);
|
|||||||
#define CLUTTER_ALPHA_SINE clutter_sine_func
|
#define CLUTTER_ALPHA_SINE clutter_sine_func
|
||||||
#define CLUTTER_ALPHA_SINE_INC clutter_sine_inc_func
|
#define CLUTTER_ALPHA_SINE_INC clutter_sine_inc_func
|
||||||
#define CLUTTER_ALPHA_SINE_DEC clutter_sine_dec_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_SQUARE clutter_square_func
|
||||||
#define CLUTTER_ALPHA_SMOOTHSTEP clutter_smoothstep_func
|
#define CLUTTER_ALPHA_SMOOTHSTEP clutter_smoothstep_func
|
||||||
|
|
||||||
@ -137,6 +138,8 @@ guint32 clutter_sine_inc_func (ClutterAlpha *alpha,
|
|||||||
gpointer dummy);
|
gpointer dummy);
|
||||||
guint32 clutter_sine_dec_func (ClutterAlpha *alpha,
|
guint32 clutter_sine_dec_func (ClutterAlpha *alpha,
|
||||||
gpointer dummy);
|
gpointer dummy);
|
||||||
|
guint32 clutter_sine_half_func (ClutterAlpha *alpha,
|
||||||
|
gpointer dummy);
|
||||||
guint32 clutter_square_func (ClutterAlpha *alpha,
|
guint32 clutter_square_func (ClutterAlpha *alpha,
|
||||||
gpointer dummy);
|
gpointer dummy);
|
||||||
guint32 clutter_smoothstep_func (ClutterAlpha *alpha,
|
guint32 clutter_smoothstep_func (ClutterAlpha *alpha,
|
||||||
|
@ -116,6 +116,8 @@ CLUTTER_ALPHA_SINE_INC
|
|||||||
clutter_sine_inc_func
|
clutter_sine_inc_func
|
||||||
CLUTTER_ALPHA_SINE_DEC
|
CLUTTER_ALPHA_SINE_DEC
|
||||||
clutter_sine_dec_func
|
clutter_sine_dec_func
|
||||||
|
CLUTTER_ALPHA_SINE_HALF
|
||||||
|
clutter_sine_half_func
|
||||||
CLUTTER_ALPHA_SQUARE
|
CLUTTER_ALPHA_SQUARE
|
||||||
clutter_square_func
|
clutter_square_func
|
||||||
CLUTTER_ALPHA_SMOOTHSTEP
|
CLUTTER_ALPHA_SMOOTHSTEP
|
||||||
|
Loading…
Reference in New Issue
Block a user