r741: Add 'take from alpha' option for creating timefronts... pretty cool
[cinelerra_cv/mob.git] / plugins / seltempavg / seltempavg.h
blobc37735343e8569536d8a7fb4afaef4f0014fa6bc
1 #ifndef SELTEMPAVG_H
2 #define SELTEMPAVG_H
4 class SelTempAvgMain;
6 #include "defaults.inc"
7 #include "pluginvclient.h"
8 #include "seltempavgwindow.h"
9 #include "vframe.inc"
11 class SelTempAvgConfig
13 public:
14 SelTempAvgConfig();
15 void copy_from(SelTempAvgConfig *src);
16 int equivalent(SelTempAvgConfig *src);
18 int frames;
20 float avg_threshold_RY, avg_threshold_GU, avg_threshold_BV;
21 float std_threshold_RY, std_threshold_GU, std_threshold_BV;
22 int mask_RY, mask_GU, mask_BV;
24 int method;
25 enum
27 METHOD_NONE,
28 METHOD_SELTEMPAVG,
29 METHOD_AVERAGE,
30 METHOD_STDDEV
33 int offsetmode;
34 enum
36 OFFSETMODE_FIXED,
37 OFFSETMODE_RESTARTMARKERSYS
41 int paranoid;
42 int nosubtract;
43 int offset_restartmarker_keyframe;
44 int64_t offset_fixed_value;
45 float gain;
50 class SelTempAvgMain : public PluginVClient
52 public:
53 SelTempAvgMain(PluginServer *server);
54 ~SelTempAvgMain();
56 // required for all realtime plugins
57 int process_buffer(VFrame *frame, int64_t start_position, double frame_rate);
58 int is_realtime();
59 char* plugin_title();
60 VFrame* new_picon();
61 int show_gui();
62 int load_configuration();
63 int set_string();
64 int load_defaults();
65 int save_defaults();
66 void save_data(KeyFrame *keyframe);
67 void read_data(KeyFrame *keyframe);
68 int nextkeyframeisoffsetrestart(KeyFrame *keyframe);
69 void raise_window();
70 void update_gui();
71 void clear_accum(int w, int h, int color_model);
72 void subtract_accum(VFrame *frame);
73 void add_accum(VFrame *frame);
74 void transfer_accum(VFrame *frame);
76 int64_t restartoffset;
77 int onakeyframe;
79 char string[64];
81 VFrame **history;
83 // Frame of history in requested framerate
84 int64_t *history_frame;
85 int *history_valid;
86 unsigned char *accumulation;
87 unsigned char *accumulation_sq;
88 unsigned char *accumulation_grey;
90 // a thread for the GUI
91 SelTempAvgThread *thread;
92 SelTempAvgConfig config;
93 int history_size;
94 // Starting frame of history in requested framerate
95 int64_t history_start;
96 // When subtraction is disabled, this detects no change for paranoid mode.
97 int64_t prev_frame;
99 Defaults *defaults;
103 #endif