Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
VideoSource_Controller.hh
1 #ifndef __VideoSource_Controller_HH__
2 #define __VideoSource_Controller_HH__
3 
4 #include <bias_config.h>
5 
6 #include <Base/Common/W32Compat.hh>
7 #include <VideoSource/VideoSource_Base.hh>
8 
9 #include <Base/Image/ImageIO.hh>
10 #include <Base/Image/ImageConvert.hh>
11 
12 #include <Image/Camera.hh>
13 #include <Image/StereoRedGreen.hh>
14 
15 #include <Gui/VideoSource_Controller_Base.hh>
16 
17 namespace BIAS {
18 
19  class BIASGui_EXPORT VideoSource_Controller : public VideoSource_Controller_Base
20  {
21 
22  public:
23 
25  const std::string &title,
26  double minShutter=-1, double maxShutter=-1,
27  double minGain=-1,double maxGain=-1,
28  double minContrast=-1,double maxContrast=-1,
29  double minBrightness=-1,double maxBrightness=-1);
30 
32 
33  bool Show(bool show=true);
34 
35 
36 
37  void SetCloseShortcut(const int &asciiCode,
38  bool ctrl, bool shift, bool alt);
39 
40  void SetVideoSource(BIAS::VideoSource *cam);
41  void SetShutterRange(unsigned int min,unsigned int max);
42  void SetGainRange(unsigned int min,unsigned int max);
43 
44  void SetBrightnessRange(unsigned int min,unsigned int max);
45  void SetContrastRange(unsigned int min,unsigned int max);
46  void Update(); // trigger an update, useful for auto-mode
47 
48 
49  wxBoxSizer *vBox;
50 
51  enum {
53  //All 16 FEATURES of DCAM
54  //GAIN, SHUTTER PANEL
62  //HUE, SATURATION
65 
66  //GAMMA, BRIGHTNESS
82 
83  ID_TEXT
84  };
85 
86  private:
87  void Initialize_();
88  void OnEscape(wxCommandEvent& event);
89  void OnKeyUp(wxKeyEvent& event);
90 
91  void OnHide(wxCommandEvent& event);
92  void OnClose(wxCloseEvent& event);
93  void OnWhiteBalance(wxCommandEvent& event);
94  void OnShutter(wxScrollEvent& event);
95  void OnGain(wxScrollEvent& event);
96  void OnWhiteBalanceManual(wxScrollEvent& event);
97  void OnBrightness(wxScrollEvent& event);
98  void OnContrast(wxScrollEvent& event);
99  void OnAuto_Shutter(wxCommandEvent& event);
100  void OnAuto_Brightness(wxCommandEvent& event);
101  void OnAuto_Gain(wxCommandEvent& event);
102  void OnUpdate(wxCommandEvent& event) ;
103 
104  void auto_on(int param);
105  void auto_off(int param);
106 
107  bool AreModifiersCorrect_(const wxKeyEvent &event);
108 
109  protected:
110 
112 
113  wxSlider *SliderGain;
114  wxSlider *SliderShutter;
115  wxSlider *SliderWbRed;
116  wxSlider *SliderWbBlue;
117  wxSlider *SliderBrightness;
118  wxSlider *SliderContrast;
119  wxBoxSizer *sliderBox_ShGa;
120 
123  bool auto_gain;
125 
127 
128  wxButton *showButton;
130  wxButton *auto_sh_Button;
131  wxButton *auto_ga_Button;
132  wxButton *auto_br_Button;
133  wxButton *auto_co_Button;
134  wxButton *update_Button;
135 
136  double minShutter_, maxShutter_, minGain_,maxGain_;
137  double minBrightness_, maxBrightness_, minContrast_, maxContrast_;
138 
139  bool Ctrl_, Shift_, Alt_;
141 
142  DECLARE_EVENT_TABLE()
143 
144  }; // end class
145 
146 } // end namespace BIAS
147 
148 #endif // __VideoSource_Controller_HH__
Defines a common interface to different devices.
const float minShutter
const float minGain
const float maxGain
const float maxShutter