30 #include "hugin_config.h"
32 #if !defined HAVE_EPOXY || !HAVE_EPOXY
38 #include <wx/msgdlg.h>
71 #include <pano13/queryfeature.h>
94 #include <wx/progdlg.h>
95 #include <wx/infobar.h>
125 #define PF_STYLE (wxMAXIMIZE_BOX | wxMINIMIZE_BOX | wxRESIZE_BORDER | wxSYSTEM_MENU | wxCAPTION | wxCLOSE_BOX | wxCLIP_CHILDREN)
137 wxAuiFloatingFrame(parent, (wxAuiManager*)owner_mgr, pane, id, style)
155 wxAuiFloatingFrame::OnMoveFinished();
168 wxSizeEvent
event = wxSizeEvent(wxSize());
175 : wxFrame(frame,-1, _(
"Fast Panorama preview"), wxDefaultPosition, wxDefaultSize,
209 int widths[3] = {-3, 150, 150};
210 SetStatusWidths(3, widths);
211 SetStatusText(wxT(
""),1);
212 SetStatusText(wxT(
""),2);
213 wxConfigBase * cfg = wxConfigBase::Get();
215 wxPanel *tool_panel = wxXmlResource::Get()->LoadPanel(
this,wxT(
"mode_panel"));
216 XRCCTRL(*
this,
"preview_center_tool",wxButton)->SetBitmapMargins(0,5);
217 XRCCTRL(*
this,
"preview_fit_pano_tool",wxButton)->SetBitmapMargins(0,5);
218 XRCCTRL(*
this,
"preview_straighten_pano_tool",wxButton)->SetBitmapMargins(0,5);
219 XRCCTRL(*
this,
"preview_fit_pano_tool2",wxButton)->SetBitmapMargins(0,5);
220 XRCCTRL(*
this,
"preview_autocrop_tool",wxButton)->SetBitmapMargins(0,5);
221 XRCCTRL(*
this,
"preview_stack_autocrop_tool",wxButton)->SetBitmapMargins(0,5);
222 XRCCTRL(*
this,
"preview_autocrop_outside_tool", wxButton)->SetBitmapMargins(0, 5);
239 wxApp::s_macExitMenuItemId = XRCID(
"action_exit_preview");
241 wxMenuBar* simpleMenu=wxXmlResource::Get()->LoadMenuBar(
this, wxT(
"preview_simple_menu"));
243 m_filemenuAdvanced = wxXmlResource::Get()->LoadMenu(wxT(
"preview_file_menu_advanced"));
248 SetMenuBar(simpleMenu);
254 XRCCTRL(*
this,
"preview_background", wxColourPickerCtrl)->Refresh();
255 XRCCTRL(*
this,
"preview_background", wxColourPickerCtrl)->Update();
259 wxPanel * toggle_panel =
new wxPanel(
this);
261 bool overview_hidden;
262 cfg->Read(wxT(
"/GLPreviewFrame/overview_hidden"), &overview_hidden,
false);
263 GetMenuBar()->FindItem(XRCID(
"action_show_overview"))->Check(!overview_hidden);
266 new wxStaticBox(toggle_panel, -1, _(
"displayed images")),
270 m_ButtonPanel =
new wxScrolledWindow(toggle_panel, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
277 wxPanel *panel =
new wxPanel(toggle_panel);
278 wxBitmapBundle bitmapBundle=wxBitmapBundle::FromSVGFile(
huginApp::Get()->GetXRCPath() +
"data/preview_show_all.svg", wxSize(32, 32));
285 long mode = cfg->Read(wxT(
"/GLPreviewFrame/SelectAllMode"), 0l);
312 bitmapBundle=wxBitmapBundle::FromSVGFile(
huginApp::Get()->GetXRCPath() +
"data/preview_show_none.svg", wxSize(32, 32));
313 wxButton* select_none =
new wxButton(panel,
ID_SHOW_NONE, _(
"None"));
314 select_none->SetBitmap(bitmapBundle, wxLEFT);
315 select_none->SetBitmapMargins(5,0);
318 wxBoxSizer *sizer =
new wxBoxSizer(wxHORIZONTAL);
319 sizer->Add(
m_selectAllButton,0,wxALIGN_CENTER_VERTICAL | wxLEFT | wxTOP | wxBOTTOM,5);
320 sizer->Add(select_none,0,wxALIGN_CENTER_VERTICAL | wxRIGHT | wxTOP | wxBOTTOM,5);
321 panel->SetSizer(sizer);
325 m_topsizer->Add(tool_panel, 0, wxEXPAND | wxALL, 2);
326 m_topsizer->Add(toggle_panel, 0, wxEXPAND | wxBOTTOM, 5);
334 wxPanel * vis_panel =
new wxPanel(
this);
336 wxPanel * preview_panel =
new wxPanel(vis_panel);
337 wxPanel * overview_panel =
new wxPanel(vis_panel);
340 int args[] = {WX_GL_RGBA, WX_GL_DOUBLEBUFFER, 0};
348 overview_hidden=
false;
354 m_mgr->SetManagedWindow(vis_panel);
355 vis_panel->SetMinSize(wxSize(200,150));
358 wxFlexGridSizer * flexSizer =
new wxFlexGridSizer(2,0,5,5);
359 flexSizer->AddGrowableCol(0);
360 flexSizer->AddGrowableRow(0);
363 wxBoxSizer * overview_sizer =
new wxBoxSizer(wxVERTICAL);
374 wxDefaultPosition, wxDefaultSize,
375 wxSL_VERTICAL | wxSL_AUTOTICKS,
381 m_VFOVSlider->SetToolTip(_(
"drag to change the vertical field of view"));
382 m_VFOVSlider->Bind(wxEVT_SCROLL_CHANGED, [
this](wxScrollEvent& e) {
389 m_VFOVSlider->Bind(wxEVT_SCROLL_THUMBRELEASE, [
this](wxScrollEvent& e) {
396 m_VFOVSlider->Bind(wxEVT_SCROLL_THUMBTRACK, [
this](wxScrollEvent& e) {
412 wxDefaultPosition, wxDefaultSize,
413 wxSL_HORIZONTAL | wxSL_AUTOTICKS,
420 m_HFOVSlider->SetToolTip(_(
"drag to change the horizontal field of view"));
421 m_HFOVSlider->Bind(wxEVT_SCROLL_CHANGED, [
this](wxScrollEvent& e) {
428 m_HFOVSlider->Bind(wxEVT_SCROLL_THUMBRELEASE, [
this](wxScrollEvent& e) {
435 m_HFOVSlider->Bind(wxEVT_SCROLL_THUMBTRACK, [
this](wxScrollEvent& e) {
447 m_HFOVText = XRCCTRL(*
this,
"pano_text_hfov" ,wxTextCtrl);
451 m_VFOVText = XRCCTRL(*
this,
"pano_text_vfov" ,wxTextCtrl);
456 m_ROILeftTxt = XRCCTRL(*
this,
"pano_val_roi_left", wxTextCtrl);
461 m_ROIRightTxt = XRCCTRL(*
this,
"pano_val_roi_right", wxTextCtrl);
466 m_ROITopTxt = XRCCTRL(*
this,
"pano_val_roi_top", wxTextCtrl);
471 m_ROIBottomTxt = XRCCTRL(*
this,
"pano_val_roi_bottom", wxTextCtrl);
479 int guide=cfg->Read(wxT(
"/GLPreviewFrame/guide"),0l);
499 cfg->Read(wxT(
"/GLPreviewFrame/showPreviewGrid"),&showGrid,
true);
500 GetMenuBar()->FindItem(XRCID(
"action_show_grid"))->Check(showGrid);
502 preview_panel->SetSizer(flexSizer);
503 overview_panel->SetSizer(overview_sizer);
505 m_mgr->AddPane(preview_panel,
507 ).Name(wxT(
"preview")
510 ).CaptionVisible(
false
511 ).Caption(_(
"Preview")
518 m_mgr->AddPane(overview_panel,
520 ).Name(wxT(
"overview")
524 ).Caption(_(
"Overview")
525 ).FloatingSize(100,100
526 ).FloatingPosition(500,500
530 ).Show(!overview_hidden
549 for (
auto& lensType : lensInfoVector)
552 const int lensId = lensType.id;
553 Bind(wxEVT_MENU, [
this, lensId](wxCommandEvent&) {
LoadImages(lensId); }, lensTypeId);
592 int nP = panoProjectionFormatCount();
593 for(
int n=0; n < nP; n++) {
594 pano_projection_features proj;
595 if (panoProjectionFeaturesQuery(n, &proj)) {
596 wxString str2(proj.name, wxConvLocal);
617 cfg->Read(wxT(
"/GLPreviewFrame/individualDragMode"), &individualDrag,
false);
681 wxArtProvider::GetBitmap(wxART_REDO));
682 resetProjButton->SetToolTip(_(
"Resets the projection's parameters to their default values."));
684 m_projParamSizer->Add(resetProjButton, 0, wxLEFT | wxRIGHT | wxALIGN_CENTER_VERTICAL, 5);
690 for (
int i=0; i < PANO_PROJECTION_MAX_PARMS; i++) {
692 wxBoxSizer* paramBoxSizer =
new wxBoxSizer(wxVERTICAL);
699 wxDefaultPosition, wxSize(35,-1), wxTE_PROCESS_ENTER);
717 wxLEFT | wxRIGHT | wxALIGN_CENTER_VERTICAL ,
732 wxIconBundle myIcons(
huginApp::Get()->GetXRCPath() + wxT(
"data/hugin.ico"),wxBITMAP_TYPE_ICO);
735 wxIcon myIcon(
huginApp::Get()->GetXRCPath() + wxT(
"data/hugin.png"),wxBITMAP_TYPE_PNG);
745 this->SetBackgroundColour(
m_GLPreview->GetBackgroundColour());
749 m_degDigits = wxConfigBase::Get()->Read(wxT(
"/General/DegreeFractionalDigitsEdit"),3);
757 Bind(wxEVT_MENU_CLOSE, [
this](wxMenuEvent& e) {
m_GLPreview->Refresh(); e.Skip();});
795 if (cfg->Read(wxT(
"/GLPreviewFrame/isShown"), 0l) != 0)
797 #if defined __WXMSW__ || defined __WXMAC__
806 #if defined __WXMAC__
821 wxString OpenGLLayout=wxConfig::Get()->Read(wxT(
"/GLPreviewFrame/OpenGLLayout"));
822 if(!OpenGLLayout.IsEmpty())
824 m_mgr->LoadPerspective(OpenGLLayout,
true);
826 if(!GetMenuBar()->FindItem(XRCID(
"action_show_overview"))->IsChecked())
828 wxAuiPaneInfo &inf =
m_mgr->GetPane(wxT(
"overview"));
846 wxConfigBase * cfg = wxConfigBase::Get();
850 if ( (!this->IsIconized()) && (! this->IsMaximized()) && this->IsShown()) {
851 cfg->Write(wxT(
"/GLPreviewFrame/isShown"), 1l);
853 cfg->Write(wxT(
"/GLPreviewFrame/isShown"), 0l);
857 cfg->Write(wxT(
"/GLPreviewFrame/OpenGLLayout"),
m_mgr->SavePerspective());
858 cfg->Write(wxT(
"/GLPreviewFrame/overview_hidden"), !(GetMenuBar()->FindItem(XRCID(
"action_show_overview"))->IsChecked()));
859 cfg->Write(wxT(
"/GLPreviewFrame/showPreviewGrid"), GetMenuBar()->FindItem(XRCID(
"action_show_grid"))->IsChecked());
917 for (
int i=0; i < PANO_PROJECTION_MAX_PARMS; i++)
1034 if (opts.
getROI().area() > 0)
1037 wxString labelAspectRatio;
1040 labelAspectRatio = wxString::Format(
"%d:%d", opts.
getROI().width() / commonDivisor, opts.
getROI().height() / commonDivisor);
1044 const float ratio = 1.0f * opts.
getROI().width() / opts.
getROI().height();
1047 labelAspectRatio=wxString::Format(
"%.2f:1", ratio);
1051 labelAspectRatio=wxString::Format(
"1:%.2f", 1.0f / ratio);
1054 XRCCTRL(*
this,
"crop_aspect_label", wxStaticText)->SetLabel(labelAspectRatio);
1066 XRCCTRL(*
this,
"ass_status_text", wxStaticText)->
SetLabel(_(
"No images loaded."));
1070 bool enableCreate =
false;
1075 if (img.getYaw() != 0.0 || img.getPitch() != 0.0 || img.getRoll() != 0.0)
1077 enableCreate =
true;
1083 if (lastCmd ==
"add images" || lastCmd ==
"add and distribute images")
1085 enableCreate =
false;
1092 enableCreate =
true;
1096 enableCreate =
true;
1100 enableCreate =
true;
1111 wxString alignMsg = wxString::Format(_(
"%lu images are connected by %lu control points.\n"), (
unsigned long int) pano.
getNrOfImages(), (
unsigned long int) pano.
getCtrlPoints().size());
1118 if (comps.size() > 1)
1120 alignMsg += wxString::Format(_(
"%lu unconnected image groups found: %s\n"), static_cast<unsigned long int>(comps.size()),
Components2Str(comps).c_str());
1126 alignMsg += _(
"Images or control points have changed, new alignment is needed.");
1137 alignMsg = alignMsg + wxString::Format(_(
"Mean error after optimization: %.1f pixel, max: %.1f"), mean, max);
1142 wxStaticText* statusCtrl = XRCCTRL(*
this,
"ass_status_text", wxStaticText);
1143 statusCtrl->SetLabel(alignMsg);
1144 statusCtrl->InvalidateBestSize();
1152 XRCCTRL(*
this,
"ass_status_text", wxStaticText)->SetLabel(_(
"One image loaded."));
1163 wxString projection;
1189 bool relayout =
false;
1197 for (i=0; i < nParam; i++) {
1198 const pano_projection_parameter * pp = & (opts.
m_projFeatures.parm[i]);
1199 wxString str2(pp->name, wxConvLocal);
1200 str2 = wxGetTranslation(str2);
1204 for(;i < PANO_PROJECTION_MAX_PARMS; i++) {
1218 assert((
int) params.size() == nParam);
1219 for (
int i=0; i < nParam; i++) {
1229 SetStatusText(wxString::Format(wxT(
"%.1f x %.1f"), opts.
getHFOV(), opts.
getVFOV()),2);
1234 m_HFOVText->ChangeValue(wxString(val.c_str(), wxConvLocal));
1236 m_VFOVText->ChangeValue(wxString(val.c_str(), wxConvLocal));
1241 XRCCTRL(*
this,
"preview_autocrop_tool",wxButton)->Enable(activeImgs);
1242 XRCCTRL(*
this,
"preview_stack_autocrop_tool",wxButton)->Enable(activeImgs);
1261 GetMenuBar()->Enable(XRCID(
"action_optimize"), nrImages > 0);
1266 for (
int i=nrButtons-1; i>=(int)nrImages; i--)
1309 if ( nrImages >= nrButtons ) {
1310 for(HuginBase::UIntSet::const_iterator it = changed.begin(); it != changed.end(); ++it){
1311 if (*it >= nrButtons) {
1317 wxBoxSizer * siz =
new wxBoxSizer(wxVERTICAL);
1319 wxToggleButton * but =
new wxToggleButton(pan,
1321 wxString::Format(wxT(
" %d "),*it),
1322 wxDefaultPosition, wxDefaultSize,
1325 wxCheckBox *butcheck =
new wxCheckBox(pan, wxID_ANY, wxT(
""));
1327 #if defined __WXMSW__ || defined __WXMAC__
1331 siz->Add(butcheck, 0, wxALIGN_CENTRE_HORIZONTAL | wxFIXED_MINSIZE, 0);
1332 siz->Add(but,0,wxLEFT | wxRIGHT | wxBOTTOM , 5);
1334 siz->Add(but,0,wxALL ,0);
1335 siz->Add(butcheck, 0, wxALL | wxFIXED_MINSIZE, 0);
1345 but->PushEventHandler(event_handler);
1355 butcheck->PushEventHandler(group_event_handler);
1358 but->SetValue(
true);
1373 for (
unsigned i=0; i < nrImages; i++) {
1417 bool toggle_on = GetMenuBar()->FindItem(XRCID(
"action_show_overview"))->IsChecked();
1418 wxAuiPaneInfo &inf =
m_mgr->GetPane(wxT(
"overview"));
1421 if (!inf.IsShown() && toggle_on ) {
1426 if (inf.IsFloating() && inf.IsShown()) {
1445 if (GetMenuBar()->FindItem(XRCID(
"action_show_overview"))->IsChecked()) {
1465 if (GetMenuBar()->FindItem(XRCID(
"action_show_overview"))->IsChecked()) {
1486 bool toggle_on = GetMenuBar()->FindItem(XRCID(
"action_show_overview"))->IsChecked();
1487 wxAuiPaneInfo &inf =
m_mgr->GetPane(wxT(
"overview"));
1489 if (inf.IsShown() && !toggle_on) {
1493 }
else if (!(inf.IsShown() && toggle_on)) {
1495 #if defined __WXMSW__ || defined __WXMAC__
1508 if(GetMenuBar()->FindItem(XRCID(
"action_show_grid"))->IsChecked())
1530 if (event.CanVeto())
1540 if (event.CanVeto())
1556 void PreviewFrame::OnProjectionChanged()
1562 case PanoramaOptions::RECTILINEAR: Ip = _(
"Rectilinear");
break;
1563 case PanoramaOptions::CYLINDRICAL: Ip = _(
"Cylindrical");
break;
1564 case PanoramaOptions::EQUIRECTANGULAR: Ip = _(
"Equirectangular");
break;
1566 opt.projectionFormat = (PanoramaOptions::ProjectionFormat) lt;
1570 DEBUG_DEBUG (
"Projection changed: " << lt <<
":" << Ip )
1633 for (
size_t i = 0; i < stackedImg.size(); ++i)
1638 displayedImgs.insert(*(stackedImg[i].rbegin()));
1641 displayedImgs.insert(*(stackedImg[i].begin()));
1645 displayedImgs.insert(stackedImg[i][stackedImg[i].size() / 2]);
1685 text = XRCCTRL(*
this,
"input_yaw",wxTextCtrl)->GetValue();
1689 wxMessageBox(_(
"Yaw value must be numeric."),_(
"Warning"),wxOK | wxICON_ERROR,
this);
1692 text = XRCCTRL(*
this,
"input_pitch",wxTextCtrl)->GetValue();
1696 wxMessageBox(_(
"Pitch value must be numeric."),_(
"Warning"),wxOK | wxICON_ERROR,
this);
1699 text = XRCCTRL(*
this,
"input_roll",wxTextCtrl)->GetValue();
1703 wxMessageBox(_(
"Roll value must be numeric."),_(
"Warning"),wxOK | wxICON_ERROR,
this);
1713 text = XRCCTRL(*
this,
"input_x",wxTextCtrl)->GetValue();
1717 wxMessageBox(_(
"X value must be numeric."),_(
"Warning"),wxOK | wxICON_ERROR,
this);
1720 text = XRCCTRL(*
this,
"input_y",wxTextCtrl)->GetValue();
1724 wxMessageBox(_(
"Y value must be numeric."),_(
"Warning"),wxOK | wxICON_ERROR,
this);
1727 text = XRCCTRL(*
this,
"input_z",wxTextCtrl)->GetValue();
1731 wxMessageBox(_(
"Z value must be numeric."),_(
"Warning"),wxOK | wxICON_ERROR,
this);
1746 DEBUG_INFO (
"target exposure = " << text.mb_str(wxConvLocal) );
1748 if (text != wxT(
"")) {
1750 wxLogError(_(
"Value must be numeric."));
1783 if (!text.IsEmpty())
1788 wxLogError(_(
"Value must be numeric."));
1793 wxLogError(_(
"Value for range compression is outside of valid range."));
1812 for (
int i = 0; i < nParam; i++) {
1815 DEBUG_INFO (
"param " << i <<
": = " << text.mb_str(wxConvLocal) );
1817 if (text != wxT(
"")) {
1819 wxLogError(_(
"Value must be numeric."));
1846 for (
int i = 0; i < nParam; i++)
1851 para[i] = e.GetInt();
1866 for (
int i = 0; i < nParam; i++)
1871 para[i] = e.GetInt();
1917 if(wxMessageBox(_(
"The mosaic/plane mode works only correct for a remapping plane of yaw=0 and pitch=0.\nBut your project has non-zero Tpy and Tpp parameters.\nShould the Tpy and Tpp parameters reset to zero?"),
1923 wxYES_NO | wxICON_QUESTION,
this) == wxYES)
1957 for (
size_t i = 0 ; i < nr; i++)
1973 for (
size_t i = 0 ; i < nr ; i++)
1976 img.setTranslationPlaneYaw(0);
1977 img.setTranslationPlanePitch(0);
2013 if(wxMessageBox(_(
"The mosaic/plane mode works only correct for a remapping plane of yaw=0 and pitch=0.\nBut your project has non-zero Tpy and Tpp parameters.\nShould the Tpy and Tpp parameters reset to zero?"),
2019 wxYES_NO | wxICON_QUESTION,
this) == wxYES)
2072 bool normalMode=index==0 || index==1;
2073 XRCCTRL(*
this,
"label_yaw",wxStaticText)->Show(normalMode);
2074 XRCCTRL(*
this,
"input_yaw",wxTextCtrl)->Show(normalMode);
2075 XRCCTRL(*
this,
"label_pitch",wxStaticText)->Show(normalMode);
2076 XRCCTRL(*
this,
"input_pitch",wxTextCtrl)->Show(normalMode);
2077 XRCCTRL(*
this,
"label_roll",wxStaticText)->Show(normalMode);
2078 XRCCTRL(*
this,
"input_roll",wxTextCtrl)->Show(normalMode);
2079 XRCCTRL(*
this,
"label_x",wxStaticText)->Show(!normalMode);
2080 XRCCTRL(*
this,
"input_x",wxTextCtrl)->Show(!normalMode);
2081 XRCCTRL(*
this,
"label_y",wxStaticText)->Show(!normalMode);
2082 XRCCTRL(*
this,
"input_y",wxTextCtrl)->Show(!normalMode);
2083 XRCCTRL(*
this,
"label_z",wxStaticText)->Show(!normalMode);
2084 XRCCTRL(*
this,
"input_z",wxTextCtrl)->Show(!normalMode);
2086 XRCCTRL(*
this,
"apply_num_transform",wxButton)->GetParent()->Layout();
2156 SetStatusText(message, 0);
2187 if(GetMenuBar()->FindItem(XRCID(
"action_show_grid"))->IsChecked())
2216 if(GetMenuBar()->FindItem(XRCID(
"action_show_grid"))->IsChecked())
2253 SetStatusText(wxT(
""), 0);
2284 SetStatusText(wxT(
""), 0);
2303 std::set<Tool*>::iterator i;
2304 for (i = tools.begin(); i != tools.end(); ++i)
2325 XRCCTRL(*
this,
"preview_control_point_tool",wxCheckBox)->SetValue(
false);
2335 unsigned char green,
2340 #if defined __WXMSW__ || defined __WXMAC__
2341 if (red || green || blue)
2355 if (red || green || blue)
2359 m_ToggleButtons[image_nr]->SetBackgroundColour(wxColour(red, green, blue));
2380 for (
unsigned image = 0; image < nr_images; image++)
2382 #if defined __WXMSW__ || defined __WXMAC__
2397 SetStatusText(wxT(
""), 0);
2421 wxCommandEvent e(wxEVT_COMMAND_TOOL_CLICKED, XRCID(
"preview_color_picker_tool"));
2423 GetEventHandler()->AddPendingEvent(e);
2429 SetStatusText(wxT(
""), 0);
2441 if (!XRCCTRL(*
this,
"preview_control_point_tool", wxCheckBox)->GetValue())
2451 unsigned int image_number_in,
2452 wxToggleButton* identify_button_in,
2473 std::vector<PreviewIdentifyTool**>::iterator it;
2489 std::vector<PreviewIdentifyTool**>::iterator it;
2491 (*(*it))->StopShowingImages();
2504 wxMouseEvent null_event;
2505 if (e.IsChecked()) {
2525 : image_number(image_number), frame(frame_in), m_pano(m_pano)
2542 std::vector<PreviewIdentifyTool**>::iterator it;
2555 std::vector<PreviewIdentifyTool**>::iterator it;
2557 (*(*it))->StopShowingImages();
2565 wxMouseEvent null_event;
2566 if (e.IsChecked()) {
2594 if (update_check_box) {
2600 if (update_check_box) {
2606 std::vector<wxCheckBox*>::iterator it;
2607 unsigned int nr = 0;
2617 std::vector<wxCheckBox*>::iterator it;
2619 (*it)->SetValue(
false);
2625 std::vector<wxCheckBox*>::iterator it;
2628 (*it)->Show(isShown);
2643 unsigned int oldMode = wxConfigBase::Get()->Read(wxT(
"/GLPreviewFrame/blendMode"), 0l);
2661 vigra::Rect2D newROI;
2673 if(!newROI.isEmpty())
2691 vigra::Rect2D newROI;
2699 if (stackImgs.size()<activeImages.size())
2701 cropPano.setStacks(stackImgs);
2704 if (cropPano.hasRunSuccessfully())
2706 newROI = cropPano.getResultOptimalROI();
2711 if(!newROI.isEmpty())
2729 vigra::Rect2D newROI;
2741 if (!newROI.isEmpty())
2753 ShowFullScreen(!IsFullScreen(), wxFULLSCREEN_NOBORDER | wxFULLSCREEN_NOCAPTION);
2760 SetStatusText(wxT(
""), 0);
2782 XRCCTRL(*
this,
"preview_control_point_tool",wxCheckBox)->SetValue(
false);
2810 std::vector<wxCheckBox*>::iterator it;
2823 wxScrollEvent dummy;
2860 std::vector<wxCheckBox*>::iterator it;
2895 long left, right, top, bottom;
2897 wxLogError(_(
"Top needs to be an integer bigger than 0"));
2901 wxLogError(_(
"left needs to be an integer bigger than 0"));
2905 wxLogError(_(
"right needs to be an integer bigger than 0"));
2909 wxLogError(_(
"bottom needs to be an integer bigger than 0"));
2912 opt.
setROI(vigra::Rect2D(left, top, right, bottom));
2914 if(opt.
getROI().width()<1) {
2915 wxLogError(_(
"left boundary must be smaller than right"));
2920 if(opt.
getROI().height()<1) {
2921 wxLogError(_(
"top boundary must be smaller than bottom"));
2942 if (dlg.ShowModal() == wxID_OK)
2947 int left = opt.
getROI().left();
2948 int top = opt.
getROI().top();
2949 int width = opt.
getROI().width();
2950 int height = opt.
getROI().height();
2951 const int newHeight = 1.0 * width / aspectRatio;
2952 if (newHeight > height)
2954 const int newWidth = 1.0 * height * aspectRatio;
2955 left = left + (width - newWidth) / 2.0;
2960 top = top + (height - newHeight) / 2.0;
2964 opt.
setROI(vigra::Rect2D(left, top, left + width, top + height));
2975 DEBUG_INFO (
"HFOV = " << text.mb_str(wxConvLocal) );
2976 if (text == wxT(
"")) {
2982 wxLogError(_(
"Value must be numeric."));
2987 wxLogError(wxString::Format(
2988 _(
"Invalid HFOV value. Maximum HFOV for this projection is %lf."),
3006 DEBUG_INFO (
"VFOV = " << text.mb_str(wxConvLocal) );
3007 if (text == wxT(
"")) {
3013 wxLogError(_(
"Value must be numeric."));
3018 wxLogError(wxString::Format(
3019 _(
"Invalid VFOV value. Maximum VFOV for this projection is %lf."),
3036 double scale_factor=XRCCTRL(*
this,
"layout_scale_slider",wxSlider)->GetValue();
3049 double maxfov = hfov > vfov ? hfov : vfov;
3052 bool rectilinear_option =
false;
3055 if (maxfov > 120.0) {
3057 message = _(
"With a wide field of view, panoramas with rectilinear projection get very stretched towards the edges.\n");
3059 message += _(
"Since the field of view is only very wide in the horizontal direction, try a cylindrical projection instead.");
3061 message += _(
"For a very wide panorama, try equirectangular projection instead.");
3063 message += wxT(
" ");
3064 message += _(
"You could also try Panini projection.");
3069 message = _(
"With a wide vertical field of view, panoramas with cylindrical projection get very stretched at the top and bottom.\nAn equirectangular projection would fit the same content in less vertical space.");
3070 }
else rectilinear_option =
true;
3073 if (vfov < 110.0 && hfov > 120.0)
3075 message = _(
"Since the vertical field of view is not too wide, you could try setting the panorama projection to cylindrical.\nCylindrical projection preserves vertical lines, unlike equirectangular.");
3076 }
else rectilinear_option =
true;
3079 if (maxfov < 280.0) {
3080 rectilinear_option =
true;
3081 message = _(
"Stereographic projection is conformal, unlike this Fisheye panorama projection.\nA conformal projection preserves angles around a point, which often makes it easier on the eye.");
3085 if (maxfov > 300.0) {
3086 message = _(
"Panoramas with stereographic projection and a very wide field of view stretch the image around the edges a lot.\nThe Fisheye panorama projection compresses it, so you can fit in a wide field of view and still have a reasonable coverage of the middle.");
3087 }
else rectilinear_option =
true;
3090 rectilinear_option =
true;
3092 if (rectilinear_option && maxfov < 110.0) {
3093 message = _(
"Setting the panorama to rectilinear projection would keep the straight lines straight.");
3095 if (message.IsEmpty()) {
3099 m_infoBar->ShowMessage(message, wxICON_INFORMATION);
3114 wxMessageBox(_(
"You have hidden the infobar, which shows hints about selection of projection.\nIf you want to see the bar again, activate the bar in the preferences again."),
3120 wxOK | wxICON_INFORMATION,
this);
3122 wxConfigBase* cfg=wxConfigBase::Get();
3123 cfg->Write(wxT(
"/GLPreviewFrame/ShowProjectionHints"),
false);
3148 wxConfigBase* cfg=wxConfigBase::Get();
3149 cfg->Write(wxT(
"/GLPreviewFrame/PreviewBackground"), c);
3165 int selection=e.GetSelection();
3178 if(old_selection==wxNOT_FOUND)
3203 wxCommandEvent dummy;
3226 wxApp::s_macExitMenuItemId = XRCID(
"action_exit_preview");
3230 GetMenuBar()->Remove(0);
3238 wxApp::s_macExitMenuItemId = XRCID(
"action_exit_hugin");
3242 GetMenuBar()->Remove(0);
3245 SetTitle(_(
"Fast Panorama preview"));
3252 GetMenuBar()->FindItem(XRCID(
"action_gui_simple"))->Check();
3255 GetMenuBar()->FindItem(XRCID(
"action_gui_advanced"))->Check();
3258 GetMenuBar()->FindItem(XRCID(
"action_gui_expert"))->Check();
3300 if (wxConfig::Get()->Read(wxT(
"/ShowFisheyeCropHint"), 1l) == 1)
3304 wxXmlResource::Get()->LoadDialog(&dlg, NULL, wxT(
"fisheye_show_crop_dlg"));
3305 if (dlg.ShowModal() == wxID_OK)
3309 if (XRCCTRL(dlg,
"fisheye_crop_dont_ask_checkbox", wxCheckBox)->IsChecked())
3311 wxConfig::Get()->Write(wxT(
"/ShowFisheyeCropHint"), 0l);
3336 const long autoAlign = wxConfigBase::Get()->Read(wxT(
"/Assistant/autoAlign"),
HUGIN_ASS_AUTO_ALIGN);
3340 wxCommandEvent dummy;
3345 std::vector<PanoCommand::PanoCommand*> cmds;
3346 cmds.push_back(cmd);
3347 if(distributeImages)
3353 combinedCmd->
setName(
"add and distribute images");
3360 HuginBase::FileMetaData::const_iterator pos = metaData.find(
"readProjectionFromDB");
3361 if(!(pos != metaData.end() && pos->second ==
"true"))
3378 if(dlg.ShowModal()==wxID_OK)
3383 wxCommandEvent dummy;
3394 long afterEditCPAction = wxConfig::Get()->Read(wxT(
"/EditCPAfterAction"), 0l);
3396 if (afterEditCPAction == 0)
3399 wxXmlResource::Get()->LoadDialog(&dlg,
this, wxT(
"edit_cp_optimize_dialog"));
3400 XRCCTRL(dlg,
"edit_cp_text1", wxStaticText)->SetLabel(wxString::Format(_(
"%lu control points were removed from the panorama.\n\nShould the panorama now be re-optimized?"), static_cast<unsigned long int>(
edit_cp_tool->
GetFoundCPs().size())));
3401 XRCCTRL(dlg,
"edit_cp_text2", wxStaticText)->SetLabel(wxString::Format(_(
"Current selected optimizer strategy is \"%s\"."),
MainFrame::Get()->GetCurrentOptimizerString().c_str()));
3403 optimize = (dlg.ShowModal() == wxID_OK);
3404 if (XRCCTRL(dlg,
"edit_cp_dont_show_again_checkbox", wxCheckBox)->GetValue())
3408 wxConfig::Get()->Write(wxT(
"/EditCPAfterAction"), 1l);
3412 wxConfig::Get()->Write(wxT(
"/EditCPAfterAction"), 2l);
3418 optimize = (afterEditCPAction == 1);
3423 wxCommandEvent ev(wxEVT_COMMAND_BUTTON_CLICKED, XRCID(
"action_optimize"));
3430 #define MAX_DIMENSION 1600
3451 wxMessageBox(_(
"The selected region contains no active image.\nPlease select a region which is covered by at least 2 images."),
3457 wxOK | wxICON_INFORMATION,
this);
3460 if (imgs.size() < 2)
3462 wxMessageBox(_(
"The selected region is only covered by a single image.\nCan't create control points for a single image."),
3468 wxOK | wxICON_INFORMATION,
this);
3473 if(wxMessageBox(_(
"The selected rectangle is very big.\nThis function is only intended for smaller areas. Otherwise unwanted side effect can appear.\n\nProceed anyway?"),
3479 wxYES_NO | wxICON_INFORMATION,
this) == wxNO)
3502 for (HuginBase::UIntSet::const_iterator it = imgs.begin(); it != imgs.end(); ++it)
3504 const size_t imgNr = *it;
3505 if (!progress.updateDisplayValue(_(
"Remap image to panorama projection...")))
3510 findStruct.
imgNr = imgNr;
3517 srcImg.setExposureValue(0);
3520 if (!progress.updateDisplay())
3528 cpInfos.push_back(findStruct);
3530 if (cpInfos.size() > 1)
3534 unsigned gridx =
hugin_utils::roundi(sqrt((
double)roi.width() / (double)roi.height() * 25));
3544 while (roi.width() / gridx < 20 && gridx > 1)
3548 while (roi.height() / gridy < 20 && gridy > 1)
3553 const long templWidth = 20;
3555 const long sWidth = 100;
3557 for (
size_t img1 = 0; img1 < cpInfos.size() - 1; ++img1)
3559 if (!progress.updateDisplayValue(_(
"Matching interest points...")))
3563 vigra::Size2D size(cpInfos[img1].image.width(), cpInfos[img1].image.height());
3565 std::vector<vigra::Rect2D> rects;
3566 for (
unsigned party = 0; party < gridy; party++)
3568 for (
unsigned partx = 0; partx < gridx; partx++)
3570 vigra::Rect2D rect(partx*size.x / gridx, party*size.y / gridy,
3571 (partx + 1)*size.x / gridx, (party + 1)*size.y / gridy);
3572 rect &= vigra::Rect2D(size);
3573 if (rect.width()>0 && rect.height()>0)
3575 rects.push_back(rect);
3580 if (!progress.updateDisplay())
3585 #pragma omp parallel for schedule(dynamic)
3586 for (
int i = 0; i < rects.size(); ++i)
3589 vigra::Rect2D rect(rects[i]);
3593 MapPoints validPoints;
3594 for (MapPoints::const_iterator it = points.begin(); it != points.end(); ++it)
3596 if (cpInfos[img1].mask(it->second.x, it->second.y)>0)
3598 validPoints.insert(*it);
3602 if (!validPoints.empty())
3605 for (
size_t img2 = img1 + 1; img2 < cpInfos.size(); ++img2)
3609 for (MapPoints::const_reverse_iterator it = validPoints.rbegin(); it != validPoints.rend(); ++it)
3617 if (cpInfos[img2].mask(it->second.x, it->second.y) == 0)
3623 cpInfos[img2].image, vigra::RGBToGrayAccessor<vigra::RGBValue<vigra::UInt8> >(), it->second, sWidth);
3640 cpInfos[img1].image.resize(0, 0);
3641 cpInfos[img1].mask.resize(0, 0);
3645 for (
size_t i = 0; i < tempCps.size(); ++i)
3678 if (!progress.updateDisplayValue(_(
"Checking results...")))
3685 if (!invalidCP.empty())
3687 for (HuginBase::UIntSet::const_reverse_iterator it = invalidCP.rbegin(); it != invalidCP.rend(); ++it)
3689 cps.erase(cps.begin() + *it);
3693 if (!progress.updateDisplayValue())
3699 long afterEditCPAction = wxConfig::Get()->Read(wxT(
"/EditCPAfterAction"), 0l);
3701 if (afterEditCPAction == 0)
3706 wxXmlResource::Get()->LoadDialog(&dlg,
this, wxT(
"edit_cp_optimize_dialog"));
3707 XRCCTRL(dlg,
"edit_cp_text1", wxStaticText)->SetLabel(wxString::Format(_(
"%lu control points were added to the panorama.\n\nShould the panorama now be re-optimized?"), static_cast<unsigned long int>(cps.size())));
3708 XRCCTRL(dlg,
"edit_cp_text2", wxStaticText)->SetLabel(wxString::Format(_(
"Current selected optimizer strategy is \"%s\"."),
MainFrame::Get()->GetCurrentOptimizerString().c_str()));
3710 optimize = (dlg.ShowModal() == wxID_OK);
3711 if (XRCCTRL(dlg,
"edit_cp_dont_show_again_checkbox", wxCheckBox)->GetValue())
3715 wxConfig::Get()->Write(wxT(
"/EditCPAfterAction"), 1l);
3719 wxConfig::Get()->Write(wxT(
"/EditCPAfterAction"), 2l);
3725 optimize = (afterEditCPAction == 1);
3730 wxCommandEvent ev(wxEVT_COMMAND_BUTTON_CLICKED, XRCID(
"action_optimize"));
3743 wxConfig::Get()->Write(wxT(
"/GLPreviewFrame/SelectAllMode"), 0l);
3749 wxConfig::Get()->Write(wxT(
"/GLPreviewFrame/SelectAllMode"), 1l);
3755 wxConfig::Get()->Write(wxT(
"/GLPreviewFrame/SelectAllMode"), 2l);
3761 wxConfig::Get()->Write(wxT(
"/GLPreviewFrame/SelectAllMode"), 3l);
3767 wxConfig::Get()->Write(wxT(
"/GLPreviewFrame/SelectAllKeepSelection"),
true);
3773 wxConfig::Get()->Write(wxT(
"/GLPreviewFrame/SelectAllKeepSelection"),
false);
HuginBase::UIntSet GetDragGroupImages()
AlphaImage m_mask
corresponding alpha channel
Base class for all panorama commands.
wxTextCtrl * m_rangeCompressionTextCtrl
PlaneOverviewCameraTool * plane_overview_camera_tool
SelectAllMode m_selectAllMode
HuginBase::Panorama & m_pano
int gcd(int a, int b)
function to calculate greated common divisor using Euclidean algorithm both arguments should be >=0 ...
PanoramaOptions::ProjectionFormat getProjection() const
#define HUGIN_SHOW_PROJECTION_HINTS
void OnRangeCompressionDecrease(wxSpinEvent &e)
std::vector< UIntSet > getHDRStacks(const PanoramaData &pano, UIntSet allImgs, PanoramaOptions opts)
returns vector of set of output stacks
wxSpinButton * m_exposureSpinBut
update variables of a group of images
declaration of functions to handle stacks and layers
std::vector< wxToggleButton * > m_ToggleButtons
void OnRemoveCP(wxCommandEvent &e)
handler to remove cp
PreviewCropTool * crop_tool
void OnControlPoint(wxCommandEvent &e)
PreviewDifferenceTool * panosphere_difference_tool
double outputRangeCompression
void OnCreate(wxCommandEvent &e)
wxGLContext * GetContext()
PreviewIdentifyTool * identify_tool
void SetStatusMessage(wxString message)
The OpenGL preview frame.
virtual PanoCommand::PanoCommand * GetCommand(wxWindow *parent, HuginBase::Panorama &pano, HuginBase::UIntSet images, GuiLevel guiLevel)
returns the appropriate PanoCommand::PanoCommand to be inserted into GlobalCmdHistory, checks if operation is enabled
void setHeight(unsigned int h)
set panorama height
void OnIdentify(wxCommandEvent &e)
pano_projection_features m_projFeatures
wxChoice * m_DragModeChoice
wxColour GetPreviewBackgroundColor()
void OnShowAll(wxCommandEvent &e)
void StorePositionAndSize()
store position and size of window in wxConfig
#define HUGIN_PREVIEW_BACKGROUND
virtual double getResultMean()
void setPanoImage(const SrcPanoImage &src, const PanoramaOptions &dest, vigra::Rect2D roi)
static double calcMeanExposure(const PanoramaData &pano)
bool str2double(const wxString &s, double &d)
void AddUserDefinedAssistant(int id, const wxString &desc, const wxString &help)
adds the given user defined assistant to SplitButton menu
SrcPanoImage getSrcImage(unsigned imgNr) const
get a description of a source image
PreviewDragTool * drag_tool
GLwxAuiFloatingFrame * CreateFloatingFrame(wxWindow *parent, const wxAuiPaneInfo &p)
std::vector< ImageToogleButtonEventHandler * > toogle_button_event_handlers
PanosphereOverviewCameraTool * panosphere_overview_camera_tool
void OnColorPicker(wxCommandEvent &e)
event handler when starting color picker
center panorama horizontically
void ClearDragGroupImages(bool update_check_box=true)
bool isCircularCrop() const
returns true, if projection requires cicular crop
bool fovCalcSupported(ProjectionFormat f) const
true, if FOV calcuations are supported for projection f
bool removeObserver(PanoramaObserver *observer)
remove a panorama observer.
void ToggleImageInDragGroup(unsigned int image_nr, bool update_check_box=true)
void OnVFOVChanged(wxCommandEvent &e)
virtual void SetLayoutScale(double scale)
wxPanel * m_overviewCommandPanel
void OnOverviewToggle(wxCommandEvent &e)
wxTextCtrl * m_ROIRightTxt
void SetPhotometricCorrect(bool state)
SplitButton * m_createButton
CorrelationResult PointFineTune(const IMAGET &templImg, ACCESSORT access_t, vigra::Diff2D templPos, int templSize, const IMAGES &searchImg, ACCESSORS access_s, vigra::Diff2D searchPos, int sWidth)
fine tune a point with normalized cross correlation
void OnDecreaseExposure(wxSpinEvent &e)
wxBitmapButton * m_defaultExposureBut
void RunAssistant(wxWindow *mainWin, const wxString &userdefinedAssistant=wxEmptyString)
void registerPTWXDlgFcn()
void OnSwitchPreviewGrid(wxCommandEvent &e)
event handler for switch on/off grid on preview
unsigned int getHeight() const
get panorama height
void SetActive(bool active)
UIntSet getImagesinROI(const PanoramaData &pano, const UIntSet activeImages)
returns set of images which are visible in output ROI
void OnShowMainFrame(wxCommandEvent &e)
event handler to show main frame
void Resized(wxSizeEvent &e)
double getMaxHFOV() const
get maximum possible hfov with current projection
wxColour m_preview_background_color
virtual void setName(const std::string &newName)
sets the name for the command
PreviewLayoutLinesTool * m_plane_layoutLinesTool
std::vector< wxCheckBox * > m_GroupToggleButtons
void AddImageToDragGroup(unsigned int image_nr, bool update_check_box=true)
void deregisterPTWXDlgFcn()
Dialog for setting output parameters for simple user interface.
wxChoice * m_ProjectionChoice
std::size_t getNrOfCtrlPoints() const
number of control points
bool set_contains(const _Container &c, const typename _Container::key_type &key)
#define DEBUG_ASSERT(cond)
PreviewIdentifyTool * plane_overview_identify_tool
void OnSelectDarkestMenu(wxCommandEvent &e)
HuginBase::ImageCache::ImageCacheRGB8Ptr ImageCacheRGB8Ptr
void setProjectionParameters(const std::vector< double > ¶ms)
set the optional parameters (they need to be of the correct size)
PreviewPanoMaskTool * pano_mask_tool
simple class that forward the drop to the mainframe
include file for the hugin project
int non_layout_blend_mode
void ForceRequireRedraw()
wxNotebook * m_tool_notebook
void InitPreviews()
init previews
virtual void run()
runs the algorithm.
Panorama getSubset(const UIntSet &imgs) const
get a subset of the panorama
const CPVector & getCtrlPoints() const
get all control point of this Panorama
PreviewControlPointTool * preview_control_point_tool
std::vector< wxPanel * > m_ToggleButtonPanel
void UpdateRoiDisplay(const HuginBase::PanoramaOptions opts)
update display of ROI
void OnPhotometric(wxCommandEvent &e)
wxTextCtrl * m_ROILeftTxt
remove several control points
represents a control point
PreviewDifferenceTool * plane_difference_tool
Definition of PanoOperation class.
void CleanButtonColours()
void findInterestPointsPartial(vigra::triple< ImageIter, ImageIter, ImageAcc > img, const vigra::Rect2D &rect, double scale, unsigned nPoints, std::multimap< double, vigra::Diff2D > &points)
void RemoveImageFromDragGroup(unsigned int image_nr, bool update_check_box=true)
wxChoice * m_GuideChoiceCrop
PanosphereOverviewOutlinesTool * overview_outlines_tool
std::vector< HuginBase::UIntSet > Components
stores the components of the graph
std::string doubleToString(double d, int digits)
convert a double to a string, suitable for display within a GUI.
static huginApp * Get()
hack.. kind of a pseudo singleton...
PanosphereSphereTool * panosphere_sphere_tool
void FillBlendChoice()
fills the blend wxChoice with all valid blend modes and restore the last used one ...
void OnActivate(wxActivateEvent &evt)
wxChoice * m_GuideChoiceDrag
PanoCommand to combine other PanoCommands.
Panorama duplicate() const
duplicate the panorama
wxStaticBoxSizer * m_ToggleButtonSizer
void OnSetCropAspect(wxCommandEvent &e)
event handler to set fixed aspect ratio of crop
void OnAutocropOutside(wxCommandEvent &e)
static hugin_omp::Lock cpLock
std::set< unsigned int > UIntSet
GLwxAuiFloatingFrame(wxWindow *parent, GLwxAuiManager *owner_mgr, const wxAuiPaneInfo &pane, wxWindowID id=wxID_ANY, long style=wxRESIZE_BORDER|wxSYSTEM_MENU|wxCAPTION|wxFRAME_FLOAT_ON_PARENT|wxCLIP_CHILDREN)
void OnDefaultExposure(wxCommandEvent &e)
bool individualDragging()
void OnOverviewModeChoice(wxCommandEvent &e)
algorithms for remove control points by statistic method
void OnProjParameterChanged(wxCommandEvent &e)
HuginBase::PanoramaOptions GetNewPanoramaOptions()
void LoadOpenGLLayout()
loads the layout of the OpenGL windows and restores it
wxChoice * m_ProjectionChoice
const vigra::Rect2D & getROI() const
void SetMode(OverviewMode mode)
wxSpinButton * m_rangeCompressionSpinBut
void OnHFOVChanged(wxCommandEvent &e)
void OnExposureChanged(wxCommandEvent &e)
wxMenu * m_filemenuSimple
wxBoxSizer * m_ButtonSizer
virtual ~GLPreviewFrame()
dtor.
PreviewLayoutLinesTool * m_panosphere_layoutLinesTool
void OnStackAutocrop(wxCommandEvent &e)
GLwxAuiManager * m_mgr
The dock manager.
void MakePreviewTools(PreviewToolHelper *helper)
void SetMode(int newMode)
virtual void panoramaImagesChanged(HuginBase::Panorama &pano, const HuginBase::UIntSet &changed)
notifies about changes to images
VariableMapVector getVariables() const
get variables of this panorama
void OnFullScreen(wxCommandEvent &e)
event handler for full screen
void OnSelectMedianMenu(wxCommandEvent &e)
std::vector< wxSlider * > m_projParamSlider
wxScrolledWindow * m_ButtonPanel
void OnLayoutScaleChange(wxCommandEvent &e)
event handler for change scale of layout mode
void resetProjectionParameters()
sets the optional parameters to their default values
void SetDragGroupImages(HuginBase::UIntSet imageDragGroup_in, bool update_check_box=true)
std::size_t getNrOfImages() const
number of images.
static MainFrame * Get()
hack.. kind of a pseudo singleton...
Definition of PanoOutputDialog class.
void AddUserDefinedSequence(int id, const wxString &desc, const wxString &help)
adds the given user defined output sequence to SplitButton menu
void SetGuiLevel(GuiLevel newLevel)
sets the gui level
void setCtrlPoints(const CPVector &points)
set all control points (Ippei: Is this supposed to be 'add' method?)
SplitButton * m_selectAllButton
void StoreFramePosition(wxTopLevelWindow *frame, const wxString &basename)
Store window size and position in configfile/registry.
float pow(float a, double b)
void redrawPreview()
Display an updated version of the preview images.
void remapImage(vigra::triple< ImgIter, ImgIter, ImgAccessor > srcImg, vigra_ext::Interpolator interpol, AppBase::ProgressDisplay *progress, bool singleThreaded=false)
remap a image without alpha channel
PreviewIdentifyTool * panosphere_overview_identify_tool
virtual vigra::Rect2D getResultOptimalROI()
return the ROI structure?, for now area
void OnSelectKeepSelection(wxCommandEvent &e)
wxMenu * m_filemenuAdvanced
RemapImage m_image
remapped image
double getMaxVFOV() const
get maximum possible vfov with current projection
Definition of dialog for selecting and editing aspect ratios of crop.
virtual double getResultMax()
virtual double getResultHeight()
std::vector< FindStruct > FindVector
PanoOperation to add several user selected images to the panorama.
PlaneOverviewOutlinesTool * plane_overview_outlines_tool
std::vector< wxTextCtrl * > m_projParamTextCtrl
Maximum of correlation, position and value.
std::string getLastCommandName() const
returns the name of the last command
wxInfoBar * m_infoBar
Bar for context sensitive projection information.
void OnToolModeChanging(wxNotebookEvent &e)
event handler for blocking changing mode when panorama contains no images
wxToggleButton * m_editCP_togglebutton
wxwindows specific panorama commands
std::map< std::string, std::string > FileMetaData
typedef for general map for storing metadata in files
SplitButton * m_loadImagesButton
std::vector< HuginBase::UIntVector > getSortedStacks(const HuginBase::Panorama *pano)
returns vector of UIntVector with image numbers of each stack sorted by exposure
PreviewControlPointTool * plane_control_point_tool
distributes all images above the sphere, for the assistant
wxPanel * m_projection_panel
void OnRangeCompressionChanged(wxCommandEvent &e)
void SetShowProjectionHints(bool new_value)
set status if projection hints should be shown or not
void UpdateIdentifyTools(std::set< unsigned int > new_image_set)
void RestoreFramePosition(wxTopLevelWindow *frame, const wxString &basename)
Restore window size and position from configfile/registry.
static GlobalCmdHist & getInstance()
PanosphereOverviewToolHelper * panosphere_overview_helper
virtual void SetLayoutMode(bool state)
std::multimap< double, vigra::Diff2D > MapPoints
void MakePanosphereOverviewTools(PanosphereOverviewToolHelper *helper)
void ShowMaskEditor(size_t imgNr, bool switchToCropMode=false)
opens the mask/crop editor with the given image selected
std::vector< ImageGroupButtonEventHandler * > toggle_group_button_event_handlers
wxToggleButton * m_identify_togglebutton
void addCommand(PanoCommand *command, bool execute=true)
Adds a command to the history.
void OnProjectionChoice(wxCommandEvent &e)
PreviewControlPointTool * panosphere_control_point_tool
PanosphereOverviewProjectionGridTool * overview_projection_grid
bool stringToDouble(const STR &str_, double &dest)
convert a string to a double, ignore localisation.
double GetSelectedAspectRatio() const
returns the selected aspect ratio
VisualizationState * m_visualization_state
void EnableGroupCheckboxes(bool isShown)
changes the visibility of the group check boxes
void OnSelectMode(wxNotebookEvent &e)
event handler for selection of new mode
void setROI(const vigra::Rect2D &val)
vigra::triple< typename ROIImage< Image, Mask >::image_const_traverser, typename ROIImage< Image, Mask >::image_const_traverser, typename ROIImage< Image, Mask >::ImageConstAccessor > srcImageRange(const ROIImage< Image, Mask > &img)
helper function for ROIImages
void ShowFisheyeCropHint()
void DragChoiceLayout(int index)
void OnSelectBrightestMenu(wxCommandEvent &e)
straighten panorama horizontically
UIntSet getActiveImages() const
get active images
void MakePlaneOverviewTools(PlaneOverviewToolHelper *helper)
#define HUGIN_ASS_AUTO_ALIGN
OverviewDragTool * overview_drag_tool
GLOverview * m_GLOverview
bool m_selectKeepSelection
GLPreviewFrame(wxFrame *frame, HuginBase::Panorama &pano)
ctor.
void OnCenterHorizontally(wxCommandEvent &e)
virtual void SetLayoutScale(double scale)
void OnROIChanged(wxCommandEvent &e)
event handler for changed roi
wxChoice * m_BlendModeChoice
wxBoxSizer * m_projParamSizer
void OnLoadImages(wxCommandEvent &e)
void ShowProjectionWarnings()
Tell the user anything suspicious about the projection choice.
void OnUserExit(wxCommandEvent &e)
user wants to quit program
void setHFOV(double h, bool keepView=true)
set the horizontal field of view.
void OnGuideChanged(wxCommandEvent &e)
event handler when user selects different guide
void OnShowNone(wxCommandEvent &e)
void addObserver(PanoramaObserver *o)
add a panorama observer.
void OnDoStitch(wxCommandEvent &e)
void OnChangeProjectionParam(wxScrollEvent &e)
unsigned int getWidth() const
include file for the hugin project
virtual void SetLayoutMode(bool state)
const PanoramaOptions & getOptions() const
returns the options for this panorama
void OnSelectAllMenu(wxCommandEvent &e)
handle all options of select all context menu
void OnSelectResetSelection(wxCommandEvent &e)
Handle EVT_KILL_FOCUS and convert it to a EVT_TEXT_ENTER event.
virtual double getResultHorizontalFOV()
virtual vigra::Rect2D getResultOptimalROI()
returns the found crop rect
void OnResetCrop(wxCommandEvent &e)
event handler to reset crop area
UIntSet getCPoutsideLimit(Panorama pano, double n, bool skipOptimisation, bool includeLineCp)
optimises the whole panorama and removes all control points with error > mean+n*sigma ...
PreviewToolHelper * preview_helper
wxTextCtrl * m_ROIBottomTxt
Components GetComponents()
find all connected components
subclass for a floating frame of the dock manager
SplitButton * m_alignButton
const std::vector< double > & getProjectionParameters() const
Get the optional projection parameters.
void OnIncreaseExposure(wxSpinEvent &e)
void OnTrackChangeProjectionParam(wxScrollEvent &e)
bool UpdateOverviewMode(int newMode)
updates the mode of the overview window
wxToggleButton * m_colorpicker_togglebutton
void OnRangeCompressionIncrease(wxSpinEvent &e)
bool m_showProjectionHints
void SetOptions(const HuginBase::PanoramaOptions *new_opts)
void OnCreateCP(wxCommandEvent &e)
handler for creating cp in pano space
void OnPreviewBackgroundColorChanged(wxColourPickerEvent &e)
event handler when user changes background color
void SetViewerBackground(wxColour col)
void OnDragChoice(wxCommandEvent &e)
hugin_utils::FDiff2D maxpos
PreviewColorPickerTool * color_picker_tool
std::vector< ControlPoint > CPVector
wxFileHistory * GetFileHistory()
void updateBlendMode()
Update tools and GUI elements according to blend mode choice.
bool HasNonZeroTranslationPlaneParameters()
check, if panorama has non-zero translation plane parameters
void OnEditCPTool(wxCommandEvent &e)
event handler when starting edit cp tool
PlaneOverviewToolHelper * plane_overview_helper
PreviewEditCPTool * edit_cp_tool
void OnBlendChoice(wxCommandEvent &e)
const SrcPanoImage & getImage(std::size_t nr) const
get a panorama image, counting starts with 0
wxTextCtrl * m_exposureTextCtrl
void OnShowEvent(wxShowEvent &e)
void OnAutocrop(wxCommandEvent &e)
bool needsOptimization()
true if control points or lens variables have been changed after the last optimisation ...
std::vector< wxStaticText * > m_projParamNamesLabel
PreviewProjectionGridTool * preview_projection_grid
void fill_set(_Container &c, typename _Container::key_type begin, typename _Container::key_type end)
update global white balance
customized subclass of the dock manager, created just for the purpose to create a workaround for the ...
void KeyDown(wxKeyEvent &e)
ProjectionFormat
Projection of final panorama.
HuginBase::Panorama & m_pano
void setSrcImage(unsigned int nr, const SrcPanoImage &img)
set input image parameters
PreviewGuideTool * preview_guide_tool
void ResetTranslationPlaneParameters()
resets all translation plane parameters to zero
virtual void panoramaChanged(HuginBase::Panorama &pano)
Notification about a Panorama change.
add multiple control points
wxChoice * m_GuideChoiceProj
PreviewCameraTool * camera_tool
void OnStraighten(wxCommandEvent &e)
All variables of a source image.
void setProjection(ProjectionFormat f)
set the Projection format and adjust the hfov/vfov if nessecary
static ViewState * m_view_state
PreviewLayoutLinesTool * m_preview_layoutLinesTool
void SetZoomLevel(const float new_zoom)
vigra::Size2D getSize() const
get size of output image
void UpdateGlobalWhiteBalance(double redFactor, double blueFactor)
updates the global white balance
void SetImageButtonColour(unsigned int image_nr, unsigned char red, unsigned char green, unsigned char blue)
void ResetPreviewZoom()
reset zoom level for preview window
void OnClose(wxCloseEvent &e)
struct to hold a image state for stitching
wxString Components2Str(const HuginGraph::ImageGraph::Components &comp)
HuginBase::UIntSet imageDragGroup
void OnNumTransform(wxCommandEvent &e)
void OnAlign(wxCommandEvent &e)
virtual bool hasRunSuccessfully()
wxChoice * m_OverviewModeChoice
PreviewDifferenceTool * difference_tool
void OnHideProjectionHints(wxCommandEvent &e)
event handler when user hides the infobar
void OnProjParameterReset(wxCommandEvent &e)
event handler for reset projection parameters
void TurnOffTools(std::set< Tool * > tools)
void LoadImages(int preferredLensType)
void KeyUp(wxKeyEvent &e)
void setWidth(unsigned int w, bool keepView=true)
set panorama width keep the HFOV, if keepView=true
double outputExposureValue
void OnFitPano(wxCommandEvent &e)
class to work with images graphs created from a HuginBase::Panorama class it creates a graph based on...