/*
* 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"
RGB601Main::RGB601Main(PluginServer *server)
: PluginVClient(server)
{
-
+
}
RGB601Main::~RGB601Main()
{
-
+
}
-const char* RGB601Main::plugin_title() { return _("RGB - 601"); }
+const char* RGB601Main::plugin_title() { return N_("RGB - 601"); }
int RGB601Main::is_realtime() { return 1; }
}
}
}
-
- if(thread)
- {
- ((RGB601Window*)thread->window)->update();
- }
}
-
#define CREATE_TABLE(max) \
{ \
for(int i = 0; i < max; i++) \
{
int w = input_ptr->get_w();
int h = input_ptr->get_h();
-
+
if(config.direction == 1)
switch(input_ptr->get_color_model())
{
// Set parameters for aggregation with previous or next effect.
frame->get_params()->update("RGB601_DIRECTION", config.direction);
- read_frame(frame,
- 0,
- start_position,
+ read_frame(frame,
+ 0,
+ start_position,
frame_rate,
get_use_opengl());
run_opengl();
return 0;
}
-
+
create_table(frame);
int RGB601Main::handle_opengl()
{
#ifdef HAVE_GL
- static const char *yuv_fwd_frag =
+ static const char *yuv_fwd_frag =
"uniform sampler2D tex;\n"
"void main()\n"
"{\n"
" gl_FragColor = texture2D(tex, gl_TexCoord[0].st);\n"
" gl_FragColor.r = gl_FragColor.r * 0.8588 + 0.0627;\n"
"}\n";
- static const char *yuv_rev_frag =
+ static const char *yuv_rev_frag =
"uniform sampler2D tex;\n"
"void main()\n"
"{\n"
" gl_FragColor = texture2D(tex, gl_TexCoord[0].st);\n"
" gl_FragColor.r = gl_FragColor.r * 1.1644 - 0.0627;\n"
"}\n";
- static const char *rgb_fwd_frag =
+ static const char *rgb_fwd_frag =
"uniform sampler2D tex;\n"
"void main()\n"
"{\n"
" gl_FragColor = texture2D(tex, gl_TexCoord[0].st);\n"
" gl_FragColor.rgb = gl_FragColor.rgb * vec3(0.8588, 0.8588, 0.8588) + vec3(0.0627, 0.0627, 0.0627);\n"
"}\n";
- static const char *rgb_rev_frag =
+ static const char *rgb_rev_frag =
"uniform sampler2D tex;\n"
"void main()\n"
"{\n"
get_output()->bind_texture(0);
unsigned int frag_shader = 0;
- switch(get_output()->get_color_model())
- {
- case BC_YUV888:
- case BC_YUVA8888:
- frag_shader = VFrame::make_shader(0,
- config.direction == 1 ? yuv_fwd_frag : yuv_rev_frag,
- 0);
+ switch( get_output()->get_color_model() ) {
+ case BC_YUV888:
+ case BC_YUVA8888:
+ frag_shader = VFrame::make_shader(0,
+ config.direction == 1 ? yuv_fwd_frag : yuv_rev_frag,
+ 0);
break;
- default:
- frag_shader = VFrame::make_shader(0,
- config.direction == 1 ? rgb_fwd_frag : rgb_rev_frag,
- 0);
+ default:
+ frag_shader = VFrame::make_shader(0,
+ config.direction == 1 ? rgb_fwd_frag : rgb_rev_frag,
+ 0);
break;
}
- if(frag_shader)
- {
+ if( frag_shader > 0 ) {
glUseProgram(frag_shader);
glUniform1i(glGetUniformLocation(frag_shader, "tex"), 0);
}