28 #include "hugin_config.h"
29 #include <wx/stdpaths.h>
42 #include <pano13/queryfeature.h>
66 : pano(0), m_guiLevel(
GUI_SIMPLE), updatesDisabled(false)
71 bool PanoPanel::Create(wxWindow *parent, wxWindowID
id,
const wxPoint& pos,
const wxSize& size,
72 long style,
const wxString& name)
74 if (! wxPanel::Create(parent,
id, pos, size, style, name)) {
78 wxXmlResource::Get()->LoadPanel(
this, wxT(
"panorama_panel"));
79 wxPanel * panel = XRCCTRL(*
this,
"panorama_panel", wxPanel);
81 wxBoxSizer *topsizer =
new wxBoxSizer( wxVERTICAL );
82 topsizer->Add(panel, 1, wxEXPAND, 0);
94 #ifdef ThisNeverHappens
96 wxLogMessage(_(
"Fisheye"));
97 wxLogMessage(_(
"Stereographic"));
98 wxLogMessage(_(
"Mercator"));
99 wxLogMessage(_(
"Trans Mercator"));
100 wxLogMessage(_(
"Sinusoidal"));
101 wxLogMessage(_(
"Lambert Cylindrical Equal Area"));
102 wxLogMessage(_(
"Lambert Equal Area Azimuthal"));
103 wxLogMessage(_(
"Albers Equal Area Conic"));
104 wxLogMessage(_(
"Miller Cylindrical"));
105 wxLogMessage(_(
"Panini"));
106 wxLogMessage(_(
"Architectural"));
107 wxLogMessage(_(
"Orthographic"));
108 wxLogMessage(_(
"Equisolid"));
109 wxLogMessage(_(
"Equirectangular Panini"));
110 wxLogMessage(_(
"Biplane"));
111 wxLogMessage(_(
"Triplane"));
112 wxLogMessage(_(
"Panini General"));
113 wxLogMessage(_(
"Thoby Projection"));
114 wxLogMessage(_(
"Hammer-Aitoff Equal Area"));
118 int nP = panoProjectionFormatCount();
119 for(
int n=0; n < nP; n++) {
120 pano_projection_features proj;
121 if (panoProjectionFeaturesQuery(n, &proj)) {
122 wxString str2(proj.name, wxConvLocal);
126 m_HFOVText = XRCCTRL(*
this,
"pano_text_hfov" ,wxTextCtrl);
133 m_VFOVText = XRCCTRL(*
this,
"pano_text_vfov" ,wxTextCtrl);
139 m_WidthTxt = XRCCTRL(*
this,
"pano_val_width", wxTextCtrl);
148 m_HeightTxt = XRCCTRL(*
this,
"pano_val_height", wxTextCtrl);
154 m_ROILeftTxt = XRCCTRL(*
this,
"pano_val_roi_left", wxTextCtrl);
160 m_ROIRightTxt = XRCCTRL(*
this,
"pano_val_roi_right", wxTextCtrl);
165 m_ROITopTxt = XRCCTRL(*
this,
"pano_val_roi_top", wxTextCtrl);
171 m_ROIBottomTxt = XRCCTRL(*
this,
"pano_val_roi_bottom", wxTextCtrl);
223 m_pano_ctrls = XRCCTRL(*
this,
"pano_controls_panel", wxScrolledWindow);
260 wxConfigBase::Get()->Write(wxT(
"Stitcher/DefaultRemapper"),
m_RemapperChoice->GetSelection());
261 wxConfigBase::Get()->Flush();
281 #ifdef STACK_CHECK //Disabled for 0.7.0 release
284 const bool hasStacks =
false;
305 DEBUG_DEBUG(hdrStacks.size() <<
": HDR stacks detected");
306 const bool hasStacks = (hdrStacks.size() != activeImages.size());
357 m_HFOVText->ChangeValue(wxString(val.c_str(), wxConvLocal));
359 m_VFOVText->ChangeValue(wxString(val.c_str(), wxConvLocal));
377 wxString label = wxString::Format(wxT(
"%d x %d"), opt.
getROI().width(), opt.
getROI().height());
379 if ( (opt.
getROI().width() / 1000.0) * opt.
getROI().height() / 1000.0 >= 20.0)
381 label.Append(wxString::Format(wxT(
"=%.0f MP"), (opt.
getROI().width() / 1000.0) * opt.
getROI().height() / 1000.0));
385 label.Append(wxString::Format(wxT(
"=%.1f MP"), opt.
getROI().area() / 1000000.0));
387 if (opt.
getROI().width() >0 && opt.
getROI().height() > 0)
392 label.Append(wxString::Format(wxT(
", %d:%d"), opt.
getROI().width() / commonDivisor, opt.
getROI().height() / commonDivisor));
396 float ratio = 1.0f * opt.
getROI().width() / opt.
getROI().height();
399 label.Append(wxString::Format(wxT(
", %.2f:1"), ratio));
403 label.Append(wxString::Format(wxT(
", 1:%.2f"), 1.0f/ratio));
407 XRCCTRL(*
this,
"pano_size_label", wxStaticText)->SetLabel(label);
411 XRCCTRL(*
this,
"pano_cb_ldr_output_blended", wxCheckBox)->SetValue(opt.
outputLDRBlended);
414 XRCCTRL(*
this,
"pano_cb_hdr_output_blended", wxCheckBox)->SetValue(opt.
outputHDRBlended);
419 XRCCTRL(*
this,
"pano_cb_ldr_output_layers", wxCheckBox)->SetValue(opt.
outputLDRLayers);
423 XRCCTRL(*
this,
"pano_cb_hdr_output_layers", wxCheckBox)->SetValue(opt.
outputHDRLayers);
428 XRCCTRL(*
this,
"pano_cb_ldr_output_stacks", wxCheckBox)->SetValue(opt.
outputLDRStacks);
430 XRCCTRL(*
this,
"pano_cb_hdr_output_stacks", wxCheckBox)->SetValue(opt.
outputHDRStacks);
450 bool any_output_possible = hasImages && anyOutputSelected;
453 #ifdef STACK_CHECK //Disabled for 0.7.0 release
455 XRCCTRL(*
this,
"pano_cb_ldr_output_blended",wxCheckBox)->Disable();
456 XRCCTRL(*
this,
"pano_cb_ldr_output_layers",wxCheckBox)->Disable();
458 XRCCTRL(*
this,
"pano_cb_ldr_output_exposure_layers",wxCheckBox)->Enable();
459 XRCCTRL(*
this,
"pano_cb_ldr_output_exposure_blended",wxCheckBox)->Enable();
460 XRCCTRL(*
this,
"pano_cb_ldr_output_exposure_remapped",wxCheckBox)->Enable();
461 XRCCTRL(*
this,
"pano_cb_hdr_output_blended",wxCheckBox)->Enable();
462 XRCCTRL(*
this,
"pano_cb_hdr_output_stacks",wxCheckBox)->Enable();
463 XRCCTRL(*
this,
"pano_cb_hdr_output_layers",wxCheckBox)->Enable();
466 XRCCTRL(*
this,
"pano_cb_ldr_output_blended",wxCheckBox)->Enable();
467 XRCCTRL(*
this,
"pano_cb_ldr_output_layers",wxCheckBox)->Enable();
469 XRCCTRL(*
this,
"pano_cb_ldr_output_exposure_layers",wxCheckBox)->Disable();
470 XRCCTRL(*
this,
"pano_cb_ldr_output_exposure_blended",wxCheckBox)->Disable();
471 XRCCTRL(*
this,
"pano_cb_ldr_output_exposure_remapped",wxCheckBox)->Disable();
473 XRCCTRL(*
this,
"pano_cb_hdr_output_blended",wxCheckBox)->Disable();
474 XRCCTRL(*
this,
"pano_cb_hdr_output_stacks",wxCheckBox)->Disable();
475 XRCCTRL(*
this,
"pano_cb_hdr_output_layers",wxCheckBox)->Disable();
496 XRCCTRL(*
this,
"pano_button_blender_opts", wxButton)->Enable(blenderEnabled);
498 XRCCTRL(*
this,
"pano_text_blender", wxStaticText)->Enable(blenderEnabled);
501 XRCCTRL(*
this,
"pano_button_fill_opts", wxButton)->Enable(
m_edgeFillChoice->GetSelection() != 0);
506 XRCCTRL(*
this,
"pano_button_fusion_opts", wxButton)->Enable(fusionEnabled);
508 XRCCTRL(*
this,
"pano_text_fusion", wxStaticText)->Enable(fusionEnabled);
514 XRCCTRL(*
this,
"pano_button_hdrmerge_opts", wxButton)->Enable(hdrMergeEnabled);
516 XRCCTRL(*
this,
"pano_text_hdrmerge", wxStaticText)->Enable(hdrMergeEnabled);
524 XRCCTRL(*
this,
"pano_output_ldr_format_label", wxStaticText)->Enable(ldr_pano_enabled);
565 wxLogError(wxT(
"INTERNAL error: unknown output image type"));
571 XRCCTRL(*
this,
"pano_output_hdr_format_label", wxStaticText)->Enable(hdr_pano_enabled);
572 XRCCTRL(*
this,
"pano_output_hdr_format_label", wxStaticText)->Show(hdr_pano_enabled ||
m_guiLevel>
GUI_SIMPLE);
599 wxLogError(wxT(
"INTERNAL error: unknown hdr output image type"));
608 this->Refresh(
false);
636 DEBUG_INFO (
"HFOV = " << text.mb_str(wxConvLocal) );
637 if (text == wxT(
"")) {
643 wxLogError(_(
"Value must be numeric."));
648 wxLogError(wxString::Format(
649 _(
"Invalid HFOV value. Maximum HFOV for this projection is %lf."),
667 DEBUG_INFO (
"VFOV = " << text.mb_str(wxConvLocal) );
668 if (text == wxT(
"")) {
674 wxLogError(_(
"Value must be numeric."));
679 wxLogError(wxString::Format(
680 _(
"Invalid VFOV value. Maximum VFOV for this projection is %lf."),
719 if (nWidth <= 0)
return;
726 wxLogError(_(
"width needs to be an integer bigger than 0"));
736 if(nHeight <= 0)
return;
743 wxLogError(_(
"height needs to be an integer bigger than 0"));
751 long left, right, top, bottom;
753 wxLogError(_(
"Top needs to be an integer bigger than 0"));
757 wxLogError(_(
"left needs to be an integer bigger than 0"));
761 wxLogError(_(
"right needs to be an integer bigger than 0"));
765 wxLogError(_(
"bottom needs to be an integer bigger than 0"));
768 opt.
setROI(vigra::Rect2D(left, top, right, bottom));
771 if(opt.
getROI().width()<1) {
772 wxLogError(_(
"Left boundary must be smaller than right."));
777 if(opt.
getROI().height()<1) {
778 wxLogError(_(
"Top boundary must be smaller than bottom."));
823 wxXmlResource::Get()->LoadDialog(&dlg,
this, wxT(
"nona_options_dialog"));
824 wxChoice * interpol_choice = XRCCTRL(dlg,
"nona_choice_interpolator", wxChoice);
825 wxCheckBox * cropped_cb = XRCCTRL(dlg,
"nona_save_cropped", wxCheckBox);
828 dlg.CentreOnParent();
830 if (dlg.ShowModal() == wxID_OK) {
831 int interpol = interpol_choice->GetSelection();
841 wxLogError(_(
"PTmender options not yet implemented"));
860 wxXmlResource::Get()->LoadDialog(&dlg,
this, wxT(
"enblend_options_dialog"));
861 wxTextCtrl * enblend_opts_text = XRCCTRL(dlg,
"blender_arguments_text", wxTextCtrl);
862 enblend_opts_text->ChangeValue(wxString(opt.
enblendOptions.c_str(), wxConvLocal));
863 dlg.Bind(wxEVT_COMMAND_BUTTON_CLICKED, [](wxCommandEvent &) {
MainFrame::Get()->
DisplayHelp(wxT(
"Enblend.html")); }, wxID_HELP);
864 dlg.CentreOnParent();
866 if (dlg.ShowModal() == wxID_OK) {
867 opt.
enblendOptions = enblend_opts_text->GetValue().mb_str(wxConvLocal);
878 wxXmlResource::Get()->LoadDialog(&dlg,
this, wxT(
"verdandi_options_dialog"));
879 wxChoice * verdandiBlendModeChoice = XRCCTRL(dlg,
"verdandi_blend_mode_choice", wxChoice);
882 verdandiBlendModeChoice->SetSelection(1);
886 verdandiBlendModeChoice->SetSelection(0);
888 dlg.CentreOnParent();
890 if (dlg.ShowModal() == wxID_OK)
892 if (verdandiBlendModeChoice->GetSelection() == 1)
905 wxLogError(_(
"PTblender options not yet implemented"));
929 wxXmlResource::Get()->LoadDialog(&dlg,
this, wxT(
"filledge_options_dialog"));
930 wxCheckBox* keepUnfillVersion = XRCCTRL(dlg,
"edgefill_save_input", wxCheckBox);
932 dlg.CentreOnParent();
934 if (dlg.ShowModal() == wxID_OK)
944 DEBUG_DEBUG(
"changing stacking program to " << fusion);
951 wxXmlResource::Get()->LoadDialog(&dlg,
this, wxT(
"enfuse_options_dialog"));
952 wxTextCtrl * enfuse_opts_text = XRCCTRL(dlg,
"enfuse_arguments_text", wxTextCtrl);
953 enfuse_opts_text->ChangeValue(wxString(opt.
enfuseOptions.c_str(), wxConvLocal));
954 dlg.Bind(wxEVT_COMMAND_BUTTON_CLICKED, [](wxCommandEvent &) {
MainFrame::Get()->
DisplayHelp(wxT(
"Enfuse.html")); }, wxID_HELP);
955 dlg.CentreOnParent();
957 if (dlg.ShowModal() == wxID_OK) {
958 opt.
enfuseOptions = enfuse_opts_text->GetValue().mb_str(wxConvLocal);
978 if (dlg.ShowModal() == wxOK)
986 wxLogError(_(
"Options for this HDRMerge program not yet implemented"));
1019 double sizeFactor = 1.0;
1020 if (wxGetKeyState(WXK_COMMAND))
1045 vigra::Rect2D newROI;
1057 if(!newROI.isEmpty())
1085 wxString tempDir= wxConfigBase::Get()->Read(wxT(
"tempDir"),wxT(
""));
1086 if(!tempDir.IsEmpty())
1087 if(tempDir.Last()!=wxFileName::GetPathSeparator())
1088 tempDir.Append(wxFileName::GetPathSeparator());
1089 wxString currentPTOfn = wxFileName::CreateTempFileName(tempDir+wxT(
"huginpto_"));
1090 if(currentPTOfn.empty()) {
1091 wxMessageBox(_(
"Could not create temporary project file"),_(
"Error"),
1092 wxCANCEL | wxICON_ERROR,
this);
1095 DEBUG_DEBUG(
"tmp PTO file: " << (
const char *)currentPTOfn.mb_str(wxConvLocal));
1102 #if defined __WXMAC__ && defined MAC_SELF_CONTAINED_BUNDLE
1104 wxString hugin_stitch_project = MacGetPathToBundledAppMainExecutableFile(CFSTR(
"HuginStitchProject.app"));
1105 if(hugin_stitch_project == wxT(
""))
1107 DEBUG_ERROR(
"hugin_stitch_project could not be found in the bundle.");
1111 #elif defined __WXMAC__
1113 wxFileName hugin_stitch_project_app(wxT(INSTALL_OSX_BUNDLE_DIR), wxEmptyString);
1114 hugin_stitch_project_app.AppendDir(wxT(
"HuginStitchProject.app"));
1115 CFStringRef stitchProjectAppPath = MacCreateCFStringWithWxString(hugin_stitch_project_app.GetFullPath());
1116 wxString hugin_stitch_project = MacGetPathToMainExecutableFileOfBundle(stitchProjectAppPath);
1117 CFRelease(stitchProjectAppPath);
1119 wxString hugin_stitch_project = wxT(
"hugin_stitch_project");
1124 outputPrefix.Normalize(wxPATH_NORM_ABSOLUTE | wxPATH_NORM_DOTS | wxPATH_NORM_TILDE | wxPATH_NORM_SHORTCUT);
1130 wxFileDialog dlg(
this,_(
"Specify output prefix"),
1131 outputPrefix.GetPath(), outputPrefix.GetName(), wxT(
""),
1132 wxFD_SAVE, wxDefaultPosition);
1133 if (dlg.ShowModal() != wxID_OK)
1140 list.Add(dlg.GetPath());
1142 if(dlg.ShowModal()!=wxID_OK)
1145 wxFileName prefix(dlg.GetPath());
1146 while (!prefix.IsDirWritable())
1148 wxMessageBox(wxString::Format(_(
"You have no permissions to write in folder \"%s\".\nPlease select another folder for the final output."), prefix.GetPath().c_str()),
1154 wxOK | wxICON_INFORMATION);
1155 if (dlg.ShowModal() != wxID_OK)
1159 prefix = dlg.GetPath();
1167 wxString switches(wxT(
" --delete -o "));
1169 switches=wxT(
" --overwrite")+switches;
1170 if (!userDefinedSetting.IsEmpty())
1176 wxConfigBase::Get()->Flush();
1180 wxProcess *my_process =
new wxProcess(
this);
1181 my_process->Redirect();
1184 my_process->Detach();
1185 wxExecute(command,wxEXEC_ASYNC, my_process);
1210 wxString switches(wxT(
" "));
1213 switches += wxT(
"-b ");
1217 switches += wxT(
"-o ");
1221 switches += wxT(
"-v ");
1223 if (!userDefinedSetting.IsEmpty())
1229 bool showDlg=wxConfigBase::Get()->Read(wxT(
"ShowSaveMessage"), 1l)==1;
1235 wxXmlResource::Get()->LoadDialog(&dlg,
this, wxT(
"stitch_message_dlg"));
1239 XRCCTRL(dlg,
"stitch_message_text", wxStaticText)->SetLabel(
1240 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."),
1247 if(XRCCTRL(dlg,
"stitch_dont_show_checkbox", wxCheckBox)->IsChecked())
1249 wxConfigBase::Get()->Write(wxT(
"ShowSaveMessage"), 0l);
1253 wxCommandEvent dummy;
1265 outputPrefix.Normalize(wxPATH_NORM_ABSOLUTE | wxPATH_NORM_DOTS | wxPATH_NORM_TILDE | wxPATH_NORM_SHORTCUT);
1269 wxFileDialog dlg(
this,_(
"Specify output prefix"),
1270 outputPrefix.GetPath(), outputPrefix.GetName(), wxT(
""),
1271 wxFD_SAVE, wxDefaultPosition);
1272 if (dlg.ShowModal() != wxID_OK)
1279 list.Add(dlg.GetPath());
1281 if(dlg.ShowModal()!=wxID_OK)
1284 wxFileName prefix(dlg.GetPath());
1285 while (!prefix.IsDirWritable())
1287 wxMessageBox(wxString::Format(_(
"You have no permissions to write in folder \"%s\".\nPlease select another folder for the final output."), prefix.GetPath().c_str()),
1293 wxOK | wxICON_INFORMATION);
1294 if (dlg.ShowModal() != wxID_OK)
1298 prefix = dlg.GetPath();
1306 #if defined __WXMAC__ && defined MAC_SELF_CONTAINED_BUNDLE
1307 wxString cmd = MacGetPathToMainExecutableFileOfRegisteredBundle(CFSTR(
"net.sourceforge.hugin.PTBatcherGUI"));
1319 wxMessageBox(wxString::Format(_(
"External program %s not found in the bundle, reverting to system path"), wxT(
"open")), _(
"Error"));
1325 const wxFileName exePath(wxStandardPaths::Get().GetExecutablePath());
1349 wxFileName userOutputSequence;
1350 if (settings.IsEmpty())
1353 wxConfigBase* config = wxConfigBase::Get();
1355 wxFileDialog userOutputDlg(
this, _(
"Select user defined output"),
1356 path, wxT(
""), _(
"User defined output|*.executor"),
1357 wxFD_OPEN | wxFD_FILE_MUST_EXIST, wxDefaultPosition);
1358 if (userOutputDlg.ShowModal() != wxID_OK)
1363 config->Write(wxT(
"/userDefinedOutputPath"), userOutputDlg.GetDirectory());
1364 userOutputSequence = userOutputDlg.GetPath();
1369 userOutputSequence = settings;
1370 if (!userOutputSequence.Exists())
1372 wxMessageBox(wxString::Format(wxT(
"User defined output %s not found.\nStopping processing."), userOutputSequence.GetFullPath()), _(
"Warning"), wxOK | wxICON_INFORMATION);
1382 if(wxGetKeyState(WXK_COMMAND))
1479 switch(e.GetSelection()) {
1506 switch(e.GetSelection()) {
1531 if (
id == XRCID(
"pano_cb_ldr_output_blended") ) {
1533 }
else if (
id == XRCID(
"pano_cb_ldr_output_layers") ) {
1535 }
else if (
id == XRCID(
"pano_cb_ldr_output_exposure_layers") ) {
1537 }
else if (
id == XRCID(
"pano_cb_ldr_output_exposure_blended") ) {
1539 }
else if (
id == XRCID(
"pano_cb_ldr_output_exposure_layers_fused") ) {
1541 }
else if (
id == XRCID(
"pano_cb_ldr_output_exposure_remapped") ) {
1543 }
else if (
id == XRCID(
"pano_cb_ldr_output_stacks") ) {
1545 }
else if (
id == XRCID(
"pano_cb_hdr_output_blended") ) {
1547 }
else if (
id == XRCID(
"pano_cb_hdr_output_stacks") ) {
1549 }
else if (
id == XRCID(
"pano_cb_hdr_output_layers") ) {
1561 const vigra::Rect2D cropped_region (opts.getROI());
1563 if (opts.outputImageType ==
"jpg" &&
1564 (opts.outputLDRBlended || opts.outputLDRExposureBlended || opts.outputLDRExposureLayersFused) &&
1565 (cropped_region.width()>65500 || cropped_region.height()>65500)
1569 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()),
1575 wxICON_EXCLAMATION | wxOK);
1579 const unsigned long long area = (
static_cast<unsigned long long>(cropped_region.width()) * cropped_region.height());
1581 if (area > 500000000)
1583 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."),
1584 area / 1000000000.0);
1588 if (cropped_region.width() > 32700 || cropped_region.height() > 32700)
1590 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.");
1593 if (!message.empty())
1597 wxMessageDialog dialog(
this,
1598 _(
"Are you sure you want to stitch such a large panorama?"),
1604 wxICON_EXCLAMATION | wxYES_NO);
1605 dialog.SetExtendedMessage(message);
1606 dialog.SetYesNoLabels(_(
"Stitch anyway"), _(
"Let me fix that"));
1607 switch (dialog.ShowModal())
1617 if (!mainframe->IsShown())
1634 wxMessageBox(_(
"There are no active images in the output region.\nPlease check your settings, so that at least one image is in the output region."),
1640 wxOK | wxICON_INFORMATION);
1642 return !images.empty();
1647 wxLongLong freeSpace;
1648 if (wxGetDiskSpace(folder, NULL, &freeSpace))
1653 wxMessageDialog dialog(
this,
1654 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),
1660 wxICON_EXCLAMATION | wxYES_NO);
1661 dialog.SetYesNoLabels(_(
"Stitch anyway"), _(
"Let me fix that"));
1662 if (dialog.ShowModal() == wxID_NO)
1666 if (!mainframe->IsShown())
1687 : wxXmlResourceHandler()
1696 cp->Create(m_parentAsWindow,
1698 GetPosition(), GetSize(),
1699 GetStyle(wxT(
"style")),
1709 return IsOfClass(node, wxT(
"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 DoStitch(const wxString &userDefinedSetting=wxEmptyString)
stitching using hugin_stitch_project
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.
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
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.
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
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
virtual bool hasRunSuccessfully()
BlendingMechanism blendMode
bool Create(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL, const wxString &name=wxT("panel"))
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