00001 #ifndef SELTEMPAVG_H
00002 #define SELTEMPAVG_H
00003
00004 class SelTempAvgMain;
00005
00006 #include "bchash.inc"
00007 #include "pluginvclient.h"
00008 #include "seltempavgwindow.h"
00009 #include "vframe.inc"
00010
00011 class SelTempAvgConfig
00012 {
00013 public:
00014 SelTempAvgConfig();
00015 void copy_from(SelTempAvgConfig *src);
00016 int equivalent(SelTempAvgConfig *src);
00017
00018 int frames;
00019
00020 float avg_threshold_RY, avg_threshold_GU, avg_threshold_BV;
00021 float std_threshold_RY, std_threshold_GU, std_threshold_BV;
00022 int mask_RY, mask_GU, mask_BV;
00023
00024 int method;
00025 enum
00026 {
00027 METHOD_NONE,
00028 METHOD_SELTEMPAVG,
00029 METHOD_AVERAGE,
00030 METHOD_STDDEV
00031 };
00032
00033 int offsetmode;
00034 enum
00035 {
00036 OFFSETMODE_FIXED,
00037 OFFSETMODE_RESTARTMARKERSYS
00038 };
00039
00040
00041 int paranoid;
00042 int nosubtract;
00043 int offset_restartmarker_keyframe;
00044 int offset_fixed_value;
00045 float gain;
00046
00047 };
00048
00049
00050 class SelTempAvgMain : public PluginVClient
00051 {
00052 public:
00053 SelTempAvgMain(PluginServer *server);
00054 ~SelTempAvgMain();
00055
00056
00057 int process_buffer(VFrame *frame, int64_t start_position, double frame_rate);
00058 int is_realtime();
00059 char* plugin_title();
00060 VFrame* new_picon();
00061 int show_gui();
00062 int load_configuration();
00063 int set_string();
00064 int load_defaults();
00065 int save_defaults();
00066 void save_data(KeyFrame *keyframe);
00067 void read_data(KeyFrame *keyframe);
00068 int nextkeyframeisoffsetrestart(KeyFrame *keyframe);
00069 void raise_window();
00070 void update_gui();
00071 void clear_accum(int w, int h, int color_model);
00072 void subtract_accum(VFrame *frame);
00073 void add_accum(VFrame *frame);
00074 void transfer_accum(VFrame *frame);
00075
00076 int64_t restartoffset;
00077 int onakeyframe;
00078
00079 char string[64];
00080
00081 VFrame **history;
00082
00083
00084 int64_t *history_frame;
00085 int *history_valid;
00086 unsigned char *accumulation;
00087 unsigned char *accumulation_sq;
00088 unsigned char *accumulation_grey;
00089
00090
00091 SelTempAvgThread *thread;
00092 SelTempAvgConfig config;
00093 int history_size;
00094
00095 int64_t history_start;
00096
00097 int64_t prev_frame;
00098
00099 BC_Hash *defaults;
00100 };
00101
00102
00103 #endif