/*
* 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"
MotionWindow::MotionWindow(MotionMain *plugin)
: PluginClientWindow(plugin,
- 600,
- 650,
+ 600,
+ 650,
600,
650,
0)
{
- this->plugin = plugin;
+ this->plugin = plugin;
}
MotionWindow::~MotionWindow()
y));
y += 50;
- add_subwindow(title = new BC_Title(x1,
- y,
+ add_subwindow(title = new BC_Title(x1,
+ y,
_("Translation search radius:\n(W/H Percent of image)")));
- add_subwindow(global_range_w = new GlobalRange(plugin,
- x1 + title->get_w() + 10,
+ add_subwindow(global_range_w = new GlobalRange(plugin,
+ x1 + title->get_w() + 10,
y,
&plugin->config.global_range_w));
- add_subwindow(global_range_h = new GlobalRange(plugin,
- x1 + title->get_w() + 10 + global_range_w->get_w(),
+ add_subwindow(global_range_h = new GlobalRange(plugin,
+ x1 + title->get_w() + 10 + global_range_w->get_w(),
y,
&plugin->config.global_range_h));
- add_subwindow(title = new BC_Title(x2,
- y,
+ add_subwindow(title = new BC_Title(x2,
+ y,
_("Rotation search radius:\n(Degrees)")));
- add_subwindow(rotation_range = new RotationRange(plugin,
- x2 + title->get_w() + 10,
+ add_subwindow(rotation_range = new RotationRange(plugin,
+ x2 + title->get_w() + 10,
y));
y += 50;
- add_subwindow(title = new BC_Title(x1,
- y,
+ add_subwindow(title = new BC_Title(x1,
+ y,
_("Translation block size:\n(W/H Percent of image)")));
- add_subwindow(global_block_w = new BlockSize(plugin,
- x1 + title->get_w() + 10,
+ add_subwindow(global_block_w = new BlockSize(plugin,
+ x1 + title->get_w() + 10,
y,
&plugin->config.global_block_w));
- add_subwindow(global_block_h = new BlockSize(plugin,
- x1 + title->get_w() + 10 + global_block_w->get_w(),
+ add_subwindow(global_block_h = new BlockSize(plugin,
+ x1 + title->get_w() + 10 + global_block_w->get_w(),
y,
&plugin->config.global_block_h));
- add_subwindow(title = new BC_Title(x2,
- y,
+ add_subwindow(title = new BC_Title(x2,
+ y,
_("Rotation block size:\n(W/H Percent of image)")));
- add_subwindow(rotation_block_w = new BlockSize(plugin,
- x2 + title->get_w() + 10,
+ add_subwindow(rotation_block_w = new BlockSize(plugin,
+ x2 + title->get_w() + 10,
y,
&plugin->config.rotation_block_w));
- add_subwindow(rotation_block_h = new BlockSize(plugin,
- x2 + title->get_w() + 10 + rotation_block_w->get_w(),
+ add_subwindow(rotation_block_h = new BlockSize(plugin,
+ x2 + title->get_w() + 10 + rotation_block_w->get_w(),
y,
&plugin->config.rotation_block_h));
y += 50;
add_subwindow(title = new BC_Title(x1, y, _("Translation search steps:")));
- add_subwindow(global_search_positions = new GlobalSearchPositions(plugin,
- x1 + title->get_w() + 10,
- y,
+ add_subwindow(global_search_positions = new GlobalSearchPositions(plugin,
+ x1 + title->get_w() + 10,
+ y,
80));
global_search_positions->create_objects();
add_subwindow(title = new BC_Title(x2, y, _("Rotation search steps:")));
- add_subwindow(rotation_search_positions = new RotationSearchPositions(plugin,
- x2 + title->get_w() + 10,
- y,
+ add_subwindow(rotation_search_positions = new RotationSearchPositions(plugin,
+ x2 + title->get_w() + 10,
+ y,
80));
rotation_search_positions->create_objects();
y += 50;
add_subwindow(title = new BC_Title(x, y, _("Translation direction:")));
- add_subwindow(track_direction = new TrackDirection(plugin,
- this,
- x + title->get_w() + 10,
+ add_subwindow(track_direction = new TrackDirection(plugin,
+ this,
+ x + title->get_w() + 10,
y));
track_direction->create_objects();
y += 40;
add_subwindow(title = new BC_Title(x, y + 10, _("Block X:")));
- add_subwindow(block_x = new MotionBlockX(plugin,
- this,
- x + title->get_w() + 10,
+ add_subwindow(block_x = new MotionBlockX(plugin,
+ this,
+ x + title->get_w() + 10,
y));
- add_subwindow(block_x_text = new MotionBlockXText(plugin,
- this,
- x + title->get_w() + 10 + block_x->get_w() + 10,
+ add_subwindow(block_x_text = new MotionBlockXText(plugin,
+ this,
+ x + title->get_w() + 10 + block_x->get_w() + 10,
y + 10));
add_subwindow(title = new BC_Title(x2, y, _("Rotation center:")));
int y1 = y;
y += 50;
add_subwindow(title = new BC_Title(x2, y + 10, _("Maximum angle offset:")));
- add_subwindow(rotate_magnitude = new MotionRMagnitude(plugin,
- x2 + title->get_w() + 10,
+ add_subwindow(rotate_magnitude = new MotionRMagnitude(plugin,
+ x2 + title->get_w() + 10,
y));
y += 40;
add_subwindow(title = new BC_Title(x2, y + 10, _("Rotation settling speed:")));
add_subwindow(rotate_return_speed = new MotionRReturnSpeed(plugin,
- x2 + title->get_w() + 10,
+ x2 + title->get_w() + 10,
y));
y += 40;
add_subwindow(title = new BC_Title(x, y + 10, _("Block Y:")));
- add_subwindow(block_y = new MotionBlockY(plugin,
- this,
- x + title->get_w() + 10,
+ add_subwindow(block_y = new MotionBlockY(plugin,
+ this,
+ x + title->get_w() + 10,
y));
- add_subwindow(block_y_text = new MotionBlockYText(plugin,
- this,
- x + title->get_w() + 10 + block_y->get_w() + 10,
+ add_subwindow(block_y_text = new MotionBlockYText(plugin,
+ this,
+ x + title->get_w() + 10 + block_y->get_w() + 10,
y + 10));
y += 50;
add_subwindow(title = new BC_Title(x, y + 10, _("Maximum absolute offset:")));
- add_subwindow(magnitude = new MotionMagnitude(plugin,
- x + title->get_w() + 10,
+ add_subwindow(magnitude = new MotionMagnitude(plugin,
+ x + title->get_w() + 10,
y));
y += 40;
add_subwindow(title = new BC_Title(x, y + 10, _("Settling speed:")));
add_subwindow(return_speed = new MotionReturnSpeed(plugin,
- x + title->get_w() + 10,
+ x + title->get_w() + 10,
y));
y += 40;
- add_subwindow(track_single = new TrackSingleFrame(plugin,
+ add_subwindow(track_single = new TrackSingleFrame(plugin,
this,
- x,
+ x,
y));
- add_subwindow(title = new BC_Title(x + track_single->get_w() + 20,
- y,
+ add_subwindow(title = new BC_Title(x + track_single->get_w() + 20,
+ y,
_("Frame number:")));
- add_subwindow(track_frame_number = new TrackFrameNumber(plugin,
+ add_subwindow(track_frame_number = new TrackFrameNumber(plugin,
this,
- x + track_single->get_w() + title->get_w() + 20,
+ x + track_single->get_w() + title->get_w() + 20,
y));
y += 20;
- add_subwindow(track_previous = new TrackPreviousFrame(plugin,
+ add_subwindow(track_previous = new TrackPreviousFrame(plugin,
this,
- x,
+ x,
y));
y += 20;
- add_subwindow(previous_same = new PreviousFrameSameBlock(plugin,
+ add_subwindow(previous_same = new PreviousFrameSameBlock(plugin,
this,
- x,
+ x,
y));
y += 40;
y1 = y;
add_subwindow(title = new BC_Title(x, y, _("Master layer:")));
- add_subwindow(master_layer = new MasterLayer(plugin,
+ add_subwindow(master_layer = new MasterLayer(plugin,
this,
- x + title->get_w() + 10,
+ x + title->get_w() + 10,
y));
master_layer->create_objects();
y += 30;
add_subwindow(title = new BC_Title(x, y, _("Action:")));
- add_subwindow(action_type = new ActionType(plugin,
+ add_subwindow(action_type = new ActionType(plugin,
this,
- x + title->get_w() + 10,
+ x + title->get_w() + 10,
y));
action_type->create_objects();
y += 30;
add_subwindow(title = new BC_Title(x, y, _("Calculation:")));
- add_subwindow(tracking_type = new TrackingType(plugin,
- this,
- x + title->get_w() + 10,
+ add_subwindow(tracking_type = new TrackingType(plugin,
+ this,
+ x + title->get_w() + 10,
y));
tracking_type->create_objects();
-GlobalRange::GlobalRange(MotionMain *plugin,
- int x,
+GlobalRange::GlobalRange(MotionMain *plugin,
+ int x,
int y,
int *value)
- : BC_IPot(x,
- y,
+ : BC_IPot(x,
+ y,
(int64_t)*value,
(int64_t)MIN_RADIUS,
(int64_t)MAX_RADIUS)
-RotationRange::RotationRange(MotionMain *plugin,
- int x,
+RotationRange::RotationRange(MotionMain *plugin,
+ int x,
int y)
- : BC_IPot(x,
- y,
+ : BC_IPot(x,
+ y,
(int64_t)plugin->config.rotation_range,
(int64_t)MIN_ROTATION,
(int64_t)MAX_ROTATION)
-RotationCenter::RotationCenter(MotionMain *plugin,
- int x,
+RotationCenter::RotationCenter(MotionMain *plugin,
+ int x,
int y)
- : BC_IPot(x,
- y,
+ : BC_IPot(x,
+ y,
(int64_t)plugin->config.rotation_center,
(int64_t)-MAX_ROTATION,
(int64_t)MAX_ROTATION)
-BlockSize::BlockSize(MotionMain *plugin,
- int x,
+BlockSize::BlockSize(MotionMain *plugin,
+ int x,
int y,
int *value)
- : BC_IPot(x,
- y,
+ : BC_IPot(x,
+ y,
(int64_t)*value,
(int64_t)MIN_BLOCK,
(int64_t)MAX_BLOCK)
-GlobalSearchPositions::GlobalSearchPositions(MotionMain *plugin,
- int x,
+GlobalSearchPositions::GlobalSearchPositions(MotionMain *plugin,
+ int x,
int y,
int w)
: BC_PopupMenu(x,
-RotationSearchPositions::RotationSearchPositions(MotionMain *plugin,
- int x,
+RotationSearchPositions::RotationSearchPositions(MotionMain *plugin,
+ int x,
int y,
int w)
: BC_PopupMenu(x,
-MotionMagnitude::MotionMagnitude(MotionMain *plugin,
- int x,
+MotionMagnitude::MotionMagnitude(MotionMain *plugin,
+ int x,
int y)
- : BC_IPot(x,
- y,
+ : BC_IPot(x,
+ y,
(int64_t)plugin->config.magnitude,
(int64_t)0,
(int64_t)100)
}
-MotionReturnSpeed::MotionReturnSpeed(MotionMain *plugin,
- int x,
+MotionReturnSpeed::MotionReturnSpeed(MotionMain *plugin,
+ int x,
int y)
- : BC_IPot(x,
- y,
+ : BC_IPot(x,
+ y,
(int64_t)plugin->config.return_speed,
(int64_t)0,
(int64_t)100)
-MotionRMagnitude::MotionRMagnitude(MotionMain *plugin,
- int x,
+MotionRMagnitude::MotionRMagnitude(MotionMain *plugin,
+ int x,
int y)
- : BC_IPot(x,
- y,
+ : BC_IPot(x,
+ y,
(int64_t)plugin->config.rotate_magnitude,
(int64_t)0,
(int64_t)90)
-MotionRReturnSpeed::MotionRReturnSpeed(MotionMain *plugin,
- int x,
+MotionRReturnSpeed::MotionRReturnSpeed(MotionMain *plugin,
+ int x,
int y)
- : BC_IPot(x,
- y,
+ : BC_IPot(x,
+ y,
(int64_t)plugin->config.rotate_return_speed,
(int64_t)0,
(int64_t)100)
-MotionGlobal::MotionGlobal(MotionMain *plugin,
+MotionGlobal::MotionGlobal(MotionMain *plugin,
MotionWindow *gui,
- int x,
+ int x,
int y)
- : BC_CheckBox(x,
- y,
+ : BC_CheckBox(x,
+ y,
plugin->config.global,
_("Track translation"))
{
return 1;
}
-MotionRotate::MotionRotate(MotionMain *plugin,
+MotionRotate::MotionRotate(MotionMain *plugin,
MotionWindow *gui,
- int x,
+ int x,
int y)
- : BC_CheckBox(x,
- y,
+ : BC_CheckBox(x,
+ y,
plugin->config.rotate,
_("Track rotation"))
{
-MotionBlockX::MotionBlockX(MotionMain *plugin,
+MotionBlockX::MotionBlockX(MotionMain *plugin,
MotionWindow *gui,
- int x,
+ int x,
int y)
: BC_FPot(x,
y,
plugin->config.block_x,
- (float)0,
+ (float)0,
(float)100)
{
this->plugin = plugin;
-MotionBlockY::MotionBlockY(MotionMain *plugin,
+MotionBlockY::MotionBlockY(MotionMain *plugin,
MotionWindow *gui,
- int x,
+ int x,
int y)
: BC_FPot(x,
y,
(float)plugin->config.block_y,
- (float)0,
+ (float)0,
(float)100)
{
this->plugin = plugin;
return 1;
}
-MotionBlockXText::MotionBlockXText(MotionMain *plugin,
+MotionBlockXText::MotionBlockXText(MotionMain *plugin,
MotionWindow *gui,
- int x,
+ int x,
int y)
: BC_TextBox(x,
y,
-MotionBlockYText::MotionBlockYText(MotionMain *plugin,
+MotionBlockYText::MotionBlockYText(MotionMain *plugin,
MotionWindow *gui,
- int x,
+ int x,
int y)
: BC_TextBox(x,
y,
-MotionDrawVectors::MotionDrawVectors(MotionMain *plugin,
+MotionDrawVectors::MotionDrawVectors(MotionMain *plugin,
MotionWindow *gui,
- int x,
+ int x,
int y)
: BC_CheckBox(x,
- y,
+ y,
plugin->config.draw_vectors,
_("Draw vectors"))
{
-TrackSingleFrame::TrackSingleFrame(MotionMain *plugin,
+TrackSingleFrame::TrackSingleFrame(MotionMain *plugin,
MotionWindow *gui,
- int x,
+ int x,
int y)
- : BC_Radial(x,
- y,
- plugin->config.tracking_object == MotionScan::TRACK_SINGLE,
+ : BC_Radial(x,
+ y,
+ plugin->config.tracking_object == MotionScan::TRACK_SINGLE,
_("Track single frame"))
{
this->plugin = plugin;
-TrackFrameNumber::TrackFrameNumber(MotionMain *plugin,
+TrackFrameNumber::TrackFrameNumber(MotionMain *plugin,
MotionWindow *gui,
- int x,
+ int x,
int y)
: BC_TextBox(x, y, 100, 1, plugin->config.track_frame)
{
-TrackPreviousFrame::TrackPreviousFrame(MotionMain *plugin,
+TrackPreviousFrame::TrackPreviousFrame(MotionMain *plugin,
MotionWindow *gui,
- int x,
+ int x,
int y)
- : BC_Radial(x,
- y,
- plugin->config.tracking_object == MotionScan::TRACK_PREVIOUS,
+ : BC_Radial(x,
+ y,
+ plugin->config.tracking_object == MotionScan::TRACK_PREVIOUS,
_("Track previous frame"))
{
this->plugin = plugin;
-PreviousFrameSameBlock::PreviousFrameSameBlock(MotionMain *plugin,
+PreviousFrameSameBlock::PreviousFrameSameBlock(MotionMain *plugin,
MotionWindow *gui,
- int x,
+ int x,
int y)
- : BC_Radial(x,
- y,
- plugin->config.tracking_object == MotionScan::PREVIOUS_SAME_BLOCK,
+ : BC_Radial(x,
+ y,
+ plugin->config.tracking_object == MotionScan::PREVIOUS_SAME_BLOCK,
_("Previous frame same block"))
{
this->plugin = plugin;
MasterLayer::MasterLayer(MotionMain *plugin, MotionWindow *gui, int x, int y)
- : BC_PopupMenu(x,
- y,
+ : BC_PopupMenu(x,
+ y,
calculate_w(gui),
to_text(plugin->config.bottom_is_master))
{
ActionType::ActionType(MotionMain *plugin, MotionWindow *gui, int x, int y)
- : BC_PopupMenu(x,
- y,
+ : BC_PopupMenu(x,
+ y,
calculate_w(gui),
to_text(plugin->config.action_type))
{
TrackingType::TrackingType(MotionMain *plugin, MotionWindow *gui, int x, int y)
- : BC_PopupMenu(x,
- y,
+ : BC_PopupMenu(x,
+ y,
calculate_w(gui),
to_text(plugin->config.tracking_type))
{
TrackDirection::TrackDirection(MotionMain *plugin, MotionWindow *gui, int x, int y)
- : BC_PopupMenu(x,
- y,
+ : BC_PopupMenu(x,
+ y,
calculate_w(gui),
to_text(plugin->config.horizontal_only, plugin->config.vertical_only))
{