X-Git-Url: https://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fplugins%2Frgb601%2Frgb601.C;h=988f6ec887bc03abfd66f57d818d19593efe11fd;hb=74afbc29ac4ce9d94d53e10342979f2c59f1f193;hp=273fccea2e42b58ced6519dc9a854b6027e83026;hpb=30bdb85eb33a8ee7ba675038a86c6be59c43d7bd;p=goodguy%2Fhistory.git diff --git a/cinelerra-5.1/plugins/rgb601/rgb601.C b/cinelerra-5.1/plugins/rgb601/rgb601.C index 273fccea..988f6ec8 100644 --- a/cinelerra-5.1/plugins/rgb601/rgb601.C +++ b/cinelerra-5.1/plugins/rgb601/rgb601.C @@ -2,21 +2,21 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams - * + * * 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" @@ -43,15 +43,15 @@ RGB601Config::RGB601Config() 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; } @@ -117,14 +117,8 @@ void RGB601Main::read_data(KeyFrame *keyframe) } } } - - if(thread) - { - ((RGB601Window*)thread->window)->update(); - } } - #define CREATE_TABLE(max) \ { \ for(int i = 0; i < max; i++) \ @@ -208,7 +202,7 @@ void RGB601Main::process(int *table, VFrame *input_ptr, VFrame *output_ptr) { int w = input_ptr->get_w(); int h = input_ptr->get_h(); - + if(config.direction == 1) switch(input_ptr->get_color_model()) { @@ -289,9 +283,9 @@ int RGB601Main::process_buffer(VFrame *frame, // 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()); @@ -308,7 +302,7 @@ int RGB601Main::process_buffer(VFrame *frame, run_opengl(); return 0; } - + create_table(frame); @@ -324,28 +318,28 @@ int RGB601Main::process_buffer(VFrame *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" @@ -359,24 +353,22 @@ int RGB601Main::handle_opengl() 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); }