00001 #ifndef EFFECTTV_H 00002 #define EFFECTTV_H 00003 00004 #include "plugincolors.inc" 00005 #include "vframe.inc" 00006 #include <stdint.h> 00007 00008 // Environment for EffectTV effects 00009 class EffectTV 00010 { 00011 public: 00012 EffectTV(int w, int h); 00013 virtual ~EffectTV(); 00014 00015 void image_set_threshold_y(int threshold); 00016 unsigned char* image_bgsubtract_update_y(unsigned char **input_rows, 00017 unsigned char **output_rows, 00018 int color_model); 00019 unsigned char* image_bgsubtract_y(unsigned char **input_rows, int color_model); 00020 void image_bgset_y(VFrame *frame); 00021 unsigned char* image_diff_filter(unsigned char *diff); 00022 00023 int yuv_init(); 00024 static void frame_to_effecttv(VFrame *frame, uint32_t *tmp); 00025 static void effecttv_to_frame(VFrame *frame, uint32_t *tmp); 00026 00027 /* 00028 * fastrand - fast fake random number generator 00029 * Warning: The low-order bits of numbers generated by fastrand() 00030 * are bad as random numbers. For example, fastrand()%4 00031 * generates 1,2,3,0,1,2,3,0... 00032 * You should use high-order bits. 00033 */ 00034 static unsigned int fastrand_val; 00035 00036 static inline unsigned int fastrand() 00037 { 00038 return (fastrand_val = fastrand_val * 1103515245 + 12345); 00039 }; 00040 00041 int w; 00042 int h; 00043 00044 int y_threshold; 00045 00046 unsigned char *background; 00047 unsigned char *diff, *diff2; 00048 00049 int YtoRGB[0x100]; 00050 int VtoR[0x100]; 00051 int VtoG[0x100]; 00052 int UtoG[0x100]; 00053 int UtoB[0x100]; 00054 int RtoY[0x100]; 00055 int RtoU[0x100]; 00056 int RtoV[0x100]; 00057 int GtoY[0x100]; 00058 int GtoU[0x100]; 00059 int GtoV[0x100]; 00060 int BtoY[0x100]; 00061 int BtoV[0x100]; 00062 YUV *yuv; 00063 }; 00064 00065 00066 #endif
1.5.5