/*
* 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 "bchash.h"
#define MAX_MAGNIFICATION 100.0
-ZoomLimit::ZoomLimit(ZoomMain *plugin,
- ZoomWindow *window,
- float *output,
- int x,
- int y,
+ZoomLimit::ZoomLimit(ZoomMain *plugin,
+ ZoomWindow *window,
+ float *output,
+ int x,
+ int y,
int w)
: BC_TumbleTextBox(window,
*output,
ZoomWindow::ZoomWindow(ZoomMain *plugin)
- : PluginClientWindow(plugin,
- 250,
- 125,
+ : PluginClientWindow(plugin,
+ 250,
+ 125,
250,
125,
0)
add_subwindow(title = new BC_Title(x, y, _("X Magnification:")));
y += title->get_h() + widget_border;
- limit_x = new ZoomLimit(plugin,
- this,
- &plugin->max_magnification_x,
- x,
- y,
+ limit_x = new ZoomLimit(plugin,
+ this,
+ &plugin->max_magnification_x,
+ x,
+ y,
get_w() - window_border * 2 - widget_border - BC_Tumbler::calculate_w());
limit_x->create_objects();
y += limit_x->get_h() + widget_border;
add_subwindow(title = new BC_Title(x, y, _("Y Magnification:")));
y += title->get_h() + widget_border;
- limit_y = new ZoomLimit(plugin,
- this,
- &plugin->max_magnification_y,
- x,
- y,
+ limit_y = new ZoomLimit(plugin,
+ this,
+ &plugin->max_magnification_y,
+ x,
+ y,
get_w() - window_border * 2 - widget_border - BC_Tumbler::calculate_w());
limit_y->create_objects();
delete temp;
}
-const char* ZoomMain::plugin_title() { return _("Zoom"); }
+const char* ZoomMain::plugin_title() { return N_("Zoom"); }
int ZoomMain::is_video() { return 1; }
int ZoomMain::is_transition() { return 1; }
int ZoomMain::uses_gui() { return 1; }
if(fraction > 0)
{
- in_w = (float)w / ((float)fraction *
+ in_w = (float)w / ((float)fraction *
(max_magnification_x - min_magnification_x) +
min_magnification_x);
in_x = (float)w / 2 - in_w / 2;
- in_h = (float)h / ((float)fraction *
+ in_h = (float)h / ((float)fraction *
(max_magnification_y - min_magnification_y) +
min_magnification_y);
in_y = (float)h / 2 - in_h / 2;
in_y = 0;
}
-// printf("ZoomMain::process_realtime %f %f %f %f\n",
+// printf("ZoomMain::process_realtime %f %f %f %f\n",
// fraction,
-// ((float)fraction *
+// ((float)fraction *
// (max_magnification_x - min_magnification_x) +
// min_magnification_x),
-// in_x,
-// in_y,
-// in_x + in_w,
+// in_x,
+// in_y,
+// in_x + in_w,
// in_y + in_h);
if(is_before)
{
- if(!temp) temp = new VFrame(outgoing->get_w(),
- outgoing->get_h(),
- outgoing->get_color_model());
+ if(!temp) temp = new VFrame(outgoing->get_w(), outgoing->get_h(),
+ outgoing->get_color_model(), 0);
temp->clear_frame();
- overlayer->overlay(temp,
- outgoing,
- in_x,
- in_y,
- in_x + in_w,
- in_y + in_h,
- 0,
- 0,
- temp->get_w(),
- temp->get_h(),
- 1.0,
- TRANSFER_REPLACE,
- CUBIC_LINEAR);
+ overlayer->overlay(temp, outgoing,
+ in_x, in_y, in_x + in_w, in_y + in_h,
+ 0, 0, temp->get_w(), temp->get_h(),
+ 1.0, TRANSFER_REPLACE, CUBIC_LINEAR);
outgoing->copy_from(temp);
}
else
{
outgoing->clear_frame();
- overlayer->overlay(outgoing,
- incoming,
- in_x,
- in_y,
- in_x + in_w,
- in_y + in_h,
- 0,
- 0,
- temp->get_w(),
- temp->get_h(),
- 1.0,
- TRANSFER_REPLACE,
- CUBIC_LINEAR);
+ overlayer->overlay(outgoing, incoming,
+ in_x, in_y, in_x + in_w, in_y + in_h,
+ 0, 0, outgoing->get_w(), outgoing->get_h(),
+ 1.0, TRANSFER_REPLACE, CUBIC_LINEAR);
}
return 0;