00001 #ifndef QUARK_H
00002 #define QUARK_H
00003
00004 class QuarkMain;
00005 #define MAXSHARPNESS 100
00006
00007 #include "bchash.h"
00008 #include "mutex.h"
00009 #include "pluginvclient.h"
00010 #include "quarkwindow.h"
00011
00012 #include <sys/types.h>
00013
00014
00015
00016 class QuarkEngine : public Thread
00017 {
00018 public:
00019 QuarkEngine(QuarkMain *plugin);
00020 ~QuarkEngine();
00021
00022 int start_process_frame(VFrame *output, VFrame *input, int row1, int row2);
00023 int wait_process_frame();
00024 void run();
00025
00026 void filter(int components,
00027 int wordsize,
00028 int vmax,
00029 int w,
00030 unsigned char *src,
00031 unsigned char *dst,
00032 int *neg0,
00033 int *neg1,
00034 int *neg2);
00035 void filter(int components,
00036 int wordsize,
00037 int vmax,
00038 int w,
00039 u_int16_t *src,
00040 u_int16_t *dst,
00041 int *neg0,
00042 int *neg1,
00043 int *neg2);
00044
00045
00046 void filter_888(int w,
00047 unsigned char *src,
00048 unsigned char *dst,
00049 int *neg0,
00050 int *neg1,
00051 int *neg2);
00052 void filter_8888(int w,
00053 unsigned char *src,
00054 unsigned char *dst,
00055 int *neg0,
00056 int *neg1,
00057 int *neg2);
00058 void filter_161616(int w,
00059 u_int16_t *src,
00060 u_int16_t *dst,
00061 int *neg0,
00062 int *neg1,
00063 int *neg2);
00064 void filter_16161616(int w,
00065 u_int16_t *src,
00066 u_int16_t *dst,
00067 int *neg0,
00068 int *neg1,
00069 int *neg2);
00070
00071 void sharpen_888();
00072 void sharpen_161616();
00073 void sharpen_8888();
00074 void sharpen_16161616();
00075
00076 int filter(int w,
00077 unsigned char *src,
00078 unsigned char *dst,
00079 int *neg0,
00080 int *neg1,
00081 int *neg2);
00082
00083 QuarkMain *plugin;
00084 int field;
00085 VFrame *output, *input;
00086 int last_frame;
00087 Mutex input_lock, output_lock;
00088 unsigned char *src_rows[4], *dst_row;
00089 int *neg_rows[4];
00090 int row1, row2;
00091 };
00092
00093 class QuarkMain : public PluginVClient
00094 {
00095 public:
00096 QuarkMain(PluginServer *server);
00097 ~QuarkMain();
00098
00099
00100 int process_realtime(VFrame *input_ptr, VFrame *output_ptr);
00101 int is_realtime();
00102 char* plugin_title();
00103 int show_gui();
00104 void raise_window();
00105 int set_string();
00106 void load_configuration();
00107 void save_data(KeyFrame *keyframe);
00108 void read_data(KeyFrame *keyframe);
00109 int load_defaults();
00110 int save_defaults();
00111 VFrame* new_picon();
00112
00113
00114 float sharpness;
00115 float last_sharpness;
00116 int interlace;
00117 int horizontal;
00118 int row_step;
00119 int luminance;
00120
00121
00122 QuarkThread *thread;
00123 int pos_lut[0x10000], neg_lut[0x10000];
00124
00125 private:
00126 int get_luts(int *pos_lut, int *neg_lut, int color_model);
00127 BC_Hash *defaults;
00128 QuarkEngine **engine;
00129 int total_engines;
00130 };
00131
00132 #endif