00001 #ifndef AGING_H
00002 #define AGING_H
00003
00004 class AgingMain;
00005 class AgingEngine;
00006
00007 #include "bchash.h"
00008 #include "loadbalance.h"
00009 #include "mutex.h"
00010 #include "pluginvclient.h"
00011 #include "agingwindow.h"
00012 #include <sys/types.h>
00013
00014 #define SCRATCH_MAX 20
00015
00016
00017 typedef struct _scratch
00018 {
00019 int life;
00020 int x;
00021 int dx;
00022 int init;
00023 } scratch_t;
00024
00025 class AgingConfig
00026 {
00027 public:
00028 AgingConfig();
00029
00030 int area_scale;
00031 int aging_mode;
00032 scratch_t scratches[SCRATCH_MAX];
00033
00034 static int dx[8];
00035 static int dy[8];
00036 int dust_interval;
00037
00038
00039 int pits_interval;
00040
00041 int scratch_lines;
00042 int pit_count;
00043 int dust_count;
00044
00045 int colorage;
00046 int scratch;
00047 int pits;
00048 int dust;
00049 };
00050
00051 class AgingPackage : public LoadPackage
00052 {
00053 public:
00054 AgingPackage();
00055
00056 int row1, row2;
00057 };
00058
00059 class AgingServer : public LoadServer
00060 {
00061 public:
00062 AgingServer(AgingMain *plugin, int total_clients, int total_packages);
00063
00064 LoadClient* new_client();
00065 LoadPackage* new_package();
00066 void init_packages();
00067 AgingMain *plugin;
00068 };
00069
00070 class AgingClient : public LoadClient
00071 {
00072 public:
00073 AgingClient(AgingServer *server);
00074
00075 void coloraging(unsigned char **output_ptr,
00076 unsigned char **input_ptr,
00077 int color_model,
00078 int w,
00079 int h);
00080 void scratching(unsigned char **output_ptr,
00081 int color_model,
00082 int w,
00083 int h);
00084 void pits(unsigned char **output_ptr,
00085 int color_model,
00086 int w,
00087 int h);
00088 void dusts(unsigned char **output_ptr,
00089 int color_model,
00090 int w,
00091 int h);
00092 void process_package(LoadPackage *package);
00093
00094 AgingMain *plugin;
00095 };
00096
00097
00098 class AgingMain : public PluginVClient
00099 {
00100 public:
00101 AgingMain(PluginServer *server);
00102 ~AgingMain();
00103
00104
00105 int process_realtime(VFrame *input_ptr, VFrame *output_ptr);
00106 int is_realtime();
00107 char* plugin_title();
00108 int show_gui();
00109 void raise_window();
00110 int set_string();
00111 void load_configuration();
00112 void save_data(KeyFrame *keyframe);
00113 void read_data(KeyFrame *keyframe);
00114
00115 int load_defaults();
00116 int save_defaults();
00117 VFrame* new_picon();
00118
00119
00120 AgingThread *thread;
00121 AgingServer *aging_server;
00122 AgingClient *aging_client;
00123 AgingConfig config;
00124
00125 BC_Hash *defaults;
00126 AgingEngine **engine;
00127 VFrame *input_ptr, *output_ptr;
00128 };
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139 #endif