/*
* CINELERRA
* Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
- *
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
+ *
*/
#include "clip.h"
// threshold = that.threshold;
}
-void DeInterlaceConfig::interpolate(DeInterlaceConfig &prev,
- DeInterlaceConfig &next,
- int64_t prev_frame,
- int64_t next_frame,
+void DeInterlaceConfig::interpolate(DeInterlaceConfig &prev,
+ DeInterlaceConfig &next,
+ int64_t prev_frame,
+ int64_t next_frame,
int64_t current_frame)
{
copy_from(prev);
DeInterlaceMain::DeInterlaceMain(PluginServer *server)
: PluginVClient(server)
{
-
+
// temp = 0;
}
DeInterlaceMain::~DeInterlaceMain()
{
-
+
// if(temp) delete temp;
}
load_configuration();
- read_frame(frame,
- 0,
- start_position,
+ read_frame(frame,
+ 0,
+ start_position,
frame_rate,
get_use_opengl());
if(get_use_opengl()) return run_opengl();
int DeInterlaceMain::handle_opengl()
{
#ifdef HAVE_GL
- static const char *head_frag =
+ static const char *head_frag =
"uniform sampler2D tex;\n"
"uniform float double_line_h;\n"
"uniform float line_h;\n"
"{\n"
" vec2 coord = gl_TexCoord[0].st;\n";
- static const char *line_double_frag =
+ static const char *line_double_frag =
" float line1 = floor((coord.y - y_offset) / double_line_h) * double_line_h + y_offset;\n"
" gl_FragColor = texture2D(tex, vec2(coord.x, line1));\n";
- static const char *line_avg_frag =
+ static const char *line_avg_frag =
" float line1 = floor((coord.y - 0.0) / double_line_h) * double_line_h + 0.0;\n"
" float line2 = line1 + line_h;\n"
" gl_FragColor = (texture2D(tex, vec2(coord.x, line1)) + \n"
" texture2D(tex, vec2(coord.x, line2))) / 2.0;\n";
- static const char *field_avg_frag =
+ static const char *field_avg_frag =
" float line1 = floor((coord.y - y_offset) / double_line_h) * double_line_h + y_offset;\n"
" float line2 = line1 + double_line_h;\n"
" float frac = (line2 - coord.y) / double_line_h;\n"
" gl_FragColor = mix(texture2D(tex, vec2(coord.x, line2)),\n"
" texture2D(tex, vec2(coord.x, line1)),frac);\n";
- static const char *line_swap_frag =
+ static const char *line_swap_frag =
" float line1 = floor((coord.y - y_offset) / double_line_h) * double_line_h + y_offset;\n"
// This is the input line for line2, not the denominator of the fraction
" float line2 = line1 + line_h;\n"
" gl_FragColor = mix(texture2D(tex, vec2(coord.x, line2)),\n"
" texture2D(tex, vec2(coord.x, line1)), frac);\n";
- static const char *tail_frag =
+ static const char *tail_frag =
"}\n";
get_output()->to_texture();
if(config.mode != DEINTERLACE_NONE)
{
- unsigned int frag = VFrame::make_shader(0,
- shader_stack[0],
- shader_stack[1],
+ unsigned int frag = VFrame::make_shader(0,
+ shader_stack[0],
+ shader_stack[1],
shader_stack[2],
0);
if(frag)
get_output()->set_opengl_state(VFrame::SCREEN);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
-
+
#endif
return 0;
}
void DeInterlaceMain::update_gui()
{
- if(thread)
+ if(thread)
{
load_configuration();
((DeInterlaceWindow*)thread->window)->lock_window();