Hugin trunk 0.1
Loading...
Searching...
No Matches
ImagesPanel.cpp
Go to the documentation of this file.
1// -*- c-basic-offset: 4 -*-
2
28#include "hugin_config.h"
29#include "panoinc_WX.h"
30#include "panoinc.h"
31#include <time.h>
32
33#include "base_wx/platform.h"
34#include "base_wx/wxPlatform.h"
35#include "base_wx/wxcms.h"
36#include <vector>
37#include <map>
38#include <functional> // std::bind
39
40#include "hugin/ImagesPanel.h"
43#include "hugin/CPEditorPanel.h"
44#include "hugin/MainFrame.h"
45#include "hugin/huginApp.h"
48#include "base_wx/PTWXDlg.h"
49#include "base_wx/LensTools.h"
50#include "hugin/ImagesTree.h"
52#include "base_wx/PanoCommand.h"
53#include "base_wx/wxutils.h"
54
56
62
63bool ImagesPanel::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size,
64 long style, const wxString& name)
65{
66 if (! wxPanel::Create(parent, id, pos, size, style, name)) {
67 return false;
68 }
69
70 wxXmlResource::Get()->LoadPanel(this, "images_panel");
71 wxPanel * panel = XRCCTRL(*this, "images_panel", wxPanel);
73 topsizer->Add(panel, 1, wxEXPAND, 0);
75
76 m_images_tree = XRCCTRL(*this, "images_tree_ctrl", ImagesTreeCtrl);
79
81
82 m_matchingButton = XRCCTRL(*this, "images_feature_matching", wxButton);
85
86 m_CPDetectorChoice = XRCCTRL(*this, "cpdetector_settings", wxChoice);
87
88 // Image Preview
89 m_smallImgCtrl = XRCCTRL(*this, "images_selected_image", wxStaticBitmap);
91
92 // empty bitmap with size (0,0) is not valid for wxStaticBitmap
93 // so we create a bitmap with the background color of the static bitmap control
94 wxImage image(1, 1, true);
95 const wxColour imageBackgroundColor = m_smallImgCtrl->GetBackgroundColour();
96 image.SetRGB(0, 0, imageBackgroundColor.Red(), imageBackgroundColor.Green(), imageBackgroundColor.Blue());
97 m_empty = wxBitmap(image);
98 m_smallImgCtrl->SetBitmap(m_empty);
99
100 m_lenstype = XRCCTRL(*this, "images_lens_type", wxChoice);
104 m_lenstype->SetSelection(0);
105
106 m_focallength = XRCCTRL(*this, "images_focal_length", wxTextCtrl);
108 m_focallength->PushEventHandler(new TextKillFocusHandler(this));
110
111 m_cropfactor = XRCCTRL(*this, "images_crop_factor", wxTextCtrl);
113 m_cropfactor->PushEventHandler(new TextKillFocusHandler(this));
115
116 m_overlap = XRCCTRL(*this, "images_overlap", wxTextCtrl);
118 m_overlap->PushEventHandler(new TextKillFocusHandler(this));
120
121 m_maxEv = XRCCTRL(*this, "images_maxev", wxTextCtrl);
123 m_maxEv->PushEventHandler(new TextKillFocusHandler(this));
125
126 wxTreeEvent ev;
128 DEBUG_TRACE("end");
129
130 m_optChoice = XRCCTRL(*this, "images_optimize_mode", wxChoice);
133
134 m_optPhotoChoice = XRCCTRL(*this, "images_photo_optimize_mode", wxChoice);
137
139
140 m_groupModeChoice = XRCCTRL(*this, "images_group_mode", wxChoice);
143
144 wxConfigBase* config=wxConfigBase::Get();
145 m_degDigits = config->Read("/General/DegreeFractionalDigitsEdit",3);
146 //read autopano generator settings
147 cpdetector_config.Read(config,huginApp::Get()->GetDataPath()+"default.setting");
148 //write current autopano generator settings
150 config->Flush();
152 Layout();
153#ifdef __WXGTK__
154 // explicitly set focus to propogate correctly key presses/shortcuts
156#endif
157 Bind(wxEVT_RADIOBOX, &ImagesPanel::OnDisplayModeChanged, this, XRCID("images_column_radiobox"));
158 Bind(wxEVT_BUTTON, &ImagesPanel::OnOptimizeButton, this, XRCID("images_optimize"));
159 Bind(wxEVT_BUTTON, &ImagesPanel::OnPhotometricOptimizeButton, this, XRCID("images_photo_optimize"));
160 return true;
161}
162
164{
167 // observe the panorama
168 m_pano->addObserver(this);
169}
170
172{
173 if(cb->HasClientUntypedData())
174 {
175 for(size_t i = 0; i < cb->GetCount(); i++)
176 {
177 delete static_cast<int*>(cb->GetClientData(i));
178 };
179 };
180};
181
183{
184 DEBUG_TRACE("dtor");
185 m_focallength->PopEventHandler(true);
186 m_cropfactor->PopEventHandler(true);
187 m_overlap->PopEventHandler(true);
188 m_maxEv->PopEventHandler(true);
189 m_pano->removeObserver(this);
193 DEBUG_TRACE("dtor end");
194}
195
196// We need to override the default handling of size events because the
197// sizers set the virtual size but not the actual size. We reverse
198// the standard handling and fit the child to the parent rather than
199// fitting the parent around the child
200
202{
203 int winWidth, winHeight;
205 DEBUG_INFO( "image panel: " << winWidth <<"x"<< winHeight );
207
208 e.Skip();
209}
210
212{
213 //update optimizer choice selection
214 int optSwitch=m_pano->getOptimizerSwitch();
215 int found=wxNOT_FOUND;
216 for(size_t i=0;i<m_optChoice->GetCount();i++)
217 {
218 if(optSwitch==*static_cast<int*>(m_optChoice->GetClientData(i)))
219 {
220 found=i;
221 break;
222 };
223 };
224 if(found==wxNOT_FOUND)
225 {
228 );
229 }
230 else
231 {
232 m_optChoice->SetSelection(found);
233 };
234
235 //update photometric optimizer choice selection
238 for(size_t i=0;i<m_optPhotoChoice->GetCount();i++)
239 {
240 if(optSwitch==*static_cast<int*>(m_optPhotoChoice->GetClientData(i)))
241 {
242 found=i;
243 break;
244 };
245 };
246 if(found==wxNOT_FOUND)
247 {
250 );
251 }
252 else
253 {
254 m_optPhotoChoice->SetSelection(found);
255 };
259}
260
262{
263 DEBUG_TRACE("");
264
265 // update text field if selected
267 DEBUG_DEBUG("nr of sel Images: " << selected.size());
268 if (pano.getNrOfImages() == 0)
269 {
271 m_matchingButton->Disable();
272 }
273 else
274 {
275 m_matchingButton->Enable();
276 wxTreeEvent ev;
278 };
279 //enable/disable optimize buttons
280 XRCCTRL(*this, "images_optimize", wxButton)->Enable(pano.getNrOfImages()>0);
281 XRCCTRL(*this, "images_photo_optimize", wxButton)->Enable(pano.getNrOfImages()>1);
282}
283
284// ##### Here start the eventhandlers #####
285
287void ImagesPanel::CPGenerate(wxCommandEvent & e)
288{
290 //if only one image is selected, run detector on all images, except for linefind
291 wxString progName = cpdetector_config.settings[m_CPDetectorChoice->GetSelection()].GetProg().Lower();
292 if ((selImg.empty()) || (selImg.size() == 1 && progName.Find("linefind") == wxNOT_FOUND))
293 {
294 // add all images.
295 selImg.clear();
297 }
298
299 if (selImg.empty())
300 {
301 return;
302 }
304};
305
310
312{
313 wxConfigBase* config=wxConfigBase::Get();
316 {
317 nFeatures = config->Read("/MainFrame/nControlPoints", HUGIN_ASS_NCONTROLPOINTS);
319 _("Enter maximal number of control points per image pair"),
320 _("Points per Overlap"),
321 _("Control point detector option"),
322 nFeatures, 1, 10000
323 );
324 if(nFeatures<1)
325 {
326 return;
327 };
328 config->Write("/MainFrame/nControlPoints", nFeatures);
329 }
330 else
331 {
332 nFeatures = config->Read("/Assistant/nControlPoints", HUGIN_ASS_NCONTROLPOINTS);
333 };
334
338 hugin_utils::HuginMessageBox(wxString::Format(_("Added %lu control points"), (unsigned long)cps.size()), _("Hugin"), wxOK | wxICON_INFORMATION, this);
341 );
342
343};
344
346{
347 return cpdetector_config.settings[m_CPDetectorChoice->GetSelection()].GetCPDetectorDesc();
348};
349
351{
353 DEBUG_DEBUG("selected Images: " << sel.size());
354 if (sel.empty())
355 {
356 // nothing to edit
358 }
359 else
360 {
361 // enable edit
363 const HuginBase::SrcPanoImage& img = m_pano->getImage(*sel.begin());
364 bool identical_projection=true;
365 HuginBase::SrcPanoImage::Projection proj = img.getProjection();
366 double focallength = HuginBase::SrcPanoImage::calcFocalLength(img.getProjection(), img.getHFOV(),
367 img.getCropFactor(),img.getSize());;
368 double cropFactor=img.getCropFactor();
369 for (HuginBase::UIntSet::const_iterator it = sel.begin(); it != sel.end(); ++it)
370 {
371 const HuginBase::SrcPanoImage& img2 = m_pano->getImage(*it);
372 if(proj!=img2.getProjection())
373 {
375 };
376 double focallength2 = HuginBase::SrcPanoImage::calcFocalLength(img2.getProjection(), img2.getHFOV(),
377 img2.getCropFactor(),img2.getSize());
378 if(focallength>0 && fabs(focallength-focallength2)>0.05)
379 {
380 focallength=-1;
381 };
382 if(fabs(cropFactor-img2.getCropFactor())>0.1)
383 {
384 cropFactor=-1;
385 };
386 };
387
389 {
391 }
392 else
393 {
394 m_lenstype->Select(wxNOT_FOUND);
395 };
396 if(focallength>0)
397 {
398 // use ChangeValue explicit, SetValue would create EVT_TEXT event which collides with our TextKillFocusHandler
400 }
401 else
402 {
403 m_focallength->Clear();
404 };
405 if(cropFactor>0)
406 {
408 }
409 else
410 {
411 m_cropfactor->Clear();
412 };
413
414 if (sel.size() == 1)
415 {
416 ShowImage(*(sel.begin()));
417 }
418 else
419 {
420 m_smallImgCtrl->SetBitmap(m_empty);
421 m_smallImgCtrl->GetParent()->Layout();
422 m_smallImgCtrl->Refresh();
423 };
424 }
425}
426
428{
429 // disable controls
430 m_lenstype->Disable();
431 m_focallength->Disable();
432 m_cropfactor->Disable();
433 m_smallImgCtrl->SetBitmap(m_empty);
434 m_smallImgCtrl->GetParent()->Layout();
435 m_smallImgCtrl->Refresh();
436}
437
439{
440 // enable control if not already enabled
441 m_lenstype->Enable();
442 m_focallength->Enable();
443 m_cropfactor->Enable();
444}
445
446void ImagesPanel::ShowImage(unsigned int imgNr)
447{
448 m_showImgNr = imgNr;
450}
451
453{
455 {
456 return;
457 }
458 ImageCache::EntryPtr cacheEntry = ImageCache::getInstance().getSmallImageIfAvailable(
459 m_pano->getImage(m_showImgNr).getFilename());
460 if (!cacheEntry.get())
461 {
462 // image currently isn't loaded.
463 // Instead of loading and displaying the image now, request it for
464 // later. Then the user can switch between images in the list quickly,
465 // even when not all images previews are in the cache.
466 thumbnail_request = ImageCache::getInstance().requestAsyncSmallImage(
467 m_pano->getImage(m_showImgNr).getFilename());
468 // When the image is ready, try this function again.
469 thumbnail_request->ready.push_back(
470 std::bind(&ImagesPanel::UpdatePreviewImage, this)
471 );
472 } else {
473 // forget any request now the image has loaded.
474 thumbnail_request = ImageCache::RequestPtr();
475 GeneratePreviewSelectedFile(m_smallImgCtrl, cacheEntry, huginApp::Get()->HasMonitorProfile(), huginApp::Get()->GetMonitorProfile());
476 }
477}
478
480{
483 m_CPDetectorChoice->InvalidateBestSize();
484 m_CPDetectorChoice->GetParent()->Layout();
485 Refresh();
486};
487
488void ImagesPanel::OnLensTypeChanged (wxCommandEvent & e)
489{
490 size_t var = GetSelectedValue(m_lenstype);
492 if(!images.empty())
493 {
494 const HuginBase::SrcPanoImage & img = m_pano->getImage(*(images.begin()));
495 double focal_length = HuginBase::SrcPanoImage::calcFocalLength(img.getProjection(), img.getHFOV(), img.getCropFactor(), img.getSize());
496 std::vector<PanoCommand::PanoCommand*> commands;
497 commands.push_back(new PanoCommand::ChangeImageProjectionCmd(*m_pano, images,(HuginBase::SrcPanoImage::Projection) var));
498 commands.push_back(new PanoCommand::UpdateFocalLengthCmd(*m_pano, images, focal_length));
501 );
502 // check if fisheye projections is selected
503 if (wxConfig::Get()->Read("/ShowFisheyeCropHint", 1l) == 1 &&
508 {
509 // if so, show hint about crop and open tab when requested
510 wxDialog dlg;
511 wxXmlResource::Get()->LoadDialog(&dlg, NULL, "fisheye_show_crop_dlg");
512 if (dlg.ShowModal() == wxID_OK)
513 {
514 MainFrame::Get()->ShowMaskEditor(*(images.begin()), true);
515 };
516 if (XRCCTRL(dlg, "fisheye_crop_dont_ask_checkbox", wxCheckBox)->IsChecked())
517 {
518 wxConfig::Get()->Write("/ShowFisheyeCropHint", 0l);
519 };
520 };
521 };
522};
523
524void ImagesPanel::OnFocalLengthChanged(wxCommandEvent & e)
525{
526 if (m_pano->getNrOfImages() == 0)
527 {
528 return;
529 };
530
531 wxString text = m_focallength->GetValue();
532 if(text.IsEmpty())
533 {
534 return;
535 };
536 double val;
537 if (!hugin_utils::str2double(text, val))
538 {
539 return;
540 }
541 //no negative values, no zero input please
542 if (val<0.1)
543 {
544 wxBell();
545 return;
546 };
547
549 const HuginBase::SrcPanoImage& srcImg = m_pano->getImage(*(images.begin()));
551 {
552 double hfov=srcImg.calcHFOV(srcImg.getProjection(), val, srcImg.getCropFactor(), srcImg.getSize());
553 if(hfov>190)
554 {
556 wxString::Format(_("You have given a field of view of %.2f degrees.\n But the orthographic projection is limited to a field of view of 180 degress.\nDo you want still use that high value?"), hfov),
557 _("Hugin"), wxICON_EXCLAMATION | wxYES_NO, this) == wxNO)
558 {
561 return;
562 };
563 };
564 };
567 );
568}
569
570void ImagesPanel::OnCropFactorChanged(wxCommandEvent & e)
571{
572 if (m_pano->getNrOfImages() == 0)
573 {
574 return;
575 };
576
577 wxString text = m_cropfactor->GetValue();
578 if(text.IsEmpty())
579 {
580 return;
581 };
582 double val;
583 if (!hugin_utils::str2double(text, val))
584 {
585 return;
586 }
587 //no negative values, no zero input please
588 if (val<0.1)
589 {
590 wxBell();
591 return;
592 };
593
597 );
598}
599
601{
602 wxString text = m_overlap->GetValue();
603 if(text.IsEmpty())
604 {
605 return;
606 };
607 double val;
608 if (!hugin_utils::str2double(text, val))
609 {
610 return;
611 }
612 if(fabs(val)<0.001 || val>1)
613 {
614 hugin_utils::HuginMessageBox(_("The minimum overlap has to be greater than 0 and smaller than 1."),
615 _("Hugin"), wxOK | wxICON_INFORMATION, this);
616 return;
617 };
618 if (val < 0)
619 {
620 val = -1;
621 };
626 );
627};
628
629void ImagesPanel::OnMaxEvDiffChanged(wxCommandEvent& e)
630{
631 wxString text = m_maxEv->GetValue();
632 if(text.IsEmpty())
633 {
634 return;
635 };
636 double val;
637 if (!hugin_utils::str2double(text, val))
638 {
639 return;
640 }
641 if(val<0)
642 {
643 hugin_utils::HuginMessageBox(_("The maximum Ev difference has to be greater than 0."), _("Hugin"), wxOK | wxICON_INFORMATION, this);
644 return;
645 };
650 );
651};
652
654{
655 size_t sel=m_groupModeChoice->GetSelection();
657 m_groupModeChoice->Clear();
658 int* i=new int;
660 m_groupModeChoice->Append(_("None"), i);
661 i=new int;
663 m_groupModeChoice->Append(_("Lens"), i);
665 {
666 i=new int;
668 m_groupModeChoice->Append(_("Stacks"), i);
670 {
671 i=new int;
673 m_groupModeChoice->Append(_("Output layers"), i);
674 i=new int;
676 m_groupModeChoice->Append(_("Output stacks"), i);
677 };
678 };
679 if((m_guiLevel==GUI_ADVANCED && sel>2) || (m_guiLevel==GUI_SIMPLE && sel>1))
680 {
681 sel=0;
682 };
683 m_groupModeChoice->SetSelection(sel);
684 wxCommandEvent dummy;
686};
687
689{
691 m_optChoice->Clear();
692 int* i=new int;
694 m_optChoice->Append(_("Positions (incremental, starting from anchor)"), i);
695 i=new int;
697 m_optChoice->Append(_("Positions (y,p,r)"), i);
698 i=new int;
700 m_optChoice->Append(_("Positions and View (y,p,r,v)"), i);
701 i=new int;
703 m_optChoice->Append(_("Positions and Barrel Distortion (y,p,r,b)"), i);
704 i=new int;
706 m_optChoice->Append(_("Positions, View and Barrel (y,p,r,v,b)"), i);
707 i=new int;
710 {
711 m_optChoice->Append(_("Everything without translation"), i);
712 }
713 else
714 {
715 m_optChoice->Append(_("Everything"), i);
716 };
718 {
719 i=new int;
721 m_optChoice->Append(_("Positions and Translation (y,p,r,x,y,z)"), i);
722 i=new int;
724 m_optChoice->Append(_("Positions, Translation and View (y,p,r,x,y,z,v)"), i);
725 i=new int;
727 m_optChoice->Append(_("Positions, Translation and Barrel (y,p,r,x,y,z,b)"), i);
728 i=new int;
730 m_optChoice->Append(_("Positions, Translation, View and Barrel (y,p,r,x,y,z,v,b)"), i);
731 };
732 i=new int;
733 *i=0;
734 m_optChoice->Append(_("Custom parameters"), i);
735
737 m_optPhotoChoice->Clear();
738 i=new int;
740 m_optPhotoChoice->Append(_("Low dynamic range"), i);
741 i=new int;
743 m_optPhotoChoice->Append(_("Low dynamic range, variable white balance"), i);
745 {
746 i=new int;
748 m_optPhotoChoice->Append(_("High dynamic range, fixed exposure"), i);
749 i=new int;
751 m_optPhotoChoice->Append(_("High dynamic range, variable white balance, fixed exposure"), i);
752 };
753 i=new int;
754 *i=0;
755 m_optPhotoChoice->Append(_("Custom parameters"), i);
756 m_optChoice->GetParent()->Layout();
757 Refresh();
758};
759
761{
762 return m_optChoice->GetString(m_optChoice->GetSelection());
763};
764
765void ImagesPanel::OnGroupModeChanged(wxCommandEvent & e)
766{
767 ImagesTreeCtrl::GroupMode mode=ImagesTreeCtrl::GroupMode(*static_cast<int*>(m_groupModeChoice->GetClientData(m_groupModeChoice->GetSelection())));
769 XRCCTRL(*this, "images_text_overlap", wxStaticText)->Show(mode==ImagesTreeCtrl::GROUP_OUTPUTSTACK);
772 XRCCTRL(*this, "images_text_maxev", wxStaticText)->Show(mode==ImagesTreeCtrl::GROUP_OUTPUTLAYERS);
775 Layout();
776 Refresh();
777};
778
779void ImagesPanel::OnDisplayModeChanged(wxCommandEvent & e)
780{
781 wxRadioBox* display=XRCCTRL(*this,"images_column_radiobox", wxRadioBox);
783};
784
786{
787 int optSwitch=*static_cast<int*>(m_optChoice->GetClientData(m_optChoice->GetSelection()));
788 if(optSwitch!=m_pano->getOptimizerSwitch())
789 {
792 );
793 };
794};
795
797{
798 int optSwitch=*static_cast<int*>(m_optPhotoChoice->GetClientData(m_optPhotoChoice->GetSelection()));
799 if(optSwitch!=m_pano->getPhotometricOptimizerSwitch())
800 {
803 );
804 };
805};
806
808{
813 wxStaticText* textlabel=XRCCTRL(*this, "images_mode_text", wxStaticText);
814 switch(m_guiLevel)
815 {
816 case GUI_SIMPLE:
817 textlabel->SetLabel(_("Simple interface"));
818 break;
819 case GUI_ADVANCED:
820 textlabel->SetLabel(_("Advanced interface"));
821 break;
822 case GUI_EXPERT:
823 textlabel->SetLabel(_("Expert interface"));
824 break;
825 };
826 textlabel->GetParent()->Layout();
827 textlabel->Refresh();
829};
830
831void ImagesPanel::OnOptimizeButton(wxCommandEvent &e)
832{
833 hugin_utils::DisableWindow disableButton(XRCCTRL(*this, "images_optimize", wxButton));
835};
836
838{
839 hugin_utils::DisableWindow disableButton(XRCCTRL(*this, "images_photo_optimize", wxButton));
841};
842
843IMPLEMENT_DYNAMIC_CLASS(ImagesPanel, wxPanel)
844
846 : wxXmlResourceHandler()
847{
849}
850
852{
854
855 cp->Create(m_parentAsWindow,
856 GetID(),
857 GetPosition(), GetSize(),
858 GetStyle("style"),
859 GetName());
860
861 SetupWindow( cp);
862 return cp;
863}
864
866{
867 return IsOfClass(node, "ImagesPanel");
868}
869
870IMPLEMENT_DYNAMIC_CLASS(ImagesPanelXmlHandler, wxXmlResourceHandler)
wxString GetDataPath()
return path to data directory, it depends on operating system
GuiLevel
Definition GuiLevel.h:32
@ GUI_EXPERT
Definition GuiLevel.h:35
@ GUI_ADVANCED
Definition GuiLevel.h:34
@ GUI_SIMPLE
Definition GuiLevel.h:33
void DeleteClientData(wxChoice *cb)
declaration of main image tree control
void FillLensProjectionList(wxControlWithItems *list)
Fills a wxControlWithItem with all input projection formats, the client data contains the associated ...
Definition LensTools.cpp:37
size_t GetSelectedValue(wxControlWithItems *list)
Returns the client value of the selected item from list.
void SelectListValue(wxControlWithItems *list, size_t newValue)
Selects the given value (stored in the client data) in the given list item.
some helper classes for graphes
some definitions to work with optimizer master switches
Somewhere to specify what variables belong to what.
Base class for control point creators.
virtual HuginBase::CPVector automatch(CPDetectorSetting &setting, HuginBase::Panorama &pano, const HuginBase::UIntSet &imgs, int nFeatures, int &ret_value, wxWindow *parent=NULL)
Do cp matching, calles the right routines, based on the matcher selected.
void FillControl(wxControlWithItems *control, bool select_default=false, bool show_default=false)
fills a wxControlWithItems with the available generators
void Read(wxConfigBase *config=wxConfigBase::Get(), wxString loadFromFile=wxEmptyString)
read the settings of different cp generators from config
void Write(wxConfigBase *config=wxConfigBase::Get())
writes the settings of different cp generators to config
ArraySettings settings
array which stores the different autopano settings
class, which stores all settings of one cp detector
Panorama image options.
Model for a panorama.
Definition Panorama.h:153
const SrcPanoImage & getImage(std::size_t nr) const
get a panorama image, counting starts with 0
Definition Panorama.h:211
const PanoramaOptions & getOptions() const
returns the options for this panorama
Definition Panorama.h:481
void addObserver(PanoramaObserver *o)
add a panorama observer.
const int getPhotometricOptimizerSwitch() const
return the photometric optimizer master switch
Definition Panorama.h:467
bool removeObserver(PanoramaObserver *observer)
remove a panorama observer.
const int getOptimizerSwitch() const
returns optimizer master switch
Definition Panorama.h:461
std::size_t getNrOfImages() const
number of images.
Definition Panorama.h:205
All variables of a source image.
static double calcFocalLength(SrcPanoImage::Projection proj, double hfov, double crop, vigra::Size2D imageSize)
calcualte focal length, given crop factor and hfov
static double calcHFOV(SrcPanoImage::Projection proj, double fl, double crop, vigra::Size2D imageSize)
calculate hfov of an image given focal length, image size and crop factor
virtual bool CanHandle(wxXmlNode *node)
virtual wxObject * DoCreateResource()
Hugin's first panel.
Definition ImagesPanel.h:41
void OnFocalLengthChanged(wxCommandEvent &e)
updates the focal length for the selected images
wxStaticBitmap * m_smallImgCtrl
pointer to the preview image control
void OnLensTypeChanged(wxCommandEvent &e)
updates the lens type for the selected images
void OnMinimumOverlapChanged(wxCommandEvent &e)
updates the minimum overlap
void OnPhotometricOptimizerSwitchChanged(wxCommandEvent &e)
event handler, when photometric optimizer master switch was changed
void OnGroupModeChanged(wxCommandEvent &e)
event handler when grouping selection was changed
wxChoice * m_CPDetectorChoice
bool Create(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL, const wxString &name="panel")
wxString GetCurrentOptimizerString()
return the currently selected optimizer setting as string from the drop down list box
void RunCPGenerator(CPDetectorSetting &setting, const HuginBase::UIntSet &img)
run the cp generator with the given setting on selected images
wxChoice * m_groupModeChoice
HuginBase::ImageCache::RequestPtr thumbnail_request
Request for thumbnail image.
void CPGenerate(wxCommandEvent &e)
control point detection event handler
size_t m_showImgNr
void EnableImageCtrls()
wxButton * m_matchingButton
wxBitmap m_empty
bitmap with default image
wxChoice * m_optChoice
pointer to optimizer switch selector
void SetGuiLevel(GuiLevel newGuiLevel)
sets the GuiLevel for all controls on this panel
void OnCropFactorChanged(wxCommandEvent &e)
updates the crop factor for the selected images
virtual void panoramaChanged(HuginBase::Panorama &pano)
this is called whenever the panorama has changed.
wxTextCtrl * m_focallength
the text input control for focal length
wxChoice * m_optPhotoChoice
pointer to photometric optimizer switch selector
virtual void panoramaImagesChanged(HuginBase::Panorama &pano, const HuginBase::UIntSet &imgNr)
notifies about changes to images
void UpdatePreviewImage()
void DisableImageCtrls()
void OnSize(wxSizeEvent &e)
void FillOptimizerChoice()
fills the optmizer wxChoices with values depending on GuiLevel
GuiLevel m_guiLevel
void OnSelectionChanged(wxTreeEvent &e)
change displayed variables if the selection has changed.
wxChoice * m_lenstype
pointer to lens type selector
void OnOptimizeButton(wxCommandEvent &e)
event handler for geometric optimizer
CPDetectorConfig cpdetector_config
void ReloadCPDetectorSettings()
Reloads the cp detector settings from config, necessary after edit preferences.
void OnOptimizerSwitchChanged(wxCommandEvent &e)
event handler, when optimizer master switch was changed
void FillGroupChoice()
fills the grouping wxChoice with values depending on GuiLevel
HuginBase::Panorama * m_pano
the model
Definition ImagesPanel.h:97
wxTextCtrl * m_maxEv
the text input control for max ev difference
wxTextCtrl * m_cropfactor
the text input control for crop factor
void OnDisplayModeChanged(wxCommandEvent &e)
event handler when display mode (which information should be shown) was changed
void OnMaxEvDiffChanged(wxCommandEvent &e)
updates the max ev difference
void ShowImage(unsigned int imgNr)
show a bigger thumbnail
ImagesTreeCtrl * m_images_tree
pointer to the main control
const wxString GetSelectedCPGenerator()
return the currently selected cp generator description
void Init(HuginBase::Panorama *pano)
wxTextCtrl * m_overlap
the text input control for minimum overlap
void OnPhotometricOptimizeButton(wxCommandEvent &e)
event handler for photometric optimizer
the main images tree control, used on images and optimizer tabs
Definition ImagesTree.h:37
HuginBase::UIntSet GetSelectedImages()
returns the selected images
void SetGuiLevel(GuiLevel newSetting)
sets the GuiLevel of the control
void Init(HuginBase::Panorama *pano)
initialization, connects all control with Panorama, register observer
void SetGroupMode(GroupMode newMode)
sets the group mode to given mode
GroupMode
enumeration for grouping mode
Definition ImagesTree.h:41
void SetDisplayMode(DisplayMode newMode)
sets the display mode to given mode
DisplayMode
enumeration for display mode, limits the displayed columns
Definition ImagesTree.h:50
static MainFrame * Get()
hack.. kind of a pseudo singleton...
void OnPhotometricOptimize(wxCommandEvent &e)
void ShowMaskEditor(size_t imgNr, bool switchToCropMode=false)
opens the mask/crop editor with the given image selected
void OnOptimize(wxCommandEvent &e)
add multiple control points
PanoCommand to combine other PanoCommands.
Definition PanoCommand.h:40
void addCommand(PanoCommand *command, bool execute=true)
Adds a command to the history.
static GlobalCmdHist & getInstance()
set the panorama options
Update the crop factor.
Update the focal length.
update the optimizer master switch
update the photometric optimizer master switch
Handle EVT_KILL_FOCUS and convert it to a EVT_TEXT_ENTER event.
static huginApp * Get()
hack.. kind of a pseudo singleton...
Definition huginApp.cpp:639
helper class, it disables the control/window in the constructor and automatically enables it back in ...
Definition wxutils.h:98
#define HUGIN_ASS_NCONTROLPOINTS
implementation of huginApp Class
#define DEBUG_ASSERT(cond)
Definition utils.h:80
#define DEBUG_DEBUG(msg)
Definition utils.h:68
#define DEBUG_TRACE(msg)
Definition utils.h:67
#define DEBUG_INFO(msg)
Definition utils.h:69
std::vector< ControlPoint > CPVector
std::set< unsigned int > UIntSet
bool str2double(const wxString &s, double &d)
wxString doubleTowxString(double d, int digits)
int HuginMessageBox(const wxString &message, const wxString &caption, int style, wxWindow *parent)
Definition wxutils.cpp:176
include file for the hugin project
include file for the hugin project
void fill_set(_Container &c, typename _Container::key_type begin, typename _Container::key_type end)
Definition stl_utils.h:81
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
void GeneratePreviewSelectedFile(wxStaticBitmap *control, ImageCache::EntryPtr cacheEntry, const bool hasMonitorProfile, const cmsHPROFILE &monitorProfile)
load given image from image cache and display in wxStaticBitmap control
platform/compiler specific stuff.