00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef LUX_WXVIEWER_H
00024 #define LUX_WXVIEWER_H
00025
00026 #include <boost/shared_ptr.hpp>
00027 #include <wx/event.h>
00028 #include <wx/window.h>
00029
00030 namespace lux
00031 {
00032
00033
00034 class wxViewerSelection {
00035 public:
00036 inline wxViewerSelection(void) { Clear(); }
00037 wxViewerSelection(int x1, int x2, int y1, int y2);
00038 inline void Clear(void) { m_x1 = m_x2 = m_y1 = m_y2 = 0; }
00039 void GetBounds(int &x1, int &x2, int &y1, int &y2) const;
00040 void SetBounds(int x1, int x2, int y1, int y2);
00041 inline void GetCorner1(int &x, int &y) const { x = m_x1; y = m_y1; }
00042 inline void GetCorner2(int &x, int &y) const { x = m_x2; y = m_y2; }
00043 inline void SetCorner1(int x, int y) { m_x1 = x; m_y1 = y; }
00044 inline void SetCorner2(int x, int y) { m_x2 = x; m_y2 = y; }
00045 inline bool HasSize(void) const { return (m_x1 != m_x2) && (m_y1 != m_y2); }
00046
00047 protected:
00048 int m_x1, m_x2, m_y1, m_y2;
00049 };
00050
00051
00052 class wxViewerEvent : public wxEvent {
00053 public:
00054 wxViewerEvent(const boost::shared_ptr<wxViewerSelection> selection, wxEventType eventType = wxEVT_NULL, int id = 0);
00055
00056 boost::shared_ptr<wxViewerSelection> GetSelection();
00057
00058
00059 wxEvent* Clone() const;
00060
00061 protected:
00062 boost::shared_ptr<wxViewerSelection> m_selection;
00063 };
00064
00065 DECLARE_LOCAL_EVENT_TYPE(wxEVT_LUX_VIEWER_SELECTION, -1)
00066
00067 typedef void (wxEvtHandler::*wxViewerEventFunction)(wxViewerEvent&);
00068
00069 #define EVT_LUX_VIEWER_SELECTION(id, fn) \
00070 DECLARE_EVENT_TABLE_ENTRY( wxEVT_LUX_VIEWER_SELECTION, id, -1, \
00071 (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) (wxNotifyEventFunction) \
00072 wxStaticCastEvent( wxViewerEventFunction, & fn ), (wxObject *) NULL ),
00073
00074
00075 enum wxViewerMode
00076 {
00077 STATIC,
00078 PANZOOM,
00079 SELECTION,
00080
00081 EMPTY_VIEW,
00082 LOGO_VIEW,
00083 RENDER_VIEW
00084 };
00085
00086
00087 class wxViewerBase {
00088 public:
00089 wxViewerBase();
00090 virtual ~wxViewerBase();
00091
00092 virtual wxWindow* GetWindow() = 0;
00093 virtual wxViewerSelection GetSelection();
00094
00095 virtual void SetMode(wxViewerMode mode);
00096 virtual void SetRulersEnabled(bool enabled = true, bool normalized = false);
00097 virtual void SetLogoData(const unsigned char *data, unsigned int length);
00098 virtual void SetZoom(const wxViewerSelection *selection);
00099 virtual void SetSelection(const wxViewerSelection *selection);
00100 virtual void SetHighlight(const wxViewerSelection *selection);
00101
00102 virtual void Reload();
00103 virtual void Reset();
00104
00105 virtual void SetTmExposure(float v) {};
00106 virtual void SetTmYwa(float v) {};
00107 virtual void SetTmPreScale(float v) {};
00108 virtual void SetTmPostScale(float v) {};
00109 virtual void SetTmBurn(float v) {};
00110 virtual void SetTmGamma(float v) {};
00111 };
00112
00113 }
00114
00115 #endif // LUX_WXLUXGUI_H