added effectv module with BurningTV filter provided by Stephane Fillod
[melted] / src / modules / effectv / utils.h
1 /*
2 * EffecTV - Realtime Digital Video Effector
3 * Copyright (C) 2001-2006 FUKUCHI Kentaro
4 *
5 * utils.h: header file for utils
6 *
7 */
8
9 #ifndef __UTILS_H__
10 #define __UTILS_H__
11
12 #include <inttypes.h>
13
14 typedef uint32_t RGB32;
15
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))
22
23 /* utils.c */
24 void HSItoRGB(double H, double S, double I, int *r, int *g, int *b);
25
26 extern unsigned int fastrand_val;
27 unsigned int fastrand(void);
28 void fastsrand(unsigned int);
29 #define inline_fastrand() (fastrand_val=fastrand_val*1103515245+12345)
30
31 /* image.c */
32 int image_set_threshold_y(int threshold);
33 void image_bgset_y(RGB32 *background, const RGB32 *src, int video_area, int y_threshold);
34 void image_bgsubtract_y(unsigned char *diff, const RGB32 *background, const RGB32 *src, int video_area, int y_threshold);
35 void image_bgsubtract_update_y(unsigned char *diff, RGB32 *background, const RGB32 *src, int video_area, int y_threshold);
36 RGB32 image_set_threshold_RGB(int r, int g, int b);
37 void image_bgset_RGB(RGB32 *background, const RGB32 *src, int video_area);
38 void image_bgsubtract_RGB(unsigned char *diff, const RGB32 *background, const RGB32 *src, int video_area, RGB32 rgb_threshold);
39 void image_bgsubtract_update_RGB(unsigned char *diff, RGB32 *background, const RGB32 *src, int video_area, RGB32 rgb_threshold);
40 void image_diff_filter(unsigned char *diff2, const unsigned char *diff, int width, int height);
41 void image_y_over(unsigned char *diff, const RGB32 *src, int video_area, int y_threshold);
42 void image_y_under(unsigned char *diff, const RGB32 *src, int video_area, int y_threshold);
43 void image_edge(unsigned char *diff2, const RGB32 *src, int width, int height, int y_threshold);
44 void image_hflip(const RGB32 *src, RGB32 *dest, int width, int height);
45
46 #endif /* __UTILS_H__ */