4 * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 // the simplest plugin possible
26 // Sharpen leaves the last line too bright
29 #define MAXSHARPNESS 100
31 #include "condition.inc"
33 #include "pluginvclient.h"
34 #include "sharpenwindow.h"
36 #include <sys/types.h>
45 void copy_from(SharpenConfig &that);
46 int equivalent(SharpenConfig &that);
47 void reset(int clear);
48 void interpolate(SharpenConfig &prev,
62 class SharpenMain : public PluginVClient
65 SharpenMain(PluginServer *server);
68 // required for all realtime plugins
69 PLUGIN_CLASS_MEMBERS(SharpenConfig)
70 int process_realtime(VFrame *input_ptr, VFrame *output_ptr);
73 void save_data(KeyFrame *keyframe);
74 void read_data(KeyFrame *keyframe);
76 // parameters needed for sharpness
79 int pos_lut[0x10000], neg_lut[0x10000];
80 VFrame *output, *input;
83 int get_luts(int *pos_lut, int *neg_lut, int color_model);
84 SharpenEngine **engine;
89 class SharpenEngine : public Thread
92 SharpenEngine(SharpenMain *plugin);
95 int start_process_frame(VFrame *output, VFrame *input, int field);
96 int wait_process_frame();
99 void filter(int components,
107 void filter(int components,
115 void filter(int components,
125 void filter_888(int w,
131 void filter_8888(int w,
137 void filter_161616(int w,
143 void filter_16161616(int w,
157 float calculate_pos(float value);
158 float calculate_neg(float value);
163 VFrame *output, *input;
165 Condition *input_lock, *output_lock;
166 unsigned char *src_rows[4], *dst_row;
167 unsigned char *neg_rows[4];
168 float sharpness_coef;