merge hv v6, rework trace methods
[goodguy/history.git] / cinelerra-5.1 / plugins / motion2point / motion.C
index 4130e2d811c2126f7b0f9b1735d5b96a6f247f10..3b6c955af053c755bf701f099f7411e465d904c4 100644 (file)
@@ -1,7 +1,7 @@
 
 /*
  * CINELERRA
- * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
+ * Copyright (C) 2016 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
@@ -445,34 +445,37 @@ void MotionMain2::allocate_temp(int w, int h, int color_model)
 
 void MotionMain2::scan_motion(int point)
 {
+       int w = current_global_ref->get_w();
+       int h = current_global_ref->get_h();
+
+
        if(!engine) engine = new MotionScan(PluginClient::get_project_smp() + 1,
                PluginClient::get_project_smp() + 1);
 
 // Get the current motion vector between the previous and current frame
        engine->scan_frame(current_global_ref, 
                prev_global_ref, 
-               config.global_range_w[point],
-               config.global_range_h[point],
-               config.global_block_w[point],
-               config.global_block_h[point],
-               config.block_x[point],
-               config.block_y[point],
+               config.global_range_w[point] * w / 100,
+               config.global_range_h[point] * h / 100,
+               config.global_block_w[point] * w / 100,
+               config.global_block_h[point] * h / 100,
+               config.block_x[point] * w / 100,
+               config.block_y[point] * h / 100,
                config.tracking_object,
                config.calculation,
                config.action,
                config.horizontal_only,
                config.vertical_only,
                get_source_position(),
-               config.global_positions,
                total_dx[point],
                total_dy[point],
-               config.global_origin_x[point],
-               config.global_origin_y[point]);
+               config.global_origin_x[point] * w / 100,
+               config.global_origin_y[point] * h / 100,
+               1,
+               0,
+               0,
+               0);
 
-//             0,
-//             0,
-//             0,
-//             0);
        current_dx[point] = engine->dx_result;
        current_dy[point] = engine->dy_result;