00001
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef LensCalImageCtrl_H
00028 #define LensCalImageCtrl_H
00029
00030 #include <base_wx/wxImageCache.h>
00031 #include "lines/FindLines.h"
00032 #include "LensCalTypes.h"
00033
00037 class LensCalImageCtrl : public wxPanel
00038 {
00039 public:
00040 enum LensCalPreviewMode
00041 {
00042 mode_original=0,
00043 mode_edge=1,
00044 mode_corrected=2
00045 };
00047 LensCalImageCtrl();
00049 void SetImage(ImageLineList* newList, unsigned int newIndex);
00051 void SetEmptyImage();
00055 void SetShowLines(bool showLines);
00057 void SetMode(const LensCalPreviewMode newMode);
00059 const LensCalPreviewMode GetMode();
00061 void SetLens(const HuginBase::SrcPanoImage::Projection newProjection,const double newFocallength, const double newCropfactor);
00063 void SetLensDistortions(const double newA, const double newB, const double newC, const double newD, const double newE);
00064
00065 protected:
00067 void DrawView();
00068 void OnMouseEvent(wxMouseEvent &e);
00069
00070 private:
00072 void Resize ( wxSizeEvent & e );
00074 void OnPaint(wxPaintEvent & dc);
00076 void SetEdgeImage();
00078 void GenerateRemappedImage(const unsigned int newWidth,const unsigned int newHeight);
00079
00081 ImageLineList* m_imageLines;
00082 unsigned int m_imageIndex;
00084 wxImage m_img;
00086 vigra::BRGBImage m_edgeImage;
00088 vigra::BRGBImage m_remappedImage;
00090 wxImage m_edge;
00092 wxImage m_remapped_img;
00094 wxBitmap m_scaled_img;
00096 wxBitmap m_display_img;
00098 float m_scale;
00100 bool m_showLines;
00102 LensCalPreviewMode m_previewMode;
00103
00104
00105 HuginBase::SrcPanoImage::Projection m_projection;
00106 double m_focallength;
00107 double m_cropfactor;
00108 double m_a;
00109 double m_b;
00110 double m_c;
00111 double m_d;
00112 double m_e;
00113
00114 HuginBase::SrcPanoImage m_panoimage;
00115 HuginBase::PanoramaOptions m_opts;
00116
00117 DECLARE_EVENT_TABLE()
00118 DECLARE_DYNAMIC_CLASS(CenterCanvas)
00119 };
00120
00122 class LensCalImageCtrlXmlHandler : public wxXmlResourceHandler
00123 {
00124 DECLARE_DYNAMIC_CLASS(LensCalImageCtrlXmlHandler)
00125
00126 public:
00127 LensCalImageCtrlXmlHandler();
00128 virtual wxObject *DoCreateResource();
00129 virtual bool CanHandle(wxXmlNode *node);
00130 };
00131
00132 #endif // LensCalImageCtrl_H