gst-indent
[platform/upstream/gst-plugins-good.git] / gst / goom / goom_tools.h
1 #ifndef _GOOMTOOLS_H
2 #define _GOOMTOOLS_H
3
4 #define NB_RAND 0x10000
5
6 /* in graphic.c */
7 extern int *rand_tab;
8 extern unsigned short rand_pos;
9
10 #define RAND_INIT(i) \
11         srand (i) ;\
12         if (!rand_tab)\
13                 rand_tab = (int *) malloc (NB_RAND * sizeof(int)) ;\
14         rand_pos = 1 ;\
15         while (rand_pos != 0)\
16                 rand_tab [rand_pos++] = rand () ;
17
18 #define RAND()\
19         (rand_tab[rand_pos = rand_pos + 1])
20
21 #define RAND_CLOSE()\
22         free (rand_tab);\
23         rand_tab = 0;
24
25
26 /*#define iRAND(i) ((guint32)((float)i * RAND()/RAND_MAX)) */
27 #define iRAND(i) (RAND()%i)
28
29 #endif