Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ImageLegendFrame.hh
1 /*
2 This file is part of the BIAS library (Basic ImageAlgorithmS).
3 
4 Copyright (C) 2003-2009 (see file CONTACT for details)
5 Multimediale Systeme der Informationsverarbeitung
6 Institut fuer Informatik
7 Christian-Albrechts-Universitaet Kiel
8 
9 
10 BIAS is free software; you can redistribute it and/or modify
11 it under the terms of the GNU Lesser General Public License as published by
12 the Free Software Foundation; either version 2.1 of the License, or
13 (at your option) any later version.
14 
15 BIAS is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU Lesser General Public License for more details.
19 
20 You should have received a copy of the GNU Lesser General Public License
21 along with BIAS; if not, write to the Free Software
22 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 */
24 
25 
26 #ifndef __ImageLegendFrame_hh__
27 #define __ImageLegendFrame_hh__
28 
29 #include <bias_config.h>
30 
31 #ifndef BIAS_HAVE_WXWIDGETS
32 # error BIAS_HAVE_WXWIDGETS not defined but required by HistoFrame. Please enable BIAS_HAVE_WXWIDGETS in CMake configure step.
33 #endif
34 #include <Base/Common/BIASpragmaStart.hh>
35 #include <wx/wx.h>
36 #include <Base/Common/BIASpragmaEnd.hh>
37 #include <Utils/ImageValueBar.hh>
38 #include <wx/spinctrl.h>
39 
40 namespace BIAS{
41 
42  class ImageCanvas;
43 
44  /** \class ImageLegendFrame
45  \brief Frame to display a Image legend, for example in biasviewwx
46  \author ischiller 11/2010 */
47  class BIASGui_EXPORT ImageLegendFrame : public wxFrame
48  {
49 
50  enum{
51  ID_Save = wxID_HIGHEST+764,
52  ID_Ticks,
53  ID_X,
54  ID_Y,
55  ID_Static
56  };
57 
58  public:
59  ImageLegendFrame(wxWindow* parent, const wxString& title,
60  wxPoint pos = wxPoint(10,10),
61  wxSize size = wxSize(300, 250));
63 
64  void SetImage(BIAS::Image<unsigned char>& im);
65  void SetImage(BIAS::Image<float>& im);
66  void SetImage(BIAS::ImageBase& im);
67  void SetLegendSize(unsigned width, unsigned height);
68 
69  protected:
70  std::string defaultDir_,defaultFile_;
71  wxSpinCtrl *ticksSpin_,*xSpin_,*ySpin_;
72  void Setup(wxSize size = wxSize(300, 250));
73  void OnSize(wxSizeEvent& event);
74  void OnTicks(wxSpinEvent& event);
75  void OnLegendSize(wxSpinEvent& event);
76 
77  void OnSave(wxCommandEvent& event);
78  void OnQuit(wxCommandEvent & event);
79  void OnClose(wxCloseEvent & event);
81  unsigned vbWidth_,vbHeight_;
82 
85 
86  DECLARE_EVENT_TABLE()
87  }; // class HistoFrame
88 
89 } // namespace
90 
91 #endif // __HistoFrame_hh__
ImageValueBar< unsigned char > vbUC_
display image in wx application, provides zoom and investigation functionality
Definition: ImageCanvas.hh:38
Frame to display a Image legend, for example in biasviewwx.
ImageValueBar< float > vbFL_
BIAS::ImageCanvas * window_
This is the base class for images in BIAS.
Definition: ImageBase.hh:102