2 * EffecTV - Realtime Digital Video Effector
3 * Copyright (C) 2001-2006 FUKUCHI Kentaro
5 * utils.h: header file for utils
14 typedef uint32_t RGB32
;
16 /* DEFINE's by nullset@dookie.net */
17 #define RED(n) ((n>>16) & 0x000000FF)
18 #define GREEN(n) ((n>>8) & 0x000000FF)
19 #define BLUE(n) ((n>>0) & 0x000000FF)
20 #define RGB(r,g,b) ((0<<24) + (r<<16) + (g <<8) + (b))
21 #define INTENSITY(n) ( ( (RED(n)+GREEN(n)+BLUE(n))/3))
24 void HSItoRGB(double H
, double S
, double I
, int *r
, int *g
, int *b
);
27 extern unsigned int fastrand_val
;
28 #define inline_fastrand() (fastrand_val=fastrand_val*1103515245+12345)
30 unsigned int fastrand(void);
31 void fastsrand(unsigned int);
34 int image_set_threshold_y(int threshold
);
35 void image_bgset_y(RGB32
*background
, const RGB32
*src
, int video_area
, int y_threshold
);
36 void image_bgsubtract_y(unsigned char *diff
, const RGB32
*background
, const RGB32
*src
, int video_area
, int y_threshold
);
37 void image_bgsubtract_update_y(unsigned char *diff
, RGB32
*background
, const RGB32
*src
, int video_area
, int y_threshold
);
38 RGB32
image_set_threshold_RGB(int r
, int g
, int b
);
39 void image_bgset_RGB(RGB32
*background
, const RGB32
*src
, int video_area
);
40 void image_bgsubtract_RGB(unsigned char *diff
, const RGB32
*background
, const RGB32
*src
, int video_area
, RGB32 rgb_threshold
);
41 void image_bgsubtract_update_RGB(unsigned char *diff
, RGB32
*background
, const RGB32
*src
, int video_area
, RGB32 rgb_threshold
);
42 void image_diff_filter(unsigned char *diff2
, const unsigned char *diff
, int width
, int height
);
43 void image_y_over(unsigned char *diff
, const RGB32
*src
, int video_area
, int y_threshold
);
44 void image_y_under(unsigned char *diff
, const RGB32
*src
, int video_area
, int y_threshold
);
45 void image_edge(unsigned char *diff2
, const RGB32
*src
, int width
, int height
, int y_threshold
);
46 void image_hflip(const RGB32
*src
, RGB32
*dest
, int width
, int height
);
48 #endif /* __UTILS_H__ */