add wheel/gradical to vectorscope, tweak boxblur layout, chromakey booby fix
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / scopewindow.h
index 74201e460f4520a88ee50be2c531c6c3550fe304..44b2f8fd80503b803480384d3cc7ceb014a15638 100644 (file)
@@ -22,6 +22,7 @@
 #define SCOPEWINDOW_H
 
 
+#include "boxblur.inc"
 #include "guicast.h"
 #include "loadbalance.h"
 #include "mwindow.h"
@@ -33,7 +34,7 @@
 enum {
        SCOPE_HISTOGRAM, SCOPE_HISTOGRAM_RGB,
        SCOPE_WAVEFORM, SCOPE_WAVEFORM_RGB, SCOPE_WAVEFORM_PLY,
-       SCOPE_VECTORSCOPE,
+       SCOPE_VECTORSCOPE, SCOPE_VECTORWHEEL,
 };
 
 // Number of divisions in histogram.
@@ -118,6 +119,9 @@ public:
        virtual void update_point(int x, int y);
        virtual void draw_point();
        virtual void clear_point();
+       void draw_point(float th, float r, int color);
+       void draw_radient(float th, float r1, float r2, int color);
+
        int drag_radius;
        float drag_angle;
 };
@@ -159,24 +163,91 @@ public:
        ScopeScopesOn *wave_rgb_on;
        ScopeScopesOn *wave_ply_on;
        ScopeScopesOn *vect_on;
+       ScopeScopesOn *vect_wheel;
 };
 
-class ScopeWaveSlider : public BC_ISlider
+
+class ScopeGradPaths : public ArrayList<const char *>
 {
 public:
-       ScopeWaveSlider(ScopeGUI *gui, int x, int y, int w);
+       ScopeGradPaths() { set_array_delete(); }
+       ~ScopeGradPaths() { remove_all_objects(); }
+};
+
+class ScopeGradItem : public BC_MenuItem
+{
+public:
+       ScopeGradItem(ScopeVectGrads *vect_grads, const char *text, int idx);
        int handle_event();
+
+       ScopeVectGrads *vect_grads;
+       int idx;
+};
+
+class ScopeVectGrads : public BC_PopupMenu
+{
+public:
+       ScopeVectGrads(ScopeGUI *gui, int x, int y);
+       void create_objects();
+
        ScopeGUI *gui;
 };
 
-class ScopeVectSlider : public BC_ISlider
+
+class ScopeGainReset : public BC_Button
+{
+public:
+       ScopeGainReset(ScopeGain *gain, int x, int y);
+       static int calculate_w(BC_Theme *theme);
+       int handle_event();
+
+       ScopeGain *gain;
+};
+
+class ScopeGainSlider : public BC_ISlider
 {
 public:
-       ScopeVectSlider(ScopeGUI *gui, int x, int y, int w);
+       ScopeGainSlider(ScopeGain *gain, int x, int y, int w);
+
        int handle_event();
+       ScopeGain *gain;
+};
+
+class ScopeGain
+{
+public:
+       ScopeGain(ScopeGUI *gui, int x, int y, int w, int *value);
+       ~ScopeGain();
+       static int calculate_h();
+       void create_objects();
+       void reposition_window(int x, int y);
+       int handle_event();
+
        ScopeGUI *gui;
+       int x, y, w, *value;
+       int reset_w;
+       ScopeGainReset *reset;
+       ScopeGainSlider *slider;
+
+       int get_x() { return x; }
+       int get_y() { return y; }
+       int get_w() { return w; }
+       int get_h() { return calculate_h(); }
 };
 
+class ScopeWaveSlider : public ScopeGain
+{
+public:
+       ScopeWaveSlider(ScopeGUI *gui, int x, int y, int w);
+};
+
+class ScopeVectSlider : public ScopeGain
+{
+public:
+       ScopeVectSlider(ScopeGUI *gui, int x, int y, int w);
+};
+
+
 class ScopeSmooth : public BC_CheckBox
 {
 public:
@@ -208,6 +279,9 @@ public:
        void calculate_sizes(int w, int h);
        void allocate_vframes();
        void draw_overlays(int overlays, int borders, int flush);
+       void update_gradical(int idx);
+       void draw_colorwheel(VFrame *dst, int bg_color);
+       void draw_gradical();
        void process(VFrame *output_frame);
        void draw(int flash, int flush);
        void clear_points(int flash);
@@ -219,19 +293,28 @@ public:
        BoxBlur *box_blur;
        VFrame *waveform_vframe;
        VFrame *vector_vframe;
+       VFrame *wheel_vframe;
        ScopeHistogram *histogram;
        ScopeWaveform *waveform;
        ScopeVectorscope *vectorscope;
        ScopeMenu *scope_menu;
        ScopeWaveSlider *wave_slider;
        ScopeVectSlider *vect_slider;
+       ScopeVectGrads *vect_grads;
        ScopeSmooth *smooth;
        BC_Title *value_text;
+       VFrame *grad_image;
+       BC_Pixmap *grad_pixmap;
 
        int x, y, w, h;
        int vector_x, vector_y, vector_w, vector_h;
+       int vector_cx, vector_cy, radius;
        int wave_x, wave_y, wave_w, wave_h;
        int hist_x, hist_y, hist_w, hist_h;
+       int text_color, dark_color;
+
+       ScopeGradPaths grad_paths;
+       int grad_idx, vector_gradical;
 
        int cpus;
        int use_hist, use_wave, use_vector;
@@ -242,45 +325,4 @@ public:
        int use_wave_gain, use_vect_gain;
 };
 
-
-class BoxBlurPackage : public LoadPackage
-{
-public:
-       BoxBlurPackage();
-       int u1, u2;
-};
-
-class BoxBlurUnit : public LoadClient
-{
-public:
-       BoxBlurUnit(BoxBlur*server);
-       template<class dst_t, class src_t>
-               void blurt_package(LoadPackage *package);
-       void process_package(LoadPackage *package);
-};
-
-class BoxBlur : public LoadServer
-{
-public:
-       BoxBlur(int cpus);
-       virtual ~BoxBlur();
-       void init_packages();
-       LoadClient* new_client();
-       LoadPackage* new_package();
-       void process(VFrame *dst, VFrame *src, int uv,
-               int radius, int power, int comp);
-       void hblur(VFrame *dst, VFrame *src,
-               int radius, int power, int comp=-1);
-       void vblur(VFrame *dst, VFrame *src,
-               int radius, int power, int comp=-1);
-       void blur(VFrame *dst, VFrame *src,
-               int radius, int power, int comp=-1);
-       const uint8_t *src_data;
-       uint8_t *dst_data;
-       int src_ustep, dst_ustep;
-       int src_vstep, dst_vstep;
-       int radius, power;
-       int ulen, vlen, c0, c1;
-};
-
 #endif