28 #include "hugin_config.h"
29 #include <wx/stdpaths.h>
43 #include <pano13/queryfeature.h>
67 : pano(0), m_guiLevel(
GUI_SIMPLE), updatesDisabled(false)
72 bool PanoPanel::Create(wxWindow *parent, wxWindowID
id,
const wxPoint& pos,
const wxSize& size,
73 long style,
const wxString& name)
75 if (! wxPanel::Create(parent,
id, pos, size, style, name)) {
79 wxXmlResource::Get()->LoadPanel(
this,
"panorama_panel");
80 wxPanel * panel = XRCCTRL(*
this,
"panorama_panel", wxPanel);
82 wxBoxSizer *topsizer =
new wxBoxSizer( wxVERTICAL );
83 topsizer->Add(panel, 1, wxEXPAND, 0);
95 #ifdef ThisNeverHappens
97 wxLogMessage(_(
"Fisheye"));
98 wxLogMessage(_(
"Stereographic"));
99 wxLogMessage(_(
"Mercator"));
100 wxLogMessage(_(
"Trans Mercator"));
101 wxLogMessage(_(
"Sinusoidal"));
102 wxLogMessage(_(
"Lambert Cylindrical Equal Area"));
103 wxLogMessage(_(
"Lambert Equal Area Azimuthal"));
104 wxLogMessage(_(
"Albers Equal Area Conic"));
105 wxLogMessage(_(
"Miller Cylindrical"));
106 wxLogMessage(_(
"Panini"));
107 wxLogMessage(_(
"Architectural"));
108 wxLogMessage(_(
"Orthographic"));
109 wxLogMessage(_(
"Equisolid"));
110 wxLogMessage(_(
"Equirectangular Panini"));
111 wxLogMessage(_(
"Biplane"));
112 wxLogMessage(_(
"Triplane"));
113 wxLogMessage(_(
"Panini General"));
114 wxLogMessage(_(
"Thoby Projection"));
115 wxLogMessage(_(
"Hammer-Aitoff Equal Area"));
119 int nP = panoProjectionFormatCount();
120 for(
int n=0; n < nP; n++) {
121 pano_projection_features proj;
122 if (panoProjectionFeaturesQuery(n, &proj)) {
123 wxString str2(proj.name, wxConvLocal);
127 m_HFOVText = XRCCTRL(*
this,
"pano_text_hfov" ,wxTextCtrl);
134 m_VFOVText = XRCCTRL(*
this,
"pano_text_vfov" ,wxTextCtrl);
140 m_WidthTxt = XRCCTRL(*
this,
"pano_val_width", wxTextCtrl);
149 m_HeightTxt = XRCCTRL(*
this,
"pano_val_height", wxTextCtrl);
155 m_ROILeftTxt = XRCCTRL(*
this,
"pano_val_roi_left", wxTextCtrl);
161 m_ROIRightTxt = XRCCTRL(*
this,
"pano_val_roi_right", wxTextCtrl);
166 m_ROITopTxt = XRCCTRL(*
this,
"pano_val_roi_top", wxTextCtrl);
172 m_ROIBottomTxt = XRCCTRL(*
this,
"pano_val_roi_bottom", wxTextCtrl);
224 m_pano_ctrls = XRCCTRL(*
this,
"pano_controls_panel", wxScrolledWindow);
261 wxConfigBase::Get()->Write(
"Stitcher/DefaultRemapper",
m_RemapperChoice->GetSelection());
262 wxConfigBase::Get()->Flush();
282 #ifdef STACK_CHECK //Disabled for 0.7.0 release
285 const bool hasStacks =
false;
306 DEBUG_DEBUG(hdrStacks.size() <<
": HDR stacks detected");
307 const bool hasStacks = (hdrStacks.size() != activeImages.size());
358 m_HFOVText->ChangeValue(wxString(val.c_str(), wxConvLocal));
360 m_VFOVText->ChangeValue(wxString(val.c_str(), wxConvLocal));
378 wxString label = wxString::Format(
"%d x %d", opt.
getROI().width(), opt.
getROI().height());
380 if ( (opt.
getROI().width() / 1000.0) * opt.
getROI().height() / 1000.0 >= 20.0)
382 label.Append(wxString::Format(
"=%.0f MP", (opt.
getROI().width() / 1000.0) * opt.
getROI().height() / 1000.0));
386 label.Append(wxString::Format(
"=%.1f MP", opt.
getROI().area() / 1000000.0));
388 if (opt.
getROI().width() >0 && opt.
getROI().height() > 0)
393 label.Append(wxString::Format(
", %d:%d", opt.
getROI().width() / commonDivisor, opt.
getROI().height() / commonDivisor));
397 float ratio = 1.0f * opt.
getROI().width() / opt.
getROI().height();
400 label.Append(wxString::Format(
", %.2f:1", ratio));
404 label.Append(wxString::Format(
", 1:%.2f", 1.0f/ratio));
408 XRCCTRL(*
this,
"pano_size_label", wxStaticText)->SetLabel(label);
412 XRCCTRL(*
this,
"pano_cb_ldr_output_blended", wxCheckBox)->SetValue(opt.
outputLDRBlended);
415 XRCCTRL(*
this,
"pano_cb_hdr_output_blended", wxCheckBox)->SetValue(opt.
outputHDRBlended);
420 XRCCTRL(*
this,
"pano_cb_ldr_output_layers", wxCheckBox)->SetValue(opt.
outputLDRLayers);
424 XRCCTRL(*
this,
"pano_cb_hdr_output_layers", wxCheckBox)->SetValue(opt.
outputHDRLayers);
429 XRCCTRL(*
this,
"pano_cb_ldr_output_stacks", wxCheckBox)->SetValue(opt.
outputLDRStacks);
431 XRCCTRL(*
this,
"pano_cb_hdr_output_stacks", wxCheckBox)->SetValue(opt.
outputHDRStacks);
451 bool any_output_possible = hasImages && anyOutputSelected;
454 #ifdef STACK_CHECK //Disabled for 0.7.0 release
456 XRCCTRL(*
this,
"pano_cb_ldr_output_blended",wxCheckBox)->Disable();
457 XRCCTRL(*
this,
"pano_cb_ldr_output_layers",wxCheckBox)->Disable();
459 XRCCTRL(*
this,
"pano_cb_ldr_output_exposure_layers",wxCheckBox)->Enable();
460 XRCCTRL(*
this,
"pano_cb_ldr_output_exposure_blended",wxCheckBox)->Enable();
461 XRCCTRL(*
this,
"pano_cb_ldr_output_exposure_remapped",wxCheckBox)->Enable();
462 XRCCTRL(*
this,
"pano_cb_hdr_output_blended",wxCheckBox)->Enable();
463 XRCCTRL(*
this,
"pano_cb_hdr_output_stacks",wxCheckBox)->Enable();
464 XRCCTRL(*
this,
"pano_cb_hdr_output_layers",wxCheckBox)->Enable();
467 XRCCTRL(*
this,
"pano_cb_ldr_output_blended",wxCheckBox)->Enable();
468 XRCCTRL(*
this,
"pano_cb_ldr_output_layers",wxCheckBox)->Enable();
470 XRCCTRL(*
this,
"pano_cb_ldr_output_exposure_layers",wxCheckBox)->Disable();
471 XRCCTRL(*
this,
"pano_cb_ldr_output_exposure_blended",wxCheckBox)->Disable();
472 XRCCTRL(*
this,
"pano_cb_ldr_output_exposure_remapped",wxCheckBox)->Disable();
474 XRCCTRL(*
this,
"pano_cb_hdr_output_blended",wxCheckBox)->Disable();
475 XRCCTRL(*
this,
"pano_cb_hdr_output_stacks",wxCheckBox)->Disable();
476 XRCCTRL(*
this,
"pano_cb_hdr_output_layers",wxCheckBox)->Disable();
497 XRCCTRL(*
this,
"pano_button_blender_opts", wxButton)->Enable(blenderEnabled);
499 XRCCTRL(*
this,
"pano_text_blender", wxStaticText)->Enable(blenderEnabled);
502 XRCCTRL(*
this,
"pano_button_fill_opts", wxButton)->Enable(
m_edgeFillChoice->GetSelection() != 0);
507 XRCCTRL(*
this,
"pano_button_fusion_opts", wxButton)->Enable(fusionEnabled);
509 XRCCTRL(*
this,
"pano_text_fusion", wxStaticText)->Enable(fusionEnabled);
515 XRCCTRL(*
this,
"pano_button_hdrmerge_opts", wxButton)->Enable(hdrMergeEnabled);
517 XRCCTRL(*
this,
"pano_text_hdrmerge", wxStaticText)->Enable(hdrMergeEnabled);
532 XRCCTRL(*
this,
"pano_output_ldr_format_label", wxStaticText)->Enable(ldr_pano_enabled);
573 wxLogError(
"INTERNAL error: unknown output image type");
579 XRCCTRL(*
this,
"pano_output_hdr_format_label", wxStaticText)->Enable(hdr_pano_enabled);
580 XRCCTRL(*
this,
"pano_output_hdr_format_label", wxStaticText)->Show(hdr_pano_enabled ||
m_guiLevel>
GUI_SIMPLE);
607 wxLogError(
"INTERNAL error: unknown hdr output image type");
616 this->Refresh(
false);
644 DEBUG_INFO (
"HFOV = " << text.mb_str(wxConvLocal) );
645 if (text == wxEmptyString) {
651 wxLogError(_(
"Value must be numeric."));
656 wxLogError(wxString::Format(
657 _(
"Invalid HFOV value. Maximum HFOV for this projection is %lf."),
675 DEBUG_INFO (
"VFOV = " << text.mb_str(wxConvLocal) );
676 if (text == wxEmptyString) {
682 wxLogError(_(
"Value must be numeric."));
687 wxLogError(wxString::Format(
688 _(
"Invalid VFOV value. Maximum VFOV for this projection is %lf."),
727 if (nWidth <= 0)
return;
734 wxLogError(_(
"width needs to be an integer bigger than 0"));
744 if(nHeight <= 0)
return;
751 wxLogError(_(
"height needs to be an integer bigger than 0"));
759 long left, right, top, bottom;
761 wxLogError(_(
"Top needs to be an integer bigger than 0"));
765 wxLogError(_(
"left needs to be an integer bigger than 0"));
769 wxLogError(_(
"right needs to be an integer bigger than 0"));
773 wxLogError(_(
"bottom needs to be an integer bigger than 0"));
776 opt.
setROI(vigra::Rect2D(left, top, right, bottom));
779 if(opt.
getROI().width()<1) {
780 wxLogError(_(
"Left boundary must be smaller than right."));
785 if(opt.
getROI().height()<1) {
786 wxLogError(_(
"Top boundary must be smaller than bottom."));
831 wxXmlResource::Get()->LoadDialog(&dlg,
this,
"nona_options_dialog");
832 wxChoice * interpol_choice = XRCCTRL(dlg,
"nona_choice_interpolator", wxChoice);
833 wxCheckBox * cropped_cb = XRCCTRL(dlg,
"nona_save_cropped", wxCheckBox);
836 dlg.CentreOnParent();
838 if (dlg.ShowModal() == wxID_OK) {
839 int interpol = interpol_choice->GetSelection();
849 wxLogError(_(
"PTmender options not yet implemented"));
868 wxXmlResource::Get()->LoadDialog(&dlg,
this,
"enblend_options_dialog");
869 wxTextCtrl * enblend_opts_text = XRCCTRL(dlg,
"blender_arguments_text", wxTextCtrl);
870 enblend_opts_text->ChangeValue(wxString(opt.
enblendOptions.c_str(), wxConvLocal));
871 dlg.Bind(wxEVT_COMMAND_BUTTON_CLICKED, [](wxCommandEvent &) {
MainFrame::Get()->
DisplayHelp(
"Enblend.html"); }, wxID_HELP);
872 dlg.CentreOnParent();
874 if (dlg.ShowModal() == wxID_OK) {
875 opt.
enblendOptions = enblend_opts_text->GetValue().mb_str(wxConvLocal);
886 wxXmlResource::Get()->LoadDialog(&dlg,
this,
"verdandi_options_dialog");
887 wxChoice * verdandiBlendModeChoice = XRCCTRL(dlg,
"verdandi_blend_mode_choice", wxChoice);
890 verdandiBlendModeChoice->SetSelection(1);
894 verdandiBlendModeChoice->SetSelection(0);
896 dlg.CentreOnParent();
898 if (dlg.ShowModal() == wxID_OK)
900 if (verdandiBlendModeChoice->GetSelection() == 1)
913 wxLogError(_(
"PTblender options not yet implemented"));
937 wxXmlResource::Get()->LoadDialog(&dlg,
this,
"filledge_options_dialog");
938 wxCheckBox* keepUnfillVersion = XRCCTRL(dlg,
"edgefill_save_input", wxCheckBox);
940 dlg.CentreOnParent();
942 if (dlg.ShowModal() == wxID_OK)
952 DEBUG_DEBUG(
"changing stacking program to " << fusion);
959 wxXmlResource::Get()->LoadDialog(&dlg,
this,
"enfuse_options_dialog");
960 wxTextCtrl * enfuse_opts_text = XRCCTRL(dlg,
"enfuse_arguments_text", wxTextCtrl);
961 enfuse_opts_text->ChangeValue(wxString(opt.
enfuseOptions.c_str(), wxConvLocal));
962 dlg.Bind(wxEVT_COMMAND_BUTTON_CLICKED, [](wxCommandEvent &) {
MainFrame::Get()->
DisplayHelp(
"Enfuse.html"); }, wxID_HELP);
963 dlg.CentreOnParent();
965 if (dlg.ShowModal() == wxID_OK) {
966 opt.
enfuseOptions = enfuse_opts_text->GetValue().mb_str(wxConvLocal);
986 if (dlg.ShowModal() == wxOK)
994 wxLogError(_(
"Options for this HDRMerge program not yet implemented"));
1027 double sizeFactor = 1.0;
1028 if (wxGetKeyState(WXK_COMMAND))
1053 vigra::Rect2D newROI;
1065 if(!newROI.isEmpty())
1093 wxString tempDir= wxConfigBase::Get()->Read(
"tempDir",wxEmptyString);
1094 if(!tempDir.IsEmpty())
1095 if(tempDir.Last()!=wxFileName::GetPathSeparator())
1096 tempDir.Append(wxFileName::GetPathSeparator());
1097 wxString currentPTOfn = wxFileName::CreateTempFileName(tempDir+
"huginpto_");
1098 if(currentPTOfn.empty()) {
1102 DEBUG_DEBUG(
"tmp PTO file: " << (
const char *)currentPTOfn.mb_str(wxConvLocal));
1109 #if defined __WXMAC__ && defined MAC_SELF_CONTAINED_BUNDLE
1111 wxString hugin_stitch_project = MacGetPathToBundledAppMainExecutableFile(CFSTR(
"HuginStitchProject.app"));
1112 if(hugin_stitch_project == wxEmptyString)
1114 DEBUG_ERROR(
"hugin_stitch_project could not be found in the bundle.");
1118 #elif defined __WXMAC__
1120 wxFileName hugin_stitch_project_app(INSTALL_OSX_BUNDLE_DIR, wxEmptyString);
1121 hugin_stitch_project_app.AppendDir(
"HuginStitchProject.app");
1122 CFStringRef stitchProjectAppPath = MacCreateCFStringWithWxString(hugin_stitch_project_app.GetFullPath());
1123 wxString hugin_stitch_project = MacGetPathToMainExecutableFileOfBundle(stitchProjectAppPath);
1124 CFRelease(stitchProjectAppPath);
1126 wxString hugin_stitch_project =
"hugin_stitch_project";
1131 outputPrefix.Normalize(wxPATH_NORM_ABSOLUTE | wxPATH_NORM_DOTS | wxPATH_NORM_TILDE | wxPATH_NORM_SHORTCUT);
1137 wxFileDialog dlg(
this,_(
"Specify output prefix"),
1138 outputPrefix.GetPath(), outputPrefix.GetName(), wxEmptyString,
1139 wxFD_SAVE, wxDefaultPosition);
1140 if (dlg.ShowModal() != wxID_OK)
1147 list.Add(dlg.GetPath());
1149 if(dlg.ShowModal()!=wxID_OK)
1152 wxFileName prefix(dlg.GetPath());
1153 while (!prefix.IsDirWritable())
1155 hugin_utils::HuginMessageBox(wxString::Format(_(
"You have no permissions to write in folder \"%s\".\nPlease select another folder for the final output."), prefix.GetPath()),
1156 _(
"Hugin"), wxOK | wxICON_INFORMATION, wxGetActiveWindow());
1157 if (dlg.ShowModal() != wxID_OK)
1161 prefix = dlg.GetPath();
1169 wxString switches(
" --delete -o ");
1172 switches =
" --overwrite" + switches;
1174 if (!userDefinedSetting.IsEmpty())
1180 wxConfigBase::Get()->Flush();
1184 wxProcess *my_process =
new wxProcess(
this);
1185 my_process->Redirect();
1188 my_process->Detach();
1189 wxExecute(command,wxEXEC_ASYNC, my_process);
1214 wxString switches(
" ");
1227 if (!userDefinedSetting.IsEmpty())
1233 bool showDlg=wxConfigBase::Get()->Read(
"ShowSaveMessage", 1l)==1;
1239 wxXmlResource::Get()->LoadDialog(&dlg,
this,
"stitch_message_dlg");
1243 XRCCTRL(dlg,
"stitch_message_text", wxStaticText)->SetLabel(
1244 wxString::Format(_(
"The project %s will be automatically saved before it can be sent to the batch processor PTBatcherGUI.\nYou will then be asked for the prefix for the panorama output.\n\nYou may need to start the stitching in the batch processor\n PTBatcherGUI if it doesn't start automatically."),
1251 if(XRCCTRL(dlg,
"stitch_dont_show_checkbox", wxCheckBox)->IsChecked())
1253 wxConfigBase::Get()->Write(
"ShowSaveMessage", 0l);
1257 wxCommandEvent dummy;
1269 outputPrefix.Normalize(wxPATH_NORM_ABSOLUTE | wxPATH_NORM_DOTS | wxPATH_NORM_TILDE | wxPATH_NORM_SHORTCUT);
1273 wxFileDialog dlg(
this,_(
"Specify output prefix"),
1274 outputPrefix.GetPath(), outputPrefix.GetName(), wxEmptyString,
1275 wxFD_SAVE, wxDefaultPosition);
1276 if (dlg.ShowModal() != wxID_OK)
1283 list.Add(dlg.GetPath());
1285 if(dlg.ShowModal()!=wxID_OK)
1288 wxFileName prefix(dlg.GetPath());
1289 while (!prefix.IsDirWritable())
1291 hugin_utils::HuginMessageBox(wxString::Format(_(
"You have no permissions to write in folder \"%s\".\nPlease select another folder for the final output."), prefix.GetPath()),
1292 _(
"Hugin"), wxOK | wxICON_INFORMATION, wxGetActiveWindow());
1293 if (dlg.ShowModal() != wxID_OK)
1297 prefix = dlg.GetPath();
1305 #if defined __WXMAC__ && defined MAC_SELF_CONTAINED_BUNDLE
1306 wxString cmd = MacGetPathToMainExecutableFileOfRegisteredBundle(CFSTR(
"net.sourceforge.hugin.PTBatcherGUI"));
1307 if(cmd != wxEmptyString)
1318 hugin_utils::HuginMessageBox(wxString::Format(_(
"External program %s not found in the bundle, reverting to system path"),
"open"), _(
"Hugin"), wxOK | wxICON_ERROR, wxGetActiveWindow());
1324 const wxFileName exePath(wxStandardPaths::Get().GetExecutablePath());
1348 wxFileName userOutputSequence;
1349 if (settings.IsEmpty())
1352 wxConfigBase* config = wxConfigBase::Get();
1354 wxFileDialog userOutputDlg(
this, _(
"Select user defined output"),
1355 path, wxEmptyString, _(
"User defined output|*.executor"),
1356 wxFD_OPEN | wxFD_FILE_MUST_EXIST, wxDefaultPosition);
1357 if (userOutputDlg.ShowModal() != wxID_OK)
1362 config->Write(
"/userDefinedOutputPath", userOutputDlg.GetDirectory());
1363 userOutputSequence = userOutputDlg.GetPath();
1368 userOutputSequence = settings;
1369 if (!userOutputSequence.Exists())
1371 hugin_utils::HuginMessageBox(wxString::Format(
"User defined output %s not found.\nStopping processing.", userOutputSequence.GetFullPath()), _(
"Hugin"), wxOK | wxICON_INFORMATION, wxGetActiveWindow());
1381 bool readSettings =
true;
1382 if(wxGetKeyState(WXK_COMMAND))
1385 readSettings =
false;
1399 DoStitch(userDefinedSetting, readSettings);
1480 switch(e.GetSelection()) {
1507 switch(e.GetSelection()) {
1532 if (
id == XRCID(
"pano_cb_ldr_output_blended") ) {
1534 }
else if (
id == XRCID(
"pano_cb_ldr_output_layers") ) {
1536 }
else if (
id == XRCID(
"pano_cb_ldr_output_exposure_layers") ) {
1538 }
else if (
id == XRCID(
"pano_cb_ldr_output_exposure_blended") ) {
1540 }
else if (
id == XRCID(
"pano_cb_ldr_output_exposure_layers_fused") ) {
1542 }
else if (
id == XRCID(
"pano_cb_ldr_output_exposure_remapped") ) {
1544 }
else if (
id == XRCID(
"pano_cb_ldr_output_stacks") ) {
1546 }
else if (
id == XRCID(
"pano_cb_hdr_output_blended") ) {
1548 }
else if (
id == XRCID(
"pano_cb_hdr_output_stacks") ) {
1550 }
else if (
id == XRCID(
"pano_cb_hdr_output_layers") ) {
1562 const vigra::Rect2D cropped_region (opts.getROI());
1564 if (opts.outputImageType ==
"jpg" &&
1565 (opts.outputLDRBlended || opts.outputLDRExposureBlended || opts.outputLDRExposureLayersFused) &&
1566 (cropped_region.width()>65500 || cropped_region.height()>65500)
1570 wxString::Format(_(
"The width and height of jpeg images has to be smaller than 65500 pixel. But you have requested a jpeg image with %dx%d pixel.\nThis is not supported by the jpeg file format.\nDecrease the canvas size on the stitch panel or select TIF or PNG as output format."), cropped_region.width(), cropped_region.height()),
1571 _(
"Hugin"), wxICON_EXCLAMATION | wxOK, wxGetActiveWindow());
1575 const unsigned long long area = (
static_cast<unsigned long long>(cropped_region.width()) * cropped_region.height());
1577 if (area > 500000000)
1579 message = wxString::Format(_(
"The panorama you are trying to stitch is %.1f gigapixels.\nIf this is too big, reduce the panorama Canvas Size and the cropped region and stitch from the Stitcher tab. Stitching a panorama this size could take a long time and a large amount of memory."),
1580 area / 1000000000.0);
1584 if (cropped_region.width() > 32700 || cropped_region.height() > 32700)
1586 message = _(
"The width or the height of the final panorama exceeds 32700 pixel.\nSome programs have problems to open or display such big images.\n\nIf this is too big, reduce the panorama Canvas Size or the cropped region.");
1589 if (!message.empty())
1594 _(
"Hugin"), wxICON_EXCLAMATION | wxYES_NO, wxGetActiveWindow());
1595 dialog->SetExtendedMessage(message);
1596 dialog->SetYesNoLabels(_(
"Stitch anyway"), _(
"Let me fix that"));
1597 switch (dialog->ShowModal())
1607 if (!mainframe->IsShown())
1624 hugin_utils::HuginMessageBox(_(
"There are no active images in the output region.\nPlease check your settings, so that at least one image is in the output region."),
1625 _(
"Hugin"), wxOK | wxICON_INFORMATION, wxGetActiveWindow());
1627 return !images.empty();
1632 wxLongLong freeSpace;
1633 if (wxGetDiskSpace(folder, NULL, &freeSpace))
1638 hugin_utils::MessageDialog dialog =
hugin_utils::GetMessageDialog(wxString::Format(_(
"The folder \"%s\" has only %.1f MiB free. This is not enough for stitching the current panorama. Decrease the output size or select another output folder.\nAre you sure that you still want to stitch it?"), folder.c_str(), freeSpace.ToDouble() / 1048576.0),
1639 _(
"Hugin"), wxICON_EXCLAMATION | wxYES_NO, wxGetActiveWindow());
1640 dialog->SetYesNoLabels(_(
"Stitch anyway"), _(
"Let me fix that"));
1641 if (dialog->ShowModal() == wxID_NO)
1645 if (!mainframe->IsShown())
1666 : wxXmlResourceHandler()
1675 cp->Create(m_parentAsWindow,
1677 GetPosition(), GetSize(),
1688 return IsOfClass(node,
"PanoPanel");
void DisplayHelp(wxString section=wxEmptyString)
call help browser with given file
Dialog for reset panorama settings.
bool CheckHasImages()
check if the output contains images at all
void OnBlenderOptions(wxCommandEvent &e)
void SetCommandLineArgument(wxString cmd)
sets the currents state of the hdrmerge options
int gcd(int a, int b)
function to calculate greated common divisor using Euclidean algorithm both arguments should be >=0 ...
PanoramaOptions::ProjectionFormat getProjection() const
void BlenderChanged(wxCommandEvent &e)
std::vector< UIntSet > getHDRStacks(const PanoramaData &pano, UIntSet allImgs, PanoramaOptions opts)
returns vector of set of output stacks
bool FileExists(const std::string &filename)
checks if file exists
void HeightChanged(wxCommandEvent &e)
declaration of functions to handle stacks and layers
void OnNormalTIFFCompression(wxCommandEvent &e)
EdgeFillMode edgeFillMode
wxString GetDataPath()
return path to data directory, it depends on operating system
bool CheckFreeSpace(const wxString &folder)
check if there is enough free disk space
void ShowStitcherTab()
opens the stitcher tab
void setHeight(unsigned int h)
set panorama height
void EnableControls(bool enable)
enable/disable control influenced by quick mode
BlendingMechanism
blenders
void DoCalcFOV(wxCommandEvent &e)
bool str2double(const wxString &s, double &d)
void ProjectionChanged(wxCommandEvent &e)
void ROIChanged(wxCommandEvent &e)
bool outputLDRLayers
save remapped layers (LDR)
virtual wxObject * DoCreateResource()
bool fovCalcSupported(ProjectionFormat f) const
true, if FOV calcuations are supported for projection f
bool removeObserver(PanoramaObserver *observer)
remove a panorama observer.
std::unique_ptr< wxMessageDialogBase > MessageDialog
misc math function & classes used by other parts of the program
void OnFusionOptions(wxCommandEvent &e)
EdgeFillMode
edge fill modes
Definition of CPImagesComboBox and CPImagesComboBoxXmlHandler class.
str wxQuoteString(const str &arg)
Try to escape special chars on windows and linux.
void OnEdgeFillChanged(wxCommandEvent &e)
std::string outputImageTypeHDRCompression
bool outputHDRLayers
save remapped layers (HDR)
unsigned int getHeight() const
get panorama height
UIntSet getImagesinROI(const PanoramaData &pano, const UIntSet activeImages)
returns set of images which are visible in output ROI
void UpdateDisplay(const HuginBase::PanoramaOptions &opt, const bool hasStacks)
wxButton * m_CalcOptWidthButton
double getMaxHFOV() const
get maximum possible hfov with current projection
#define DEBUG_ASSERT(cond)
bool SaveLensDataFromPano(const HuginBase::Panorama &pano)
routine for automatically saving information from pano into database
std::string enfuseOptions
HuginBase::Panorama * pano
include file for the hugin project
wxString GetCommandLineArgument()
returns the hdrmerge options as command line arguments
virtual void run()
runs the algorithm.
std::string outputImageTypeCompression
bool Create(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL, const wxString &name="panel")
void DoUserDefinedStitch(const wxString &settings=wxString())
stitching with user defined file
wxScrolledWindow * m_pano_ctrls
std::string doubleToString(double d, int digits)
convert a double to a string, suitable for display within a GUI.
MessageDialog GetMessageDialog(const wxString &message, const wxString &caption, int style, wxWindow *parent)
void SetGuiLevel(GuiLevel newGuiLevel)
void OnRemapperOptions(wxCommandEvent &e)
bool outputLDRExposureBlended
< save exposure fused stacks (no exposure adjustment)
void VFOVChanged(wxCommandEvent &e)
std::set< unsigned int > UIntSet
wxStaticText * m_FileFormatOptionsLabel
class to access Hugins camera and lens database
void Init(HuginBase::Panorama *pano)
wxTextCtrl * m_ROIBottomTxt
const vigra::Rect2D & getROI() const
Definition of dialog for hdrmerge options.
bool outputLDRBlended
save blended panorama (LDR)
void RemapperChanged(wxCommandEvent &e)
wxTextCtrl * m_ROILeftTxt
wxChoice * m_BlenderChoice
wxChoice * m_edgeFillChoice
std::size_t getNrOfImages() const
number of images.
static MainFrame * Get()
hack.. kind of a pseudo singleton...
wxTextCtrl * m_FileFormatJPEGQualityText
wxChoice * m_FusionChoice
vigra_ext::Interpolator interpolator
float pow(float a, double b)
virtual void panoramaChanged(HuginBase::Panorama &pano)
this is called whenever the panorama has changed.
wxChoice * m_RemapperChoice
static double calcOptimalScale(PanoramaData &panorama)
virtual vigra::Rect2D getResultOptimalROI()
return the ROI structure?, for now area
double getMaxVFOV() const
get maximum possible vfov with current projection
virtual double getResultHeight()
IMPLEMENT_DYNAMIC_CLASS(wxTreeListHeaderWindow, wxWindow)
bool outputHDRBlended
save blended panorama (HDR)
void OnHDRTIFFCompression(wxCommandEvent &e)
static GlobalCmdHist & getInstance()
void OnEdgeFillOptions(wxCommandEvent &e)
void FileFormatChanged(wxCommandEvent &e)
#define HUGIN_PROCESSOR_START
void addCommand(PanoCommand *command, bool execute=true)
Adds a command to the history.
void FusionChanged(wxCommandEvent &e)
wxChoice * m_HDRMergeChoice
wxChoice * m_FileFormatHDRTIFFCompChoice
void setROI(const vigra::Rect2D &val)
void WidthChanged(wxCommandEvent &e)
void OnSaveProject(wxCommandEvent &e)
UIntSet getActiveImages() const
get active images
wxChoice * m_ProjectionChoice
std::string tiffCompression
std::string verdandiOptions
#define HUGIN_PROCESSOR_OVERWRITE
void OnJPEGQualityText(wxCommandEvent &e)
wxButton * m_CalcHFOVButton
bool outputLDRExposureLayers
save blended exposure layers, do not perform fusion (no exposure adjustment)
void setHFOV(double h, bool keepView=true)
set the horizontal field of view.
wxButton * m_CalcOptROIButton
Contains various routines used for stitching panoramas.
void addObserver(PanoramaObserver *o)
add a panorama observer.
unsigned int getWidth() const
void HFOVChanged(wxCommandEvent &e)
include file for the hugin project
std::string enblendOptions
const PanoramaOptions & getOptions() const
returns the options for this panorama
Handle EVT_KILL_FOCUS and convert it to a EVT_TEXT_ENTER event.
virtual double getResultHorizontalFOV()
HDRMergeType hdrMergeMode
wxChoice * m_FileFormatTIFFCompChoice
void DoStitch(const wxString &userDefinedSetting=wxEmptyString, const bool readSetting=true)
stitching using hugin_stitch_project
bool outputLDRExposureRemapped
save remapped layers (no exposure adjustment)
wxButton * m_StitchButton
wxStaticText * m_HDRFileFormatLabelTIFFCompression
bool isDirty() const
true if there are unsaved changes
void DoCalcOptimalROI(wxCommandEvent &e)
set the largest rectangle for crop ROI
bool outputLDRExposureLayersFused
save blended exposure layers which are then fused (no exposure adjustment)
void DoCalcOptimalWidth(wxCommandEvent &e)
set the highest sensible width
void HDRFileFormatChanged(wxCommandEvent &e)
std::string outputImageType
void DoSendToBatch(const wxString &userDefinedSetting=wxEmptyString)
stitching with PTBatcherGUI
#define HUGIN_ASS_PANO_DOWNSIZE_FACTOR
std::string outputImageTypeHDR
functions for interaction with the hugin configuration file
wxChoice * m_FileFormatChoice
bool WritePTOFile(const std::string &filename, const std::string &prefix="")
write data to given pto file
void DoStitchOrSendBatch(const wxString &userDefinedSetting=wxEmptyString)
general stitching command, selects PTBatcherGUI or hugin_stitch_project depending on the settings in ...
#define HUGIN_PROCESSOR_GUI
bool CheckGoodSize()
Check the canvas size isn't overly huge, or the user knows what they are doing.
Define the pano edit panel.
std::string hdrmergeOptions
void OnHDRMergeOptions(wxCommandEvent &e)
virtual bool CanHandle(wxXmlNode *node)
#define HUGIN_PROCESSOR_VERBOSE
void setOptions(const PanoramaOptions &opt)
set new output settings This is not used directly for optimizing/stiching, but it can be feed into ru...
ProjectionFormat
Projection of final panorama.
void HDRMergeChanged(wxCommandEvent &e)
Interpolator
enum with all interpolation methods
str wxQuoteFilename(const str &arg)
Quote a filename, so that it is surrounded by "".
wxString getDefaultOutputName(const wxString projectname, const HuginBase::Panorama &pano, const wxString filenameTemplate)
gets the default output prefix, based on filename and images in project the setting is read from the ...
wxString getProjectName()
void setProjection(ProjectionFormat f)
set the Projection format and adjust the hfov/vfov if nessecary
bool outputHDRStacks
save image stacks (HDR)
wxChoice * m_HDRFileFormatChoice
int HuginMessageBox(const wxString &message, const wxString &caption, int style, wxWindow *parent)
virtual bool hasRunSuccessfully()
BlendingMechanism blendMode
void OnOutputFilesChanged(wxCommandEvent &e)
HuginBase::PanoramaOptions m_oldOpt
void setWidth(unsigned int w, bool keepView=true)
set panorama width keep the HFOV, if keepView=true
void OnDoStitch(wxCommandEvent &e)
bool StackCheck(HuginBase::Panorama &pano)
wxTextCtrl * m_ROIRightTxt