00001 #ifndef HISTOGRAM_H
00002 #define HISTOGRAM_H
00003
00004
00005 #include "histogram.inc"
00006 #include "histogramconfig.h"
00007 #include "histogramwindow.inc"
00008 #include "loadbalance.h"
00009 #include "plugincolors.h"
00010 #include "pluginvclient.h"
00011
00012
00013 class HistogramMain : public PluginVClient
00014 {
00015 public:
00016 HistogramMain(PluginServer *server);
00017 ~HistogramMain();
00018
00019 int process_buffer(VFrame *frame,
00020 int64_t start_position,
00021 double frame_rate);
00022 int is_realtime();
00023 int load_defaults();
00024 int save_defaults();
00025 void save_data(KeyFrame *keyframe);
00026 void read_data(KeyFrame *keyframe);
00027 void update_gui();
00028 void render_gui(void *data);
00029 int calculate_use_opengl();
00030 int handle_opengl();
00031
00032 PLUGIN_CLASS_MEMBERS(HistogramConfig, HistogramThread)
00033
00034
00035 float calculate_linear(float input, int mode, int do_value);
00036 float calculate_smooth(float input, int subscript);
00037
00038 float calculate_curve(float input);
00039
00040 void calculate_automatic(VFrame *data);
00041
00042
00043 void calculate_histogram(VFrame *data, int do_value);
00044
00045 void tabulate_curve(int subscript, int use_value);
00046
00047
00048
00049
00050 YUV yuv;
00051 VFrame *input, *output;
00052 HistogramEngine *engine;
00053 int *lookup[HISTOGRAM_MODES];
00054 float *smoothed[HISTOGRAM_MODES];
00055 float *linear[HISTOGRAM_MODES];
00056
00057 int *preview_lookup[HISTOGRAM_MODES];
00058 int *accum[HISTOGRAM_MODES];
00059
00060 int current_point;
00061
00062 int mode;
00063 int dragging_point;
00064 int point_x_offset;
00065 int point_y_offset;
00066 };
00067
00068 class HistogramPackage : public LoadPackage
00069 {
00070 public:
00071 HistogramPackage();
00072 int start, end;
00073 };
00074
00075 class HistogramUnit : public LoadClient
00076 {
00077 public:
00078 HistogramUnit(HistogramEngine *server, HistogramMain *plugin);
00079 ~HistogramUnit();
00080 void process_package(LoadPackage *package);
00081 HistogramEngine *server;
00082 HistogramMain *plugin;
00083 int *accum[5];
00084 };
00085
00086 class HistogramEngine : public LoadServer
00087 {
00088 public:
00089 HistogramEngine(HistogramMain *plugin,
00090 int total_clients,
00091 int total_packages);
00092 void process_packages(int operation, VFrame *data, int do_value);
00093 void init_packages();
00094 LoadClient* new_client();
00095 LoadPackage* new_package();
00096 HistogramMain *plugin;
00097 int total_size;
00098
00099
00100 int operation;
00101 enum
00102 {
00103 HISTOGRAM,
00104 APPLY
00105 };
00106 VFrame *data;
00107 int do_value;
00108 };
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120 #endif