00001 #ifndef TIMEAVG_H 00002 #define TIMEAVG_H 00003 00004 class TimeAvgMain; 00005 00006 #include "bchash.inc" 00007 #include "pluginvclient.h" 00008 #include "timeavgwindow.h" 00009 #include "vframe.inc" 00010 00011 class TimeAvgConfig 00012 { 00013 public: 00014 TimeAvgConfig(); 00015 void copy_from(TimeAvgConfig *src); 00016 int equivalent(TimeAvgConfig *src); 00017 00018 int frames; 00019 int mode; 00020 enum 00021 { 00022 AVERAGE, 00023 ACCUMULATE, 00024 OR 00025 }; 00026 int paranoid; 00027 int nosubtract; 00028 }; 00029 00030 00031 class TimeAvgMain : public PluginVClient 00032 { 00033 public: 00034 TimeAvgMain(PluginServer *server); 00035 ~TimeAvgMain(); 00036 00037 // required for all realtime plugins 00038 int process_buffer(VFrame *frame, 00039 int64_t start_position, 00040 double frame_rate); 00041 int is_realtime(); 00042 char* plugin_title(); 00043 VFrame* new_picon(); 00044 int show_gui(); 00045 int load_configuration(); 00046 int set_string(); 00047 int load_defaults(); 00048 int save_defaults(); 00049 void save_data(KeyFrame *keyframe); 00050 void read_data(KeyFrame *keyframe); 00051 void raise_window(); 00052 void update_gui(); 00053 void clear_accum(int w, int h, int color_model); 00054 void subtract_accum(VFrame *frame); 00055 void add_accum(VFrame *frame); 00056 void transfer_accum(VFrame *frame); 00057 00058 00059 VFrame **history; 00060 // Frame of history in requested samplerate 00061 int64_t *history_frame; 00062 int *history_valid; 00063 unsigned char *accumulation; 00064 00065 // a thread for the GUI 00066 TimeAvgThread *thread; 00067 TimeAvgConfig config; 00068 int history_size; 00069 // Starting frame of history in requested framerate 00070 int64_t history_start; 00071 // When subtraction is disabled, this detects no change for paranoid mode. 00072 int64_t prev_frame; 00073 00074 BC_Hash *defaults; 00075 }; 00076 00077 00078 #endif
1.5.5