crikey rework, KP4 fix, added Shift-KPx, valgrind cleanups, hex eye-dropper, resize...
[goodguy/history.git] / cinelerra-5.1 / plugins / crikey / crikey.h
index 3b8c1cfc532819eb73076b5e1ce82c431ec67148..6747e6449f18eb4e4f9126f7619ef00d87e3e9e1 100644 (file)
@@ -20,8 +20,8 @@
 
 
 
-#ifndef EDGE_H
-#define EDGE_H
+#ifndef __CRIKEY_H__
+#define __CRIKEY_H__
 
 #include "loadbalance.h"
 #include "pluginvclient.h"
@@ -34,15 +34,23 @@ class CriKey;
 #define DRAW_MASK       2
 #define DRAW_MODES      3
 
-#define KEY_SEARCH      0
-#define KEY_SEARCH_ALL  1
-#define KEY_POINT       2
-#define KEY_MODES       3
+enum { PT_E, PT_X, PT_Y, PT_T, PT_SZ }; // enable, x,y, tag
+
+class CriKeyPoint
+{
+public:
+       int t, e;
+       float x, y;
+
+       CriKeyPoint(int t, int e, float x, float y);
+       ~CriKeyPoint();
+};
 
 class CriKeyConfig
 {
 public:
        CriKeyConfig();
+       ~CriKeyConfig();
 
        int equivalent(CriKeyConfig &that);
        void copy_from(CriKeyConfig &that);
@@ -52,11 +60,15 @@ public:
        static void set_target(int is_yuv, int color, float *target);
        static void set_color(int is_yuv, float *target, int &color);
 
+       ArrayList<CriKeyPoint *> points;
+       int add_point(int t, int e, float x, float y);
+       int add_point();
+       void del_point(int i);
+
        int color;
        float threshold;
-       int draw_mode, key_mode;
-       float point_x, point_y;
-       int drag;
+       int draw_mode;
+       int drag, selected;
 };
 
 class CriKeyPackage : public LoadPackage
@@ -102,16 +114,13 @@ public:
        PLUGIN_CLASS_MEMBERS2(CriKeyConfig)
        int is_realtime();
        void update_gui();
+       int new_point();
        void save_data(KeyFrame *keyframe);
        void read_data(KeyFrame *keyframe);
        int process_buffer(VFrame *frame, int64_t start_position, double frame_rate);
        void draw_alpha(VFrame *msk);
-       void draw_mask(VFrame *msk);
-       float diff_uint8(uint8_t *tp);
-       float diff_float(uint8_t *tp);
-       float (CriKey::*diff_pixel)(uint8_t *dp);
-       void min_key(int &ix, int &iy);
-       bool find_key(int &ix, int &iy, float threshold);
+       void draw_mask(VFrame *frm);
+       void draw_point(VFrame *msk, CriKeyPoint *pt);
        static void set_target(int is_yuv, int color, float *target) {
                CriKeyConfig::set_target(is_yuv, color, target);
        }