X-Git-Url: https://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fscopewindow.h;h=86f9efa91155147d2c94fc6988057ace0dd9d21a;hb=cec4b4235b1b164d1afd583169c4dbde1f9bf784;hp=3c645521450888cafcb94a64dfb2983ec666b352;hpb=0df48ad2d876409c5beeae2e21933a728ea76c33;p=goodguy%2Fcinelerra.git diff --git a/cinelerra-5.1/cinelerra/scopewindow.h b/cinelerra-5.1/cinelerra/scopewindow.h index 3c645521..86f9efa9 100644 --- a/cinelerra-5.1/cinelerra/scopewindow.h +++ b/cinelerra-5.1/cinelerra/scopewindow.h @@ -22,6 +22,7 @@ #define SCOPEWINDOW_H +#include "boxblur.inc" #include "guicast.h" #include "loadbalance.h" #include "mwindow.h" @@ -30,6 +31,11 @@ #include "scopewindow.inc" #include "theme.inc" +enum { + SCOPE_HISTOGRAM, SCOPE_HISTOGRAM_RGB, + SCOPE_WAVEFORM, SCOPE_WAVEFORM_RGB, SCOPE_WAVEFORM_PLY, + SCOPE_VECTORSCOPE, +}; // Number of divisions in histogram. // 65536 + min and max range to speed up the tabulation @@ -47,7 +53,6 @@ #define MIN_SCOPE_H yS(320) - #define WAVEFORM_DIVISIONS 12 #define VECTORSCOPE_DIVISIONS 11 @@ -63,12 +68,6 @@ class ScopeUnit : public LoadClient { public: ScopeUnit(ScopeGUI *gui, ScopeEngine *server); - void draw_point(unsigned char **rows, - int x, - int y, - int r, - int g, - int b); void process_package(LoadPackage *package); int bins[HIST_SECTIONS][TOTAL_BINS]; ScopeGUI *gui; @@ -89,11 +88,7 @@ public: class ScopePanel : public BC_SubWindow { public: - ScopePanel(ScopeGUI *gui, - int x, - int y, - int w, - int h); + ScopePanel(ScopeGUI *gui, int x, int y, int w, int h); void create_objects(); virtual void update_point(int x, int y); virtual void draw_point(); @@ -108,11 +103,7 @@ public: class ScopeWaveform : public ScopePanel { public: - ScopeWaveform(ScopeGUI *gui, - int x, - int y, - int w, - int h); + ScopeWaveform(ScopeGUI *gui, int x, int y, int w, int h); virtual void update_point(int x, int y); virtual void draw_point(); virtual void clear_point(); @@ -124,11 +115,7 @@ public: class ScopeVectorscope : public ScopePanel { public: - ScopeVectorscope(ScopeGUI *gui, - int x, - int y, - int w, - int h); + ScopeVectorscope(ScopeGUI *gui, int x, int y, int w, int h); virtual void update_point(int x, int y); virtual void draw_point(); virtual void clear_point(); @@ -139,11 +126,7 @@ public: class ScopeHistogram : public ScopePanel { public: - ScopeHistogram(ScopeGUI *gui, - int x, - int y, - int w, - int h); + ScopeHistogram(ScopeGUI *gui, int x, int y, int w, int h); void clear_point(); void update_point(int x, int y); void draw_point(); @@ -152,32 +135,102 @@ public: int drag_x; }; -class ScopeToggle : public BC_Toggle + +class ScopeScopesOn : public BC_MenuItem +{ +public: + ScopeScopesOn(ScopeMenu *scope_menu, const char *text, int id); + int handle_event(); + + ScopeMenu *scope_menu; + int id; +}; + +class ScopeMenu : public BC_PopupMenu +{ +public: + ScopeMenu(ScopeGUI *gui, int x, int y); + void create_objects(); + void update_toggles(); + + ScopeGUI *gui; + ScopeScopesOn *hist_on; + ScopeScopesOn *hist_rgb_on; + ScopeScopesOn *wave_on; + ScopeScopesOn *wave_rgb_on; + ScopeScopesOn *wave_ply_on; + ScopeScopesOn *vect_on; +}; + + +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: + ScopeGainSlider(ScopeGain *gain, int x, int y, int w); + + int handle_event(); + ScopeGain *gain; +}; + +class ScopeGain { public: - ScopeToggle(ScopeGUI *gui, - int x, - int y, - int *value); - static VFrame** get_image_set(ScopeGUI *gui, int *value); + 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: + ScopeSmooth(ScopeGUI *gui, int x, int y); int handle_event(); ScopeGUI *gui; - int *value; }; class ScopeGUI : public PluginClientWindow { public: - ScopeGUI(Theme *theme, - int x, - int y, - int w, - int h, - int cpus); - ScopeGUI(PluginClient *plugin, - int w, - int h); + ScopeGUI(Theme *theme, int x, int y, int w, int h, int cpus); + ScopeGUI(PluginClient *plugin, int w, int h); virtual ~ScopeGUI(); void reset(); @@ -185,6 +238,7 @@ public: void create_panels(); virtual int resize_event(int w, int h); virtual int translation_event(); + virtual void update_scope() {} // Called for user storage when toggles change virtual void toggle_event(); @@ -192,26 +246,26 @@ public: // update toggles void update_toggles(); void calculate_sizes(int w, int h); - void allocate_bitmaps(); + void allocate_vframes(); void draw_overlays(int overlays, int borders, int flush); void process(VFrame *output_frame); void draw(int flash, int flush); void clear_points(int flash); - Theme *theme; VFrame *output_frame; + VFrame *data_frame, *temp_frame; ScopeEngine *engine; - BC_Bitmap *waveform_bitmap; - BC_Bitmap *vector_bitmap; + BoxBlur *box_blur; + VFrame *waveform_vframe; + VFrame *vector_vframe; ScopeHistogram *histogram; ScopeWaveform *waveform; ScopeVectorscope *vectorscope; - ScopeToggle *hist_parade_on; - ScopeToggle *hist_on; - ScopeToggle *waveform_parade_on; - ScopeToggle *waveform_on; - ScopeToggle *vector_on; + ScopeMenu *scope_menu; + ScopeWaveSlider *wave_slider; + ScopeVectSlider *vect_slider; + ScopeSmooth *smooth; BC_Title *value_text; int x, y, w, h; @@ -224,13 +278,8 @@ public: int use_hist_parade, use_wave_parade; int bins[HIST_SECTIONS][TOTAL_BINS]; - int frame_w; + int frame_w, use_smooth; + int use_wave_gain, use_vect_gain; }; - - - #endif - - -