2 * EffecTV - Realtime Digital Video Effector
3 * Copyright (C) 2001-2006 FUKUCHI Kentaro
13 * HSI color system utilities
15 static int itrunc(double f
)
25 void HSItoRGB(double H
, double S
, double I
, int *r
, int *g
, int *b
)
29 Rv
=1+S
*sin(H
-2*M_PI
/3);
31 Bv
=1+S
*sin(H
+2*M_PI
/3);
39 * fastrand - fast fake random number generator
40 * Warning: The low-order bits of numbers generated by fastrand()
41 * are bad as random numbers. For example, fastrand()%4
42 * generates 1,2,3,0,1,2,3,0...
43 * You should use high-order bits.
48 unsigned int fastrand_val
;
50 unsigned int fastrand(void)
52 return (fastrand_val
=fastrand_val
*1103515245+12345);
55 void fastsrand(unsigned int seed
)