Hugintrunk  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FindPanoDialog.cpp
Go to the documentation of this file.
1 // -*- c-basic-offset: 4 -*-
2 
11 /* This is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU General Public
13  * License as published by the Free Software Foundation; either
14  * version 2 of the License, or (at your option) any later version.
15  *
16  * This software is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  * Lesser General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public
22  * License along with this software. If not, see
23  * <http://www.gnu.org/licenses/>.
24  *
25  */
26 
27 #include "FindPanoDialog.h"
28 #include "base_wx/wxPlatform.h"
29 #include "panoinc.h"
31 #include "PTBatcherGUI.h"
32 #include "hugin_utils/alphanum.h"
33 #include "hugin/config_defaults.h"
34 #include "wx/mstream.h"
35 #ifdef _WIN32
36 // workaround for a conflict between exiv2 and wxWidgets/CMake built
37 #define HAVE_PID_T 1
38 #endif
39 #include <exiv2/exiv2.hpp>
40 #ifdef _WIN32
41 #include <commctrl.h>
42 #endif
43 #include "base_wx/LensTools.h"
45 #include "base_wx/wxutils.h"
46 
47 enum
48 {
49  ID_REMOVE_IMAGE = wxID_HIGHEST + 300,
50  ID_SPLIT_PANOS = wxID_HIGHEST + 301
51 };
52 
53 BEGIN_EVENT_TABLE(FindPanoDialog,wxDialog)
54  EVT_BUTTON(XRCID("find_pano_close"), FindPanoDialog::OnButtonClose)
55  EVT_BUTTON(XRCID("find_pano_select_dir"), FindPanoDialog::OnButtonChoose)
56  EVT_BUTTON(XRCID("find_pano_start_stop"), FindPanoDialog::OnButtonStart)
57  EVT_BUTTON(XRCID("find_pano_add_queue"), FindPanoDialog::OnButtonSend)
58  EVT_LISTBOX(XRCID("find_pano_list"), FindPanoDialog::OnSelectPossiblePano)
59  EVT_LIST_ITEM_RIGHT_CLICK(XRCID("find_pano_selected_thumbslist"), FindPanoDialog::OnListItemRightClick)
60  EVT_MENU(ID_REMOVE_IMAGE, FindPanoDialog::OnRemoveImage)
61  EVT_MENU(ID_SPLIT_PANOS, FindPanoDialog::OnSplitPanos)
62  EVT_CLOSE(FindPanoDialog::OnClose)
64 
65 bool SortFilename::operator()(const HuginBase::SrcPanoImage* img1, const HuginBase::SrcPanoImage* img2) const
66 {
67  return doj::alphanum_comp(img1->getFilename(),img2->getFilename())<0;
68 };
69 
70 // thumbnail size currently set to 80x80
71 #define THUMBSIZE 80
72 
73 FindPanoDialog::FindPanoDialog(BatchFrame* batchframe, wxString xrcPrefix)
74 {
75  // load our children. some children might need special
76  // initialization. this will be done later.
77  wxXmlResource::Get()->LoadDialog(this,batchframe,wxT("find_pano_dialog"));
78 
79 #ifdef __WXMSW__
80  wxIconBundle myIcons(xrcPrefix+ wxT("data/ptbatcher.ico"),wxBITMAP_TYPE_ICO);
81  SetIcons(myIcons);
82 #else
83  wxIcon myIcon(xrcPrefix + wxT("data/ptbatcher.png"),wxBITMAP_TYPE_PNG);
84  SetIcon(myIcon);
85 #endif
86  m_batchframe=batchframe;
87  m_isRunning=false;
88  m_stopped=false;
89 
90  m_button_start=XRCCTRL(*this,"find_pano_start_stop",wxButton);
91  m_button_choose=XRCCTRL(*this,"find_pano_select_dir",wxButton);
92  m_button_send=XRCCTRL(*this,"find_pano_add_queue",wxButton);
93  m_button_close=XRCCTRL(*this,"find_pano_close",wxButton);
94  m_textctrl_dir=XRCCTRL(*this,"find_pano_dir",wxTextCtrl);
95  m_textctrl_dir->AutoCompleteDirectories();
96  m_cb_subdir=XRCCTRL(*this,"find_pano_subdir",wxCheckBox);
97  m_statustext=XRCCTRL(*this,"find_pano_label",wxStaticText);
98  m_list_pano=XRCCTRL(*this,"find_pano_list",wxCheckListBox);
99  m_ch_naming=XRCCTRL(*this,"find_pano_naming",wxChoice);
100  m_cb_createLinks=XRCCTRL(*this,"find_pano_create_links",wxCheckBox);
101  m_cb_loadDistortion=XRCCTRL(*this,"find_pano_load_distortion",wxCheckBox);
102  m_cb_loadVignetting=XRCCTRL(*this,"find_pano_load_vignetting",wxCheckBox);
103  m_sc_minNumberImages=XRCCTRL(*this, "find_pano_min_number_images", wxSpinCtrl);
104  m_sc_maxTimeDiff=XRCCTRL(*this, "find_pano_max_time_diff", wxSpinCtrl);
105  m_ch_blender = XRCCTRL(*this, "find_pano_default_blender", wxChoice);
107 
108  //set parameters
109  wxConfigBase* config = wxConfigBase::Get();
110  // restore position and size
111  int dx,dy;
112  wxDisplaySize(&dx,&dy);
113  bool maximized = config->Read(wxT("/FindPanoDialog/maximized"), 0l) != 0;
114  if (maximized)
115  {
116  this->Maximize();
117  }
118  else
119  {
120  //size
121  int w = config->Read(wxT("/FindPanoDialog/width"),-1l);
122  int h = config->Read(wxT("/FindPanoDialog/height"),-1l);
123  if (w > 0 && w <= dx)
124  {
125  this->SetClientSize(w,h);
126  }
127  else
128  {
129  this->Fit();
130  }
131  //position
132  int x = config->Read(wxT("/FindPanoDialog/positionX"),-1l);
133  int y = config->Read(wxT("/FindPanoDialog/positionY"),-1l);
134  if ( y >= 0 && x >= 0 && x < dx && y < dy)
135  {
136  this->Move(x, y);
137  }
138  else
139  {
140  this->Move(0, 44);
141  }
142  }
143  long splitterPos = config->Read(wxT("/FindPanoDialog/splitterPos"), -1l);
144  if (splitterPos != -1)
145  {
146  XRCCTRL(*this, "find_pano_splitter", wxSplitterWindow)->SetSashPosition(splitterPos);
147  };
148  wxString path=config->Read(wxT("/FindPanoDialog/actualPath"),wxEmptyString);
149  if(!path.IsEmpty())
150  {
151  m_textctrl_dir->SetValue(path);
152  }
153  bool val;
154  config->Read(wxT("/FindPanoDialog/includeSubDirs"),&val,false);
155  m_cb_subdir->SetValue(val);
156  long i=config->Read(wxT("/FindPanoDialog/Naming"),0l);
157  m_ch_naming->SetSelection(i);
158  config->Read(wxT("/FindPanoDialog/linkStacks"),&val,true);
159  m_cb_createLinks->SetValue(val);
160  config->Read(wxT("/FindPanoDialog/loadDistortion"),&val,false);
161  m_cb_loadDistortion->SetValue(val);
162  config->Read(wxT("/FindPanoDialog/loadVignetting"),&val,false);
163  m_cb_loadVignetting->SetValue(val);
164  i=config->Read(wxT("/FindPanoDialog/MinNumberImages"), 2l);
165  m_sc_minNumberImages->SetValue(i);
166  i=config->Read(wxT("/FindPanoDialog/MaxTimeDiff"), 30l);
167  m_sc_maxTimeDiff->SetValue(i);
168  i = config->Read(wxT("/FindPanoDialog/DefaultBlender"), static_cast<long>(HuginBase::PanoramaOptions::ENBLEND_BLEND));
170  m_button_send->Disable();
171  m_thumbs = new wxImageList(THUMBSIZE, THUMBSIZE, true, 0);
172  m_thumbsList = XRCCTRL(*this, "find_pano_selected_thumbslist", wxListCtrl);
173  m_thumbsList->SetImageList(m_thumbs, wxIMAGE_LIST_NORMAL);
174  m_thumbsList->Bind(wxEVT_MOTION, &FindPanoDialog::OnListMouseMove, this);
175 #ifdef _WIN32
176  // default image spacing is too big, wxWidgets does not provide direct
177  // access to the spacing, so using the direct API function
178  ListView_SetIconSpacing(m_thumbsList->GetHandle(), THUMBSIZE + 20, THUMBSIZE + 20);
179 #endif
180 };
181 
183 {
184  wxConfigBase* config=wxConfigBase::Get();
185  if(!this->IsMaximized())
186  {
187  wxSize sz = this->GetClientSize();
188  config->Write(wxT("/FindPanoDialog/width"), sz.GetWidth());
189  config->Write(wxT("/FindPanoDialog/height"), sz.GetHeight());
190  wxPoint ps = this->GetPosition();
191  config->Write(wxT("/FindPanoDialog/positionX"), ps.x);
192  config->Write(wxT("/FindPanoDialog/positionY"), ps.y);
193  config->Write(wxT("/FindPanoDialog/maximized"), 0);
194  }
195  else
196  {
197  config->Write(wxT("/FindPanoDialog/maximized"), 1l);
198  };
199  config->Write(wxT("/FindPanoDialog/splitterPos"), XRCCTRL(*this, "find_pano_splitter", wxSplitterWindow)->GetSashPosition());
200  config->Write(wxT("/FindPanoDialog/actualPath"),m_textctrl_dir->GetValue());
201  config->Write(wxT("/FindPanoDialog/includeSubDirs"),m_cb_subdir->GetValue());
202  config->Write(wxT("/FindPanoDialog/Naming"),m_ch_naming->GetSelection());
203  config->Write(wxT("/FindPanoDialog/linkStacks"),m_cb_createLinks->GetValue());
204  config->Write(wxT("/FindPanoDialog/loadDistortion"),m_cb_loadDistortion->GetValue());
205  config->Write(wxT("/FindPanoDialog/loadVignetting"),m_cb_loadDistortion->GetValue());
206  config->Write(wxT("/FindPanoDialog/MinNumberImages"), m_sc_minNumberImages->GetValue());
207  config->Write(wxT("/FindPanoDialog/MaxTimeDiff"), m_sc_maxTimeDiff->GetValue());
208  config->Write(wxT("/FindPanoDialog/DefaultBlender"), static_cast<long>(GetSelectedValue(m_ch_blender)));
209  CleanUpPanolist();
210  delete m_thumbs;
211 };
212 
214 {
215  while(!m_panos.empty())
216  {
217  delete m_panos.back();
218  m_panos.pop_back();
219  };
220 };
221 
222 //prevent closing window when running detection
223 void FindPanoDialog::OnClose(wxCloseEvent& e)
224 {
225  if(e.CanVeto() && m_isRunning)
226  {
227  wxBell();
228  e.Veto();
229  }
230  else
231  {
232  e.Skip();
233  };
234 };
235 
236 void FindPanoDialog::OnButtonClose(wxCommandEvent& e)
237 {
238  if(!m_panos.empty())
239  {
240  if(wxMessageBox(_("The list contains possibly unprocessed panoramas.\nIf you close the dialog, you will lose them.\nContinue anyway?"),
241  _("Question"),wxYES_NO|wxICON_WARNING,this)==wxNO)
242  {
243  return;
244  };
245  };
246  this->Close();
247 };
248 
249 void FindPanoDialog::OnButtonChoose(wxCommandEvent& e)
250 {
251  wxDirDialog dlg(this, _("Specify a directory to search for projects in"),
252  m_textctrl_dir->GetValue(), wxDD_DEFAULT_STYLE | wxDD_DIR_MUST_EXIST);
253  if (dlg.ShowModal()==wxID_OK)
254  {
255  m_textctrl_dir->SetValue(dlg.GetPath());
256  };
257 };
258 
259 void FindPanoDialog::OnButtonStart(wxCommandEvent& e)
260 {
261  if(m_isRunning)
262  {
263  //stop detection
264  m_stopped=true;
265  m_button_start->SetLabel(_("Accepted"));
266  }
267  else
268  {
269  //start detection
270  m_start_dir=m_textctrl_dir->GetValue();
271  if(wxDir::Exists(m_start_dir))
272  {
273  if(!m_panos.empty())
274  {
275  if (wxMessageBox(_("The list contains still not yet processed panoramas.\nIf you continue, they will be disregarded.\nDo you still want to continue?"),
276  _("Question"),wxYES_NO|wxICON_WARNING,this)==wxNO)
277  {
278  return;
279  };
280  };
281  m_isRunning=true;
282  m_stopped=false;
283  //deactivate TIFF warning message boxes
284  m_oldtiffwarning=TIFFSetWarningHandler(NULL);
285  m_button_start->SetLabel(_("Stop"));
286  CleanUpPanolist();
287  m_list_pano->Clear();
288  wxCommandEvent dummy;
289  OnSelectPossiblePano(dummy);
290  EnableButtons(false);
291  SearchInDir(m_start_dir,m_cb_subdir->GetValue(), m_cb_loadDistortion->GetValue(), m_cb_loadVignetting->GetValue(),
292  m_sc_minNumberImages->GetValue(), m_sc_maxTimeDiff->GetValue());
293  }
294  else
295  {
296  wxMessageBox(wxString::Format(_("Directory %s does not exist.\nPlease give an existing directory."),m_start_dir.c_str()),
297  _("Warning"),wxOK | wxICON_EXCLAMATION,this);
298  };
299  };
300 }
301 
302 void FindPanoDialog::OnButtonSend(wxCommandEvent& e)
303 {
304  if(m_panos.empty())
305  {
306  return;
307  }
308  unsigned int nr=0;
309  for(unsigned int i=0; i<m_list_pano->GetCount(); i++)
310  {
311  if(m_list_pano->IsChecked(i))
312  {
313  nr++;
314  };
315  };
316  if(nr==0)
317  {
318  wxMessageBox(_("You have selected no possible panorama.\nPlease select at least one panorama and try again."),_("Warning"),wxOK|wxICON_EXCLAMATION,this);
319  return;
320  }
321  bool failed=false;
322  bool createLinks=m_cb_createLinks->GetValue();
323  for(unsigned int i=0; i<m_list_pano->GetCount(); i++)
324  {
325  if(m_list_pano->IsChecked(i))
326  {
327  wxString filename=m_panos[i]->GeneratePanorama((PossiblePano::NamingConvention)(m_ch_naming->GetSelection()),createLinks,
328  static_cast<HuginBase::PanoramaOptions::BlendingMechanism>(GetSelectedValue(m_ch_blender)));
329  if(!filename.IsEmpty())
330  {
332  }
333  else
334  {
335  failed=true;
336  };
337  };
338  };
339  if(failed)
340  {
341  wxMessageBox(_("Not all project files could be written successfully.\nMaybe you have no write permission for these directories or your disc is full."),_("Error"),wxOK,this);
342  };
343  this->Close();
344 };
345 
346 void FindPanoDialog::EnableButtons(const bool state)
347 {
348  m_textctrl_dir->Enable(state);
349  m_button_choose->Enable(state);
350  m_cb_subdir->Enable(state);
351  m_ch_naming->Enable(state);
352  m_cb_createLinks->Enable(state);
353  m_button_close->Enable(state);
354  m_button_send->Enable(state);
355 };
356 
358 {
359  int selected = m_list_pano->GetSelection();
360  if (selected != wxNOT_FOUND)
361  {
362  XRCCTRL(*this, "find_pano_selected_cam", wxStaticText)->SetLabel(m_panos[selected]->GetCameraName());
363  XRCCTRL(*this, "find_pano_selected_lens", wxStaticText)->SetLabel(m_panos[selected]->GetLensName());
364  XRCCTRL(*this, "find_pano_selected_focallength", wxStaticText)->SetLabel(m_panos[selected]->GetFocalLength());
365  XRCCTRL(*this, "find_pano_selected_date_time", wxStaticText)->SetLabel(m_panos[selected]->GetStartString() + wxT(" (")+ m_panos[selected]->GetDuration() + wxT(")"));
366  m_panos[selected]->PopulateListCtrl(m_thumbsList, m_thumbs, m_tooltips);
367  }
368  else
369  {
370  XRCCTRL(*this, "find_pano_selected_cam", wxStaticText)->SetLabel(wxEmptyString);
371  XRCCTRL(*this, "find_pano_selected_lens", wxStaticText)->SetLabel(wxEmptyString);
372  XRCCTRL(*this, "find_pano_selected_focallength", wxStaticText)->SetLabel(wxEmptyString);
373  XRCCTRL(*this, "find_pano_selected_date_time", wxStaticText)->SetLabel(wxEmptyString);
374  m_thumbsList->DeleteAllItems();
375  m_thumbs->RemoveAll();
376  m_tooltips.Clear();
377  };
378 };
379 
381 {
382  // build menu
383  wxMenu contextMenu;
384  const int selectedPano = m_list_pano->GetSelection();
385  if (m_panos[selectedPano]->GetImageCount() > 2)
386  {
387  contextMenu.Append(ID_REMOVE_IMAGE, _("Remove image from project"));
388  };
389  long imageIndex = -1;
390  imageIndex = m_thumbsList->GetNextItem(imageIndex, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
391  if(imageIndex > 1 && imageIndex <= static_cast<long>(m_panos[selectedPano]->GetImageCount()) - 2)
392  {
393  contextMenu.Append(ID_SPLIT_PANOS, _("Split here into two panoramas"));
394  }
395  // show popup menu
396  if (contextMenu.GetMenuItemCount() > 0)
397  {
398  PopupMenu(&contextMenu);
399  };
400 };
401 
402 void FindPanoDialog::OnRemoveImage(wxCommandEvent &e)
403 {
404  const int selectedPano = m_list_pano->GetSelection();
405  if (selectedPano != wxNOT_FOUND)
406  {
407  if (m_panos[selectedPano]->GetImageCount() > 2)
408  {
409  long imageIndex = -1;
410  imageIndex = m_thumbsList->GetNextItem(imageIndex, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
411  if (imageIndex != wxNOT_FOUND)
412  {
413  // remove image from possible pano
414  m_panos[selectedPano]->RemoveImage(imageIndex);
415  // now remove from the wxListCtrl
416  m_thumbsList->DeleteItem(imageIndex);
417  // update the pano list
418  m_list_pano->SetString(selectedPano, m_panos[selectedPano]->GetItemString(m_start_dir));
419  // update the labels above
420  wxCommandEvent dummy;
421  OnSelectPossiblePano(dummy);
422  };
423  };
424  };
425 };
426 
427 void FindPanoDialog::OnSplitPanos(wxCommandEvent &e)
428 {
429  const int selectedPano = m_list_pano->GetSelection();
430  if (selectedPano != wxNOT_FOUND)
431  {
432  long imageIndex = -1;
433  imageIndex = m_thumbsList->GetNextItem(imageIndex, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
434  if (imageIndex != wxNOT_FOUND)
435  {
436  if (imageIndex > 1 && imageIndex <= static_cast<long>(m_panos[selectedPano]->GetImageCount()) - 2)
437  {
438  // do split
439  PossiblePano* newSubPano = m_panos[selectedPano]->SplitPano(imageIndex);
440  if (newSubPano->GetImageCount() > 0)
441  {
442  // insert new pano into internal list
443  m_panos.insert(m_panos.begin() + selectedPano + 1, newSubPano);
444  // update pano list
445  m_list_pano->SetString(selectedPano, m_panos[selectedPano]->GetItemString(m_start_dir));
446  int newItem = m_list_pano->Insert(m_panos[selectedPano + 1]->GetItemString(m_start_dir), selectedPano + 1);
447  m_list_pano->Check(newItem, true);
448  // update display
449  wxCommandEvent dummy;
450  OnSelectPossiblePano(dummy);
451  }
452  else
453  {
454  wxBell();
455  delete newSubPano;
456  };
457  };
458  };
459  };
460 }
461 
462 void FindPanoDialog::OnListMouseMove(wxMouseEvent & e)
463 {
464  if (m_tooltips.IsEmpty())
465  {
466  return;
467  }
468  int flags;
469  long item = m_thumbsList->HitTest(e.GetPosition(), flags);
470  if (item != wxNOT_FOUND && (flags&wxLIST_HITTEST_ONITEM) && item < m_tooltips.GetCount())
471  {
472  m_thumbsList->SetToolTip(m_tooltips[item]);
473  }
474  else
475  {
476  m_thumbsList->UnsetToolTip();
477  };
478 };
479 
480 int SortWxFilenames(const wxString& s1,const wxString& s2)
481 {
482  return doj::alphanum_comp(std::string(s1.mb_str(wxConvLocal)),std::string(s2.mb_str(wxConvLocal)));
483 };
484 
485 void FindPanoDialog::SearchInDir(wxString dirstring, const bool includeSubdir, const bool loadDistortion, const bool loadVignetting, const size_t minNumberImages, const size_t maxTimeDiff)
486 {
487  std::vector<PossiblePano*> newPanos;
488  wxTimeSpan max_diff(0, 0, maxTimeDiff, 0);
489  wxString filename;
490  wxArrayString fileList;
491  wxDir::GetAllFiles(dirstring,&fileList,wxEmptyString,wxDIR_FILES|wxDIR_HIDDEN);
492  fileList.Sort(SortWxFilenames);
493  //map for caching projection information to prevent reading from database for each image
494  for(size_t j=0; j<fileList.size() && !m_stopped; j++)
495  {
496  m_statustext->SetLabel(wxString::Format(_("Reading file %s"),fileList[j].c_str()));
497  wxFileName file(fileList[j]);
498  file.MakeAbsolute();
499  wxString ext=file.GetExt();
500  if(ext.CmpNoCase(wxT("jpg"))==0 || ext.CmpNoCase(wxT("jpeg"))==0 ||
501  ext.CmpNoCase(wxT("tif"))==0 || ext.CmpNoCase(wxT("tiff"))==0)
502  {
503  std::string filenamestr(file.GetFullPath().mb_str(HUGIN_CONV_FILENAME));
505  img->setFilename(filenamestr);
506  img->readEXIF();
507  // check for black/white images, if so skip
508  const HuginBase::FileMetaData& metadata = img->getFileMetadata();
509  HuginBase::FileMetaData::const_iterator it = metadata.find("pixeltype");
510  if (it != metadata.end())
511  {
512  if (it->second == "BILEVEL")
513  {
514  wxGetApp().Yield(true);
515  continue;
516  };
517  };
518  img->applyEXIFValues();
519  if(!img->getExifMake().empty() && !img->getExifModel().empty() &&
520  img->getExifFocalLength()!=0 && img->getCropFactor()!=0)
521  {
522  img->readProjectionFromDB(false);
523  if(loadDistortion)
524  {
525  img->readDistortionFromDB();
526  };
527  if(loadVignetting)
528  {
529  img->readVignettingFromDB();
530  };
531  bool found=false;
532  for(unsigned int i=0; i<newPanos.size() && !m_stopped && !found; i++)
533  {
534  //compare with all other image groups
535  if(newPanos[i]->BelongsTo(img,max_diff))
536  {
537  newPanos[i]->AddSrcPanoImage(img);
538  found=true;
539  };
540  if(i%10==0)
541  {
542  wxGetApp().Yield(true);
543  };
544  };
545  if(!found)
546  {
547  PossiblePano* newPano=new PossiblePano();
548  newPano->AddSrcPanoImage(img);
549  newPanos.push_back(newPano);
550  };
551  }
552  else
553  {
554  //could not read exif infos, disregard this image
555  delete img;
556  };
557  };
558  //allow processing events
559  wxGetApp().Yield(true);
560  };
561  if(!m_stopped && !newPanos.empty())
562  {
563  for(size_t i=0; i<newPanos.size(); i++)
564  {
565  if(newPanos[i]->GetImageCount()>=minNumberImages)
566  {
567  m_panos.push_back(newPanos[i]);
568  int newItem=m_list_pano->Append(m_panos[m_panos.size()-1]->GetItemString(m_start_dir));
569  m_list_pano->Check(newItem,true);
570  }
571  else
572  {
573  delete newPanos[i];
574  };
575  };
576  };
577 
578  if(includeSubdir && !m_stopped)
579  {
580  //now we go into all directories
581  wxDir dir(dirstring);
582  bool cont=dir.GetFirst(&filename,wxEmptyString,wxDIR_DIRS);
583  while(cont && !m_stopped)
584  {
585  SearchInDir(dir.GetName()+wxFileName::GetPathSeparator()+filename,includeSubdir, loadDistortion, loadVignetting, minNumberImages, maxTimeDiff);
586  cont=dir.GetNext(&filename);
587  }
588  };
589  if(m_start_dir.Cmp(dirstring)==0)
590  {
591  m_stopped=false;
592  m_isRunning=false;
593  m_button_start->SetLabel(_("Start"));
594  EnableButtons(true);
595  //enable send button if at least one panorama found
596  m_button_send->Enable(!m_panos.empty());
597  if(!m_panos.empty())
598  {
599  m_statustext->SetLabel(wxString::Format(_("Found %d possible panoramas"), static_cast<int>(m_panos.size())));
600  }
601  else
602  {
603  m_statustext->SetLabel(_("No possible panoramas found"));
604  };
605  TIFFSetWarningHandler(m_oldtiffwarning);
606  };
607 };
608 
610 {
611  if(!m_images.empty())
612  {
613  for(ImageSet::reverse_iterator it=m_images.rbegin(); it!=m_images.rend(); ++it)
614  {
615  delete (*it);
616  }
617  };
618 };
619 
620 bool PossiblePano::BelongsTo(HuginBase::SrcPanoImage* img, const wxTimeSpan max_time_diff)
621 {
622  if(m_make.compare(img->getExifMake())!=0)
623  {
624  return false;
625  }
626  if(m_camera.compare(img->getExifModel())!=0)
627  {
628  return false;
629  }
630  if(m_lens.compare(img->getExifLens())!=0)
631  {
632  return false;
633  }
634  if(fabs(m_focallength-img->getExifFocalLength())>0.01)
635  {
636  return false;
637  }
638  if (fabs(m_cropfactor - img->getCropFactor()) > 0.01)
639  {
640  return false;
641  }
642  if(m_size!=img->getSize())
643  {
644  return false;
645  }
646  if(!GetDateTime(img).IsBetween(m_dt_start-max_time_diff,m_dt_end+max_time_diff))
647  {
648  return false;
649  };
650  return true;
651 };
652 
654 {
655  struct tm exifdatetime;
656  if(img->getExifDateTime(&exifdatetime)==0)
657  {
658  return wxDateTime(exifdatetime);
659  }
660  else
661  {
662  wxFileName file(wxString(img->getFilename().c_str(),HUGIN_CONV_FILENAME));
663  return file.GetModificationTime();
664  };
665 };
666 
668 {
669  if(m_images.empty())
670  {
671  //fill all values from first image
672  m_make=img->getExifMake();
673  m_camera=img->getExifModel();
674  m_lens=img->getExifLens();
675  m_focallength=img->getExifFocalLength();
676  m_cropfactor = img->getCropFactor();
677  m_size=img->getSize();
678  m_dt_start=GetDateTime(img);
680  }
681  else
682  {
683  wxDateTime dt=GetDateTime(img);
684  if(dt.IsEarlierThan(m_dt_start))
685  {
686  m_dt_start=dt;
687  }
688  if(dt.IsLaterThan(m_dt_end))
689  {
690  m_dt_end=dt;
691  };
692  };
693  m_images.insert(img);
694 };
695 
696 const wxString PossiblePano::GetFilestring(const wxString BasePath, const bool stripExtension) const
697 {
698  ImageSet::const_iterator it=m_images.begin();
699  wxFileName f1(wxString((*it)->getFilename().c_str(),HUGIN_CONV_FILENAME));
700  f1.MakeRelativeTo(BasePath);
701  ImageSet::const_reverse_iterator rit=m_images.rbegin();
702  wxFileName f2(wxString((*rit)->getFilename().c_str(),HUGIN_CONV_FILENAME));
703  if(stripExtension)
704  {
705  return f1.GetPath(wxPATH_GET_VOLUME | wxPATH_GET_SEPARATOR)+f1.GetName()+wxT("-")+f2.GetName();
706  }
707  else
708  {
709  return f1.GetFullPath()+wxT(" - ")+f2.GetFullName();
710  };
711 };
712 
713 const wxString PossiblePano::GetItemString(const wxString BasePath) const
714 {
715  return wxString::Format(_("%d images: %s"), static_cast<int>(m_images.size()), GetFilestring(BasePath).c_str());
716 };
717 
718 bool PossiblePano::GetNewProjectFilename(NamingConvention nc,const wxString basePath, wxFileName& projectFile)
719 {
720  wxString mask;
721  unsigned int i=1;
722  projectFile.SetPath(basePath);
723  projectFile.SetName(wxT("pano"));
724  projectFile.SetExt(wxT("pto"));
725  if(!projectFile.IsDirWritable())
726  {
727  return false;
728  };
729  switch(nc)
730  {
731  case NAMING_PANO:
732  mask=wxT("panorama%d");
733  break;
734  case NAMING_FIRST_LAST:
735  mask=GetFilestring(basePath,true);
736  projectFile.SetName(mask);
737  if(!projectFile.FileExists())
738  {
739  return true;
740  };
741  mask=mask+wxT("_%d");
742  break;
743  case NAMING_FOLDER:
744  {
745  wxArrayString folders=projectFile.GetDirs();
746  if(folders.GetCount()==0)
747  {
748  return false;
749  }
750  mask=folders.Last();
751  projectFile.SetName(mask);
752  if(!projectFile.FileExists())
753  {
754  return true;
755  }
756  mask=mask+wxT("_%d");
757  }
758  break;
759  case NAMING_TEMPLATE:
760  {
761  HuginBase::Panorama tempPano;
762  tempPano.addImage(**m_images.begin());
763  tempPano.addImage(**m_images.rbegin());
764  wxFileName newProject(getDefaultProjectName(tempPano));
765  mask=newProject.GetName();
766  projectFile.SetName(mask);
767  if(!projectFile.FileExists())
768  {
769  return true;
770  }
771  mask=mask+wxT("_%d");
772  };
773  break;
774  default:
775  mask=wxT("panorama%d");
776  };
777 
778  projectFile.SetName(wxString::Format(mask,i));
779  while(projectFile.FileExists())
780  {
781  i++;
782  projectFile.SetName(wxString::Format(mask,i));
783  //security fall through
784  if(i>1000)
785  {
786  return false;
787  };
788  }
789  return true;
790 };
791 
793 {
794  if(m_images.empty())
795  {
796  return wxEmptyString;
797  };
798  ImageSet::const_iterator it=m_images.begin();
799  wxFileName firstFile(wxString((*it)->getFilename().c_str(),HUGIN_CONV_FILENAME));
800  firstFile.MakeAbsolute();
801  wxFileName projectFile;
802  if(!GetNewProjectFilename(nc,firstFile.GetPath(),projectFile))
803  {
804  return wxEmptyString;
805  };
806  //generate panorama
807  double redBalanceAnchor = (*m_images.begin())->getExifRedBalance();
808  double blueBalanceAnchor = (*m_images.begin())->getExifBlueBalance();
809  if (fabs(redBalanceAnchor)<1e-2)
810  {
811  redBalanceAnchor = 1;
812  };
813  if (fabs(blueBalanceAnchor)<1e-2)
814  {
815  blueBalanceAnchor = 1;
816  };
817  HuginBase::Panorama pano;
818  for(ImageSet::iterator it=m_images.begin(); it!=m_images.end(); ++it)
819  {
820  (*it)->setWhiteBalanceRed((*it)->getExifRedBalance() / redBalanceAnchor);
821  (*it)->setWhiteBalanceBlue((*it)->getExifBlueBalance() / blueBalanceAnchor);
822  pano.addImage(*(*it));
823  };
824  //assign all images the same lens number
825  HuginBase::StandardImageVariableGroups variable_groups(pano);
826  HuginBase::ImageVariableGroup& lenses = variable_groups.getLenses();
827  if(pano.getNrOfImages()>1)
828  {
829  for(unsigned int i=1; i<pano.getNrOfImages(); i++)
830  {
831  lenses.switchParts(i, lenses.getPartNumber(0));
832  };
833  };
834  if (pano.hasPossibleStacks())
835  {
836  pano.linkPossibleStacks(createLinks);
837  };
838  // Setup pano with options from preferences
840  //set default exposure value
841  opts.outputExposureValue = pano.getImage(0).getExposureValue();
842  wxConfigBase* config = wxConfigBase::Get();
843  opts.quality = config->Read(wxT("/output/jpeg_quality"),HUGIN_JPEG_QUALITY);
844  switch(config->Read(wxT("/output/tiff_compression"), HUGIN_TIFF_COMPRESSION))
845  {
846  case 0:
847  default:
848  opts.outputImageTypeCompression = "NONE";
849  opts.tiffCompression = "NONE";
850  break;
851  case 1:
852  opts.outputImageTypeCompression = "PACKBITS";
853  opts.tiffCompression = "PACKBITS";
854  break;
855  case 2:
856  opts.outputImageTypeCompression = "LZW";
857  opts.tiffCompression = "LZW";
858  break;
859  case 3:
860  opts.outputImageTypeCompression = "DEFLATE";
861  opts.tiffCompression = "DEFLATE";
862  break;
863  }
864  switch (config->Read(wxT("/output/ldr_format"), HUGIN_LDR_OUTPUT_FORMAT))
865  {
866  case 1:
867  opts.outputImageType ="jpg";
868  break;
869  case 2:
870  opts.outputImageType ="png";
871  break;
872  case 3:
873  opts.outputImageType ="exr";
874  break;
875  default:
876  case 0:
877  opts.outputImageType ="tif";
878  break;
879  }
881  opts.blendMode = defaultBlender;
882  opts.enblendOptions = config->Read(wxT("Enblend/Args"),wxT(HUGIN_ENBLEND_ARGS)).mb_str(wxConvLocal);
883  opts.enfuseOptions = config->Read(wxT("Enfuse/Args"),wxT(HUGIN_ENFUSE_ARGS)).mb_str(wxConvLocal);
884  opts.interpolator = (vigra_ext::Interpolator)config->Read(wxT("Nona/Interpolator"),HUGIN_NONA_INTERPOLATOR);
885  opts.tiff_saveROI = config->Read(wxT("Nona/CroppedImages"),HUGIN_NONA_CROPPEDIMAGES)!=0;
888  opts.verdandiOptions = config->Read(wxT("/VerdandiDefaultArgs"), wxEmptyString).mb_str(wxConvLocal);
889  pano.setOptions(opts);
890  // set optimizer switches
893 
894  if (pano.WritePTOFile(std::string(projectFile.GetFullPath().mb_str(HUGIN_CONV_FILENAME)),
895  std::string(projectFile.GetPath(wxPATH_GET_VOLUME | wxPATH_GET_SEPARATOR).mb_str(HUGIN_CONV_FILENAME))))
896  {
897  return projectFile.GetFullPath();
898  }
899  else
900  {
901  return wxEmptyString;
902  };
903 };
904 
906 {
907  return wxString(m_camera.c_str(), wxConvLocal);
908 }
909 
911 {
912  return wxString(m_lens.c_str(), wxConvLocal);
913 };
914 
916 {
917  if (!m_images.empty())
918  {
919  return FormatString::GetFocalLength(*m_images.begin());
920  };
921  return wxString::Format(wxT("%0.1f mm"), m_focallength);
922 };
923 
925 {
926  return m_dt_start.Format();
927 };
928 
930 {
931  return GetFormattedTimeSpan(m_dt_end.Subtract(m_dt_start));
932 };
933 
934 void PossiblePano::PopulateListCtrl(wxListCtrl* list, wxImageList* thumbs, wxArrayString& tooltips)
935 {
936  list->DeleteAllItems();
937  thumbs->RemoveAll();
938  tooltips.Clear();
939  wxBusyCursor cursor;
940  for (ImageSet::iterator it = m_images.begin(); it != m_images.end(); ++it)
941  {
942 #if defined EXIV2_VERSION && EXIV2_TEST_VERSION(0,27,99)
943  Exiv2::Image::UniquePtr image;
944 #else
945  Exiv2::Image::AutoPtr image;
946 #endif
947  bool opened = false;
948  try
949  {
950  image = Exiv2::ImageFactory::open((*it)->getFilename().c_str());
951  opened = true;
952  }
953  catch (...)
954  {
955  std::cerr << __FILE__ << " " << __LINE__ << " Error opening file" << std::endl;
956  continue;
957  }
958  int index = -1;
959  if (opened)
960  {
961  try
962  {
963  image->readMetadata();
964  }
965  catch (const Exiv2::Error& e)
966  {
967  std::cerr << __FILE__ << " " << __LINE__ << " Exiv2: Error reading metadata (" << e.what() << ")" << std::endl;
968  continue;
969  }
970  // read all thumbnails
971  Exiv2::PreviewManager previews(*image);
972  Exiv2::PreviewPropertiesList lists = previews.getPreviewProperties();
973  if (!lists.empty())
974  {
975  // select a preview with matching size
976  int previewIndex = 0;
977  while (previewIndex < lists.size() - 1 && lists[previewIndex].width_ < THUMBSIZE && lists[previewIndex].height_ < THUMBSIZE)
978  {
979  ++previewIndex;
980  };
981  // load preview image to wxImage
982  wxImage rawImage;
983  Exiv2::PreviewImage previewImage = previews.getPreviewImage(lists[previewIndex]);
984  wxMemoryInputStream stream(previewImage.pData(), previewImage.size());
985  rawImage.LoadFile(stream, wxString(previewImage.mimeType().c_str(), wxConvLocal), -1);
986  int x = 0;
987  int y = 0;
988  if (previewImage.width() > previewImage.height())
989  {
990  //landscape format
991  int newHeight = THUMBSIZE*previewImage.height() / previewImage.width();
992  rawImage.Rescale(THUMBSIZE, newHeight);
993  x = 0;
994  y = (THUMBSIZE - newHeight) / 2;
995  }
996  else
997  {
998  //portrait format
999  int newWidth = THUMBSIZE*previewImage.width() / previewImage.height();
1000  rawImage.Rescale(newWidth, THUMBSIZE);
1001  x = (THUMBSIZE - newWidth) / 2;
1002  y = 0;
1003  }
1004  // rotate according to orientation tag
1005  if ((*it)->getRoll() == 90)
1006  {
1007  rawImage = rawImage.Rotate90();
1008  std::swap(x, y);
1009  }
1010  else
1011  {
1012  if ((*it)->getRoll() == 270)
1013  {
1014  rawImage = rawImage.Rotate90(false);
1015  std::swap(x, y);
1016  }
1017  else
1018  {
1019  if ((*it)->getRoll() == 180)
1020  {
1021  rawImage = rawImage.Rotate180();
1022  };
1023  };
1024  };
1025  // create final bitmap with centered thumbnail
1026  wxBitmap bitmap(THUMBSIZE, THUMBSIZE);
1027  wxMemoryDC dc(bitmap);
1028  dc.SetBackground(list->GetBackgroundColour());
1029  dc.Clear();
1030  dc.DrawBitmap(rawImage, x, y);
1031  dc.SelectObject(wxNullBitmap);
1032  // create mask bitmap
1033  wxImage mask(THUMBSIZE, THUMBSIZE);
1034  mask.SetRGB(wxRect(0, 0, THUMBSIZE, THUMBSIZE), 0, 0, 0);
1035  mask.SetRGB(wxRect(x, y, THUMBSIZE - 2 * x, THUMBSIZE - 2 * y), 255, 255, 255);
1036  // add to wxImageList
1037  index = thumbs->Add(bitmap, wxBitmap(mask, 1));
1038  };
1039  };
1040  // create item in thumb list
1041  wxFileName fn(wxString((*it)->getFilename().c_str(), HUGIN_CONV_FILENAME));
1042  list->InsertItem(list->GetItemCount(), fn.GetFullName(), index);
1043  // build tooltip text
1044  tooltips.Add(fn.GetFullName() + "\n" + FormatString::GetAperture(*it) + ", "
1045  + FormatString::GetExposureTime(*it) + ", " + _("ISO") + FormatString::GetIso(*it)
1046  + "\n" + FormatString::GetExifDateTime(*it));
1047  };
1048 };
1049 
1050 void PossiblePano::RemoveImage(const unsigned int index)
1051 {
1052  // remove image with given index
1053  if (index < m_images.size())
1054  {
1055  ImageSet::iterator item = m_images.begin();
1056  std::advance(item, index);
1057  delete *item;
1058  m_images.erase(item);
1059  //update the internal times
1060  UpdateDateTimes();
1061  };
1062 }
1063 
1064 PossiblePano* PossiblePano::SplitPano(const unsigned int index)
1065 {
1066  PossiblePano* newPano = new PossiblePano();
1067  if (index < m_images.size())
1068  {
1069  // now move all images to right pano
1070  ImageSet allImages = m_images;
1071  m_images.clear();
1072  ImageSet::iterator img = allImages.begin();
1073  while (m_images.size() < index && img != allImages.end())
1074  {
1075  m_images.insert(*img);
1076  ++img;
1077  };
1078  while (img != allImages.end())
1079  {
1080  newPano->AddSrcPanoImage(*img);
1081  ++img;
1082  }
1083  UpdateDateTimes();
1084  };
1085  return newPano;
1086 }
1087 
1089 {
1090  // update internal stored start and end time
1091  m_dt_start = GetDateTime(*m_images.begin());
1092  m_dt_end = m_dt_start;
1093  for (auto& img : m_images)
1094  {
1095  wxDateTime dt = GetDateTime(img);
1096  if (dt.IsEarlierThan(m_dt_start))
1097  {
1098  m_dt_start = dt;
1099  }
1100  if (dt.IsLaterThan(m_dt_end))
1101  {
1102  m_dt_end = dt;
1103  };
1104  };
1105 }
std::string m_lens
wxString GetFocalLength()
returns the focal length as string
WXIMPEX wxString GetFormattedTimeSpan(const wxTimeSpan &timeSpan)
Definition: wxutils.cpp:27
int alphanum_comp(const std::string &l, const std::string &r)
Compare l and r with the same semantics as strcmp(), but with the &quot;Alphanum Algorithm&quot; which produces...
Definition: alphanum.cpp:119
static void swap(T &x, T &y)
Definition: svm.cpp:67
#define HUGIN_NONA_CROPPEDIMAGES
unsigned int getPartNumber(unsigned int imageNr) const
Get a part number from an image number.
wxChoice * m_ch_naming
wxSpinCtrl * m_sc_maxTimeDiff
wxDateTime m_dt_start
#define HUGIN_CONV_FILENAME
Definition: platform.h:40
void AddSrcPanoImage(HuginBase::SrcPanoImage *img)
adds the given SrcPanoImage to this pano-group
#define HUGIN_JPEG_QUALITY
~PossiblePano()
destructor, cleans up used variables
void setPhotometricOptimizerSwitch(const int newSwitch)
sets the photometric optimizer master switch
Definition: Panorama.cpp:311
Somewhere to specify what variables belong to what.
void AddToList(wxString aFile, Project::Target target=Project::STITCHING, wxString userDefined=wxEmptyString)
Definition: BatchFrame.cpp:491
void RemoveImage(const unsigned int index)
removes the image at given index
some helper classes for graphes
void EnableButtons(const bool state)
wxImageList * m_thumbs
wxButton * m_button_start
END_EVENT_TABLE()
include file for the hugin project
wxCheckBox * m_cb_loadDistortion
std::string outputImageTypeCompression
wxString GetCameraName()
returns the camera name
void setOptimizerSwitch(const int newSwitch)
set optimizer master switch
Definition: Panorama.cpp:303
wxCheckBox * m_cb_createLinks
ImageSet m_images
double m_cropfactor
Batch processor for Hugin with GUI.
int SortWxFilenames(const wxString &s1, const wxString &s2)
void OnButtonClose(wxCommandEvent &e)
closes window
wxCheckBox * m_cb_loadVignetting
void UpdateDateTimes()
updates the internal date/time representations
void linkPossibleStacks(bool linkPosition)
create automatically stacks as indicated by metadata
Definition: Panorama.cpp:2181
Model for a panorama.
Definition: Panorama.h:152
PossiblePano * SplitPano(const unsigned int index)
split pano into 2 subpanos, index is used as first image of second pano
BatchFrame * m_batchframe
wxArrayString m_tooltips
some definitions to work with optimizer master switches
size_t GetSelectedValue(wxControlWithItems *list)
Returns the client value of the selected item from list.
Definition: LensTools.cpp:102
wxDateTime m_dt_end
const wxString GetFilestring(const wxString BasePath, const bool stripExtension=false) const
returns a string with the filename of the first and last file
wxString GetDuration()
returns the duration as string
void PopulateListCtrl(wxListCtrl *list, wxImageList *thumbs, wxArrayString &tooltips)
add all images to wxListCtrl
std::size_t getNrOfImages() const
number of images.
Definition: Panorama.h:205
void SearchInDir(wxString dirstring, const bool includeSubdir, const bool loadDistortion, const bool loadVignetting, const size_t minNumberImages, const size_t maxTimeDiff)
const int getExifDateTime(struct tm *datetime) const
try to convert Exif date time string to struct tm
void OnSplitPanos(wxCommandEvent &e)
event handler to split into 2 panos
vigra_ext::Interpolator interpolator
const unsigned int GetImageCount() const
returns number of images in this group
Definition of dialog to change user defined sequence.
wxString GetStartString()
return the start date/time as string
ImageVariableGroup & getLenses()
Get the ImageVariableGroup representing the group of lens variables.
#define HUGIN_NONA_INTERPOLATOR
#define HUGIN_TIFF_COMPRESSION
void OnListMouseMove(wxMouseEvent &e)
mouse move handler for tooltips
wxCheckBox * m_cb_subdir
std::map< std::string, std::string > FileMetaData
typedef for general map for storing metadata in files
Definition: SrcPanoImage.h:55
wxString GetLensName()
returns the lens name
std::set< HuginBase::SrcPanoImage *, SortFilename > ImageSet
IMPEX double h[25][1024]
Definition: emor.cpp:169
std::string stripExtension(const std::string &basename2)
remove extension of a filename
Definition: utils.cpp:130
TIFFErrorHandler m_oldtiffwarning
void OnSelectPossiblePano(wxCommandEvent &e)
event to populate information on the right
wxStaticText * m_statustext
void OnListItemRightClick(wxListEvent &e)
event handler for context menu
#define HUGIN_HDRMERGE_ARGS
#define HUGIN_LDR_OUTPUT_FORMAT
bool BelongsTo(HuginBase::SrcPanoImage *img, const wxTimeSpan max_time_diff)
return true, if the image could belong to the given PossiblePano, it checks camera maker and model...
unsigned int addImage(const SrcPanoImage &img)
the the number for a specific image
Definition: Panorama.cpp:319
wxTextCtrl * m_textctrl_dir
wxString GetExposureTime(const HuginBase::SrcPanoImage *img)
returns formatted exposure time
Definition: LensTools.cpp:554
Same as above, but use a non const panorama.
wxButton * m_button_close
NamingConvention
enumeration for different naming conventions, must be match combobox in ressource ...
const PanoramaOptions & getOptions() const
returns the options for this panorama
Definition: Panorama.h:481
wxString GeneratePanorama(NamingConvention nc, bool createLinks, HuginBase::PanoramaOptions::BlendingMechanism defaultBlender)
generates the panorama file from this set of images
wxString GetExifDateTime(const HuginBase::SrcPanoImage *img)
returns Exif DateTimeOriginal as formatted wxString
Definition: LensTools.cpp:503
#define THUMBSIZE
void SelectListValue(wxControlWithItems *list, size_t newValue)
Selects the given value (stored in the client data) in the given list item.
Definition: LensTools.cpp:89
wxListCtrl * m_thumbsList
vigra::Size2D m_size
double m_focallength
wxString m_start_dir
bool GetNewProjectFilename(NamingConvention nc, const wxString basePath, wxFileName &projectFile)
returns a given filename, which does not already exists
#define HUGIN_ENFUSE_ARGS
bool readEXIF()
try to fill out information about the image, by examining the exif data
const wxDateTime GetDateTime(const HuginBase::SrcPanoImage *img)
does some reformating date/time format
PossiblePano()
constructor, init values
void OnClose(wxCloseEvent &e)
prevents closing window when running detection
platform/compiler specific stuff.
bool WritePTOFile(const std::string &filename, const std::string &prefix="")
write data to given pto file
Definition: Panorama.cpp:2059
wxSpinCtrl * m_sc_minNumberImages
~FindPanoDialog()
destructor, saves size and position
std::string m_camera
const SrcPanoImage & getImage(std::size_t nr) const
get a panorama image, counting starts with 0
Definition: Panorama.h:211
FindPanoDialog(BatchFrame *batchframe, wxString xrcPrefix)
Constructor, read from xrc ressource; restore last uses settings, size and position.
const wxString GetItemString(const wxString BasePath) const
returns a string which contains description of this pano
void OnRemoveImage(wxCommandEvent &e)
event handler to remove selected image from list
void setOptions(const PanoramaOptions &opt)
set new output settings This is not used directly for optimizing/stiching, but it can be feed into ru...
Definition: Panorama.cpp:1531
wxString GetFocalLength(const HuginBase::SrcPanoImage *img)
return focallength and focallength 35 mm as wxString
Definition: LensTools.cpp:519
Dialog for finding panorama in given directory.
Interpolator
enum with all interpolation methods
Definition: Interpolators.h:78
static uint16_t flags
All variables of a source image.
Definition: SrcPanoImage.h:194
Panorama image options.
wxString GetAperture(const HuginBase::SrcPanoImage *img)
returns formatted aperture value
Definition: LensTools.cpp:540
void switchParts(unsigned int ImageNr, unsigned int partNr)
switch a given image to a different part number.
const bool hasPossibleStacks() const
return true, if the metadata indicates that the projects is a bracketet project
Definition: Panorama.cpp:2137
wxButton * m_button_choose
#define HUGIN_ENBLEND_ARGS
wxChoice * m_ch_blender
void OnButtonSend(wxCommandEvent &e)
add selected projects to queue
wxString getDefaultProjectName(const HuginBase::Panorama &pano, const wxString filenameTemplate)
gets the default project name, as defined in the preferences
void OnButtonChoose(wxCommandEvent &e)
select directory with dialog
BlendingMechanism blendMode
std::string m_make
wxCheckListBox * m_list_pano
void FillBlenderList(wxControlWithItems *list)
Fills a wxControlWithItem with all possible blender options, the client data contains the associated ...
Definition: LensTools.cpp:81
wxString GetIso(const HuginBase::SrcPanoImage *img)
returns formatted iso value
Definition: LensTools.cpp:591
wxButton * m_button_send
void OnButtonStart(wxCommandEvent &e)
start/stops detections
std::vector< PossiblePano * > m_panos