+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;
+};