4 // the simplest plugin possible
5 // Sharpen leaves the last line too bright
8 #define MAXSHARPNESS 100
10 #include "condition.inc"
12 #include "pluginvclient.h"
13 #include "sharpenwindow.h"
15 #include <sys/types.h>
24 void copy_from(SharpenConfig
&that
);
25 int equivalent(SharpenConfig
&that
);
26 void interpolate(SharpenConfig
&prev
,
40 class SharpenMain
: public PluginVClient
43 SharpenMain(PluginServer
*server
);
46 // required for all realtime plugins
47 int process_realtime(VFrame
*input_ptr
, VFrame
*output_ptr
);
54 int load_configuration();
55 void save_data(KeyFrame
*keyframe
);
56 void read_data(KeyFrame
*keyframe
);
61 // parameters needed for sharpness
64 // a thread for the GUI
65 SharpenThread
*thread
;
66 int pos_lut
[0x10000], neg_lut
[0x10000];
68 VFrame
*output
, *input
;
71 int get_luts(int *pos_lut
, int *neg_lut
, int color_model
);
73 SharpenEngine
**engine
;
78 class SharpenEngine
: public Thread
81 SharpenEngine(SharpenMain
*plugin
);
84 int start_process_frame(VFrame
*output
, VFrame
*input
, int field
);
85 int wait_process_frame();
88 void filter(int components
,
96 void filter(int components
,
104 void filter(int components
,
114 void filter_888(int w
,
120 void filter_8888(int w
,
126 void filter_161616(int w
,
132 void filter_16161616(int w
,
146 float calculate_pos(float value
);
147 float calculate_neg(float value
);
152 VFrame
*output
, *input
;
154 Condition
*input_lock
, *output_lock
;
155 unsigned char *src_rows
[4], *dst_row
;
156 unsigned char *neg_rows
[4];
157 float sharpness_coef
;