/*
* 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"
int DenoiseMJPEGConfig::equivalent(DenoiseMJPEGConfig &that)
{
- return
- that.radius == radius &&
- that.threshold == threshold &&
- that.threshold2 == threshold2 &&
- that.sharpness == sharpness &&
- that.lcontrast == lcontrast &&
- that.ccontrast == ccontrast &&
- that.deinterlace == deinterlace &&
- that.mode == mode &&
+ return
+ that.radius == radius &&
+ that.threshold == threshold &&
+ that.threshold2 == threshold2 &&
+ that.sharpness == sharpness &&
+ that.lcontrast == lcontrast &&
+ that.ccontrast == ccontrast &&
+ that.deinterlace == deinterlace &&
+ that.mode == mode &&
that.delay == delay;
}
delay = that.delay;
}
-void DenoiseMJPEGConfig::interpolate(DenoiseMJPEGConfig &prev,
- DenoiseMJPEGConfig &next,
- long prev_frame,
- long next_frame,
+void DenoiseMJPEGConfig::interpolate(DenoiseMJPEGConfig &prev,
+ DenoiseMJPEGConfig &next,
+ long prev_frame,
+ long next_frame,
long current_frame)
{
double next_scale = (double)(current_frame - prev_frame) / (next_frame - prev_frame);
DenoiseMJPEGRadius::DenoiseMJPEGRadius(DenoiseMJPEG *plugin, int x, int y)
- : BC_IPot(x,
- y,
+ : BC_IPot(x,
+ y,
plugin->config.radius,
8,
24)
DenoiseMJPEGThresh::DenoiseMJPEGThresh(DenoiseMJPEG *plugin, int x, int y)
- : BC_IPot(x,
- y,
+ : BC_IPot(x,
+ y,
plugin->config.threshold,
0,
255)
DenoiseMJPEGThresh2::DenoiseMJPEGThresh2(DenoiseMJPEG *plugin, int x, int y)
- : BC_IPot(x,
- y,
+ : BC_IPot(x,
+ y,
plugin->config.threshold2,
0,
255)
DenoiseMJPEGSharp::DenoiseMJPEGSharp(DenoiseMJPEG *plugin, int x, int y)
- : BC_IPot(x,
- y,
+ : BC_IPot(x,
+ y,
plugin->config.sharpness,
0,
255)
DenoiseMJPEGLContrast::DenoiseMJPEGLContrast(DenoiseMJPEG *plugin, int x, int y)
- : BC_IPot(x,
- y,
+ : BC_IPot(x,
+ y,
plugin->config.lcontrast,
0,
255)
DenoiseMJPEGCContrast::DenoiseMJPEGCContrast(DenoiseMJPEG *plugin, int x, int y)
- : BC_IPot(x,
- y,
+ : BC_IPot(x,
+ y,
plugin->config.ccontrast,
0,
255)
DenoiseMJPEGDeinterlace::DenoiseMJPEGDeinterlace(DenoiseMJPEG *plugin, int x, int y)
- : BC_CheckBox(x,
- y,
+ : BC_CheckBox(x,
+ y,
plugin->config.deinterlace,
_("Deinterlace"))
{
DenoiseMJPEGModeProgressive::DenoiseMJPEGModeProgressive(DenoiseMJPEG *plugin, DenoiseMJPEGWindow *gui, int x, int y)
- : BC_Radial(x,
- y,
+ : BC_Radial(x,
+ y,
plugin->config.mode == 0,
_("Progressive"))
{
DenoiseMJPEGModeInterlaced::DenoiseMJPEGModeInterlaced(DenoiseMJPEG *plugin, DenoiseMJPEGWindow *gui, int x, int y)
- : BC_Radial(x,
- y,
+ : BC_Radial(x,
+ y,
plugin->config.mode == 1,
_("Interlaced"))
{
DenoiseMJPEGModeFast::DenoiseMJPEGModeFast(DenoiseMJPEG *plugin, DenoiseMJPEGWindow *gui, int x, int y)
- : BC_Radial(x,
- y,
+ : BC_Radial(x,
+ y,
plugin->config.mode == 2,
_("Fast"))
{
DenoiseMJPEGDelay::DenoiseMJPEGDelay(DenoiseMJPEG *plugin, int x, int y)
- : BC_IPot(x,
- y,
+ : BC_IPot(x,
+ y,
plugin->config.delay,
1,
8)
DenoiseMJPEG::DenoiseMJPEG(PluginServer *server)
: PluginVClient(server)
{
-
+
accumulation = 0;
}
DenoiseMJPEG::~DenoiseMJPEG()
{
-
+
if(accumulation) delete [] accumulation;
}
return 0;
}
-const char* DenoiseMJPEG::plugin_title() { return _("Denoise video2"); }
+const char* DenoiseMJPEG::plugin_title() { return N_("Denoise video2"); }
int DenoiseMJPEG::is_realtime() { return 1; }
void DenoiseMJPEG::update_gui()
{
- if(thread)
+ if(thread)
{
load_configuration();
DenoiseMJPEGWindow *window = (DenoiseMJPEGWindow *)thread->window;
FileXML output;
// cause data to be stored directly in text
- output.set_shared_output(keyframe->get_data(), MESSAGESIZE);
+ output.set_shared_output(keyframe->xbuf);
output.tag.set_title("DENOISE_VIDEO2");
output.tag.set_property("RADIUS", config.radius);
output.tag.set_property("THRESHOLD", config.threshold);
{
FileXML input;
- input.set_shared_input(keyframe->get_data(), strlen(keyframe->get_data()));
+ input.set_shared_input(keyframe->xbuf);
while(!input.read_tag())
{