add xvid/flv formats, add motion plugin varients + save file, fix build bug
[goodguy/history.git] / cinelerra-5.1 / plugins / motion-hv / motion-hv.h
similarity index 69%
rename from cinelerra-5.1/plugins/motion.new/motion.h
rename to cinelerra-5.1/plugins/motion-hv/motion-hv.h
index 9ace96136f25655fe49438489cb158aab44d586a..f375fb43d394772797874ac219397de142f073c4 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
 #include "filexml.inc"
 #include "keyframe.inc"
 #include "loadbalance.h"
-#include "motionscan.inc"
-#include "motionwindow.inc"
+#include "motionscan-hv.inc"
+#include "motionwindow-hv.inc"
 #include "overlayframe.inc"
 #include "pluginvclient.h"
-#include "rotateframe.inc"
 #include "vframe.inc"
 
-class MotionMain;
-class MotionWindow;
-class RotateScan;
+class MotionHVMain;
+class MotionHVWindow;
 
 
 
@@ -64,17 +62,16 @@ class RotateScan;
 // Precision of rotation
 #define MIN_ANGLE 0.0001
 
-#define ROTATION_FILE "/tmp/rotate"
 
-class MotionConfig
+class MotionHVConfig
 {
 public:
-       MotionConfig();
+       MotionHVConfig();
 
-       int equivalent(MotionConfig &that);
-       void copy_from(MotionConfig &that);
-       void interpolate(MotionConfig &prev,
-               MotionConfig &next,
+       int equivalent(MotionHVConfig &that);
+       void copy_from(MotionHVConfig &that);
+       void interpolate(MotionHVConfig &prev,
+               MotionHVConfig &next,
                int64_t prev_frame,
                int64_t next_frame,
                int64_t current_frame);
@@ -95,11 +92,11 @@ public:
 // Percent of image size
        int global_block_w;
        int global_block_h;
-       int rotation_block_w;
-       int rotation_block_h;
+//     int rotation_block_w;
+//     int rotation_block_h;
 // Number of search positions in each refinement of the log search
-       int global_positions;
-       int rotate_positions;
+//     int global_positions;
+//     int rotate_positions;
 // Block position in percentage 0 - 100
        double block_x;
        double block_y;
@@ -146,11 +143,11 @@ public:
 
 
 
-class MotionMain : public PluginVClient
+class MotionHVMain : public PluginVClient
 {
 public:
-       MotionMain(PluginServer *server);
-       ~MotionMain();
+       MotionHVMain(PluginServer *server);
+       ~MotionHVMain();
 
        int process_buffer(VFrame **frame,
                int64_t start_position,
@@ -167,7 +164,7 @@ public:
        void calculate_pointers(VFrame **frame, VFrame **src, VFrame **dst);
        void allocate_temp(int w, int h, int color_model);
 
-       PLUGIN_CLASS_MEMBERS2(MotionConfig)
+       PLUGIN_CLASS_MEMBERS2(MotionHVConfig)
 
 
        static void draw_pixel(VFrame *frame, int x, int y);
@@ -179,8 +176,8 @@ public:
 // The frame compared with the previous frame to get the motion.
 // It is moved to compensate for motion and copied to the previous_frame.
        VFrame *temp_frame;
-       MotionScan *engine;
-       RotateScan *motion_rotate;
+       MotionHVScan *engine;
+//     RotateScan *motion_rotate;
        OverlayFrame *overlayer;
        AffineEngine *rotate_engine;
 
@@ -246,110 +243,6 @@ public:
 
 
 
-
-
-
-
-
-
-
-
-
-
-
-
-
-class RotateScanPackage : public LoadPackage
-{
-public:
-       RotateScanPackage();
-       float angle;
-       int64_t difference;
-};
-
-class RotateScanCache
-{
-public:
-       RotateScanCache(float angle, int64_t difference);
-       float angle;
-       int64_t difference;
-};
-
-class RotateScanUnit : public LoadClient
-{
-public:
-       RotateScanUnit(RotateScan *server, MotionMain *plugin);
-       ~RotateScanUnit();
-
-       void process_package(LoadPackage *package);
-
-       RotateScan *server;
-       MotionMain *plugin;
-       AffineEngine *rotater;
-       VFrame *temp;
-};
-
-class RotateScan : public LoadServer
-{
-public:
-       RotateScan(MotionMain *plugin,
-               int total_clients,
-               int total_packages);
-       ~RotateScan();
-
-       friend class RotateScanUnit;
-
-       void init_packages();
-       LoadClient* new_client();
-       LoadPackage* new_package();
-
-// Invoke the motion engine for a search
-// Frame before rotation
-       float scan_frame(VFrame *previous_frame,
-// Frame after rotation
-               VFrame *current_frame,
-// Pivot
-               int block_x,
-               int block_y);
-       int64_t get_cache(float angle);
-       void put_cache(float angle, int64_t difference);
-
-
-// Angle result
-       float result;
-
-private:
-       VFrame *previous_frame;
-// Frame after motion
-       VFrame *current_frame;
-
-       MotionMain *plugin;
-       int skip;
-
-// Pivot
-       int block_x;
-       int block_y;
-// Block to rotate
-       int block_x1;
-       int block_x2;
-       int block_y1;
-       int block_y2;
-// Area to compare
-       int scan_x;
-       int scan_y;
-       int scan_w;
-       int scan_h;
-// Range of angles to compare
-       float scan_angle1, scan_angle2;
-       int total_steps;
-
-       ArrayList<RotateScanCache*> cache;
-       Mutex *cache_lock;
-};
-
-
-
-
 #endif