Hugin trunk 0.1
Loading...
Searching...
No Matches
PreviewPanel.h
Go to the documentation of this file.
1// -*- c-basic-offset: 4 -*-
24#ifndef _PREVIEWPANEL_H
25#define _PREVIEWPANEL_H
26
27#include <vector>
28
30
31#include <vigra_ext/ROIImage.h>
32
33class wxImage;
34class PreviewFrame;
35
40class PreviewPanel : public wxPanel, public HuginBase::PanoramaObserver
41{
43public:
44
48
49 bool Create(wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxTAB_TRAVERSAL, const wxString& name = "panel");
50
52
55 virtual ~PreviewPanel();
56
59
60 void SetAutoUpdate(bool enabled);
61
62 // forces an update of all images.
63 void ForceUpdate();
64
65 // select which images should be shown.
66// void SetDisplayedImages(const HuginBase::UIntSet &images);
67
68 // blending modes available
70
71 void SetBlendMode(BlendMode b);
72
73private:
74
75 // draw the preview directly onto the canvas
76 void DrawPreview(wxDC & dc);
77
78 // remaps the images, called automatically if autopreview is enabled.
79 void updatePreview();
80
81 void mapPreviewImage(unsigned int imgNr);
82
84 void OnResize(wxSizeEvent & e);
86 void OnMouse(wxMouseEvent & e);
89
90 void OnUpdatePreview(wxCommandEvent & e);
91 void DrawOutline(const std::vector<hugin_utils::FDiff2D> & points, wxDC & dc, int offX, int offY);
92
93 void mouse2erect(int xm, int ym, double &xd, double & yd);
94
97
99
100 vigra::Diff2D m_panoImgSize;
101
103 // currently updating the preview.
104
106
107 // panorama options
109
110 // transformation for current preview coordinates into equirect coordinates
112
113 // cache for remapped images
115
117
120
124
126};
127
129class PreviewPanelXmlHandler : public wxXmlResourceHandler
130{
132
133 public:
135 virtual wxObject *DoCreateResource();
136 virtual bool CanHandle(wxXmlNode *node);
137};
138
139#endif // _PREVIEWPANEL_H
struct to hold a image state for stitching
Holds transformations for Image -> Pano and the other way.
this handler class will receive change events from the Panorama.
Panorama image options.
Model for a panorama.
Definition Panorama.h:153
class to cache remapped images, loaded from the hugin small image cache.
The image preview frame.
virtual wxObject * DoCreateResource()
virtual bool CanHandle(wxXmlNode *node)
A preview panel that renders the pictures using the panotools library.
HuginBase::Panorama * pano
the model
SmallRemappedImageCache m_remapCache
void mouse2erect(int xm, int ym, double &xd, double &yd)
void panoramaImagesChanged(HuginBase::Panorama &pano, const HuginBase::UIntSet &imgNr)
notifies about changes to images
void Init(PreviewFrame *parent, HuginBase::Panorama *pano)
virtual ~PreviewPanel()
dtor.
HuginBase::Nona::RemappedPanoImage< vigra::BRGBImage, vigra::BImage > RemappedImage
BlendMode m_blendMode
PreviewPanel()
ctor.
PreviewFrame * parentWindow
wxBitmap * m_panoBitmap
void OnMouse(wxMouseEvent &e)
vigra::Diff2D m_panoImgSize
void DrawOutline(const std::vector< hugin_utils::FDiff2D > &points, wxDC &dc, int offX, int offY)
wxCursor * m_cursor
HuginBase::PTools::Transform * m_pano2erect
void panoramaChanged(HuginBase::Panorama &pano)
Notification about a Panorama change.
void OnUpdatePreview(wxCommandEvent &e)
HuginBase::UIntSet m_dirtyImgs
void DrawPreview(wxDC &dc)
void mousePressRMBEvent(wxMouseEvent &e)
void OnPaint(wxPaintEvent &event)
void OnResize(wxSizeEvent &e)
recalculate panorama to fit the panel
void SetAutoUpdate(bool enabled)
bool m_state_rendering
bool Create(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL, const wxString &name="panel")
void SetBlendMode(BlendMode b)
HuginBase::PanoramaOptions opts
void mousePressLMBEvent(wxMouseEvent &e)
void mapPreviewImage(unsigned int imgNr)
std::set< unsigned int > UIntSet
std::vector< deghosting::BImagePtr > threshold(const std::vector< deghosting::FImagePtr > &inputImages, const double threshold, const uint16_t flags)
Threshold function used for creating alpha masks for images.
Definition threshold.h:41