/*
* 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 "bcdisplayinfo.h"
#include "filexml.h"
#include "guicast.h"
#include "language.h"
-#include "cicolors.h"
+#include "bccolors.h"
#include "pluginvclient.h"
#include "vframe.h"
void copy_from(InvertVideoConfig &src);
int equivalent(InvertVideoConfig &src);
- void interpolate(InvertVideoConfig &prev,
- InvertVideoConfig &next,
- long prev_frame,
- long next_frame,
+ void interpolate(InvertVideoConfig &prev,
+ InvertVideoConfig &next,
+ long prev_frame,
+ long next_frame,
long current_frame);
int r, g, b, a;
int InvertVideoConfig::equivalent(InvertVideoConfig &src)
{
- return r == src.r &&
- g == src.g &&
- b == src.b &&
+ return r == src.r &&
+ g == src.g &&
+ b == src.b &&
a == src.a;
}
-void InvertVideoConfig::interpolate(InvertVideoConfig &prev,
- InvertVideoConfig &next,
- long prev_frame,
- long next_frame,
+void InvertVideoConfig::interpolate(InvertVideoConfig &prev,
+ InvertVideoConfig &next,
+ long prev_frame,
+ long next_frame,
long current_frame)
{
r = prev.r;
InvertVideoWindow::InvertVideoWindow(InvertVideoEffect *plugin)
- : PluginClientWindow(plugin,
- 260,
- 130,
- 260,
- 130,
+ : PluginClientWindow(plugin,
+ 260,
+ 130,
+ 260,
+ 130,
0)
{
this->plugin = plugin;
InvertVideoEffect::InvertVideoEffect(PluginServer *server)
: PluginVClient(server)
{
-
+
}
InvertVideoEffect::~InvertVideoEffect()
{
-
+
}
-const char* InvertVideoEffect::plugin_title() { return _("Invert Video"); }
+const char* InvertVideoEffect::plugin_title() { return N_("Invert Video"); }
int InvertVideoEffect::is_realtime() { return 1; }
NEW_WINDOW_MACRO(InvertVideoEffect, InvertVideoWindow)
void InvertVideoEffect::save_data(KeyFrame *keyframe)
{
FileXML output;
- output.set_shared_output(keyframe->get_data(), MESSAGESIZE);
+ output.set_shared_output(keyframe->xbuf);
output.tag.set_title("INVERTVIDEO");
output.tag.set_property("R", config.r);
output.tag.set_property("G", config.g);
void InvertVideoEffect::read_data(KeyFrame *keyframe)
{
FileXML input;
- input.set_shared_input(keyframe->get_data(), strlen(keyframe->get_data()));
+ input.set_shared_input(keyframe->xbuf);
while(!input.read_tag())
{
if(input.tag.title_is("INVERTVIDEO"))
{
load_configuration();
- read_frame(frame,
- 0,
- start_position,
+ read_frame(frame,
+ 0,
+ start_position,
frame_rate,
get_use_opengl());
int InvertVideoEffect::handle_opengl()
{
#ifdef HAVE_GL
- static const char *invert_frag =
+ static const char *invert_frag =
"uniform sampler2D tex;\n"
"uniform bool do_r;\n"
"uniform bool do_g;\n"
get_output()->to_texture();
get_output()->enable_opengl();
- unsigned int frag_shader = 0;
- frag_shader = VFrame::make_shader(0,
- invert_frag,
- 0);
+ unsigned int frag_shader = VFrame::make_shader(0, invert_frag, 0);
glUseProgram(frag_shader);
glUniform1i(glGetUniformLocation(frag_shader, "tex"), 0);
glUniform1i(glGetUniformLocation(frag_shader, "do_r"), config.r);