00001 #ifndef LINEARIZE_H
00002 #define LINEARIZE_H
00003
00004 class GammaEngine;
00005 class GammaMain;
00006
00007 #include "gammawindow.h"
00008 #include "loadbalance.h"
00009 #include "plugincolors.h"
00010 #include "guicast.h"
00011 #include "pluginvclient.h"
00012 #include "thread.h"
00013
00014 #define HISTOGRAM_SIZE 256
00015
00016 class GammaConfig
00017 {
00018 public:
00019 GammaConfig();
00020
00021 int equivalent(GammaConfig &that);
00022 void copy_from(GammaConfig &that);
00023 void interpolate(GammaConfig &prev,
00024 GammaConfig &next,
00025 int64_t prev_frame,
00026 int64_t next_frame,
00027 int64_t current_frame);
00028
00029 float max;
00030 float gamma;
00031 int automatic;
00032
00033 int plot;
00034 };
00035
00036 class GammaPackage : public LoadPackage
00037 {
00038 public:
00039 GammaPackage();
00040 int start, end;
00041 };
00042
00043 class GammaUnit : public LoadClient
00044 {
00045 public:
00046 GammaUnit(GammaMain *plugin);
00047 void process_package(LoadPackage *package);
00048 GammaMain *plugin;
00049 int accum[HISTOGRAM_SIZE];
00050 };
00051
00052 class GammaEngine : public LoadServer
00053 {
00054 public:
00055 GammaEngine(GammaMain *plugin);
00056
00057 void process_packages(int operation, VFrame *data);
00058 void init_packages();
00059 LoadClient* new_client();
00060 LoadPackage* new_package();
00061 VFrame *data;
00062 int operation;
00063 enum
00064 {
00065 HISTOGRAM,
00066 APPLY
00067 };
00068 GammaMain *plugin;
00069 int accum[HISTOGRAM_SIZE];
00070 };
00071
00072 class GammaMain : public PluginVClient
00073 {
00074 public:
00075 GammaMain(PluginServer *server);
00076 ~GammaMain();
00077
00078
00079 int process_buffer(VFrame *frame,
00080 int64_t start_position,
00081 double frame_rate);
00082 void calculate_max(VFrame *frame);
00083 int is_realtime();
00084 void update_gui();
00085 void save_data(KeyFrame *keyframe);
00086 void read_data(KeyFrame *keyframe);
00087 int load_defaults();
00088 int save_defaults();
00089 void render_gui(void *data);
00090 int handle_opengl();
00091
00092 GammaEngine *engine;
00093 VFrame *frame;
00094
00095 PLUGIN_CLASS_MEMBERS(GammaConfig, GammaThread)
00096 };
00097
00098
00099
00100 #endif