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);
531 XRCCTRL(*
this,
"pano_output_ldr_format_label", wxStaticText)->Enable(ldr_pano_enabled);
572 wxLogError(wxT(
"INTERNAL error: unknown output image type"));
578 XRCCTRL(*
this,
"pano_output_hdr_format_label", wxStaticText)->Enable(hdr_pano_enabled);
579 XRCCTRL(*
this,
"pano_output_hdr_format_label", wxStaticText)->Show(hdr_pano_enabled ||
m_guiLevel>
GUI_SIMPLE);
606 wxLogError(wxT(
"INTERNAL error: unknown hdr output image type"));
615 this->Refresh(
false);
643 DEBUG_INFO (
"HFOV = " << text.mb_str(wxConvLocal) );
644 if (text == wxT(
"")) {
650 wxLogError(_(
"Value must be numeric."));
655 wxLogError(wxString::Format(
656 _(
"Invalid HFOV value. Maximum HFOV for this projection is %lf."),
674 DEBUG_INFO (
"VFOV = " << text.mb_str(wxConvLocal) );
675 if (text == wxT(
"")) {
681 wxLogError(_(
"Value must be numeric."));
686 wxLogError(wxString::Format(
687 _(
"Invalid VFOV value. Maximum VFOV for this projection is %lf."),
726 if (nWidth <= 0)
return;
733 wxLogError(_(
"width needs to be an integer bigger than 0"));
743 if(nHeight <= 0)
return;
750 wxLogError(_(
"height needs to be an integer bigger than 0"));
758 long left, right, top, bottom;
760 wxLogError(_(
"Top needs to be an integer bigger than 0"));
764 wxLogError(_(
"left needs to be an integer bigger than 0"));
768 wxLogError(_(
"right needs to be an integer bigger than 0"));
772 wxLogError(_(
"bottom needs to be an integer bigger than 0"));
775 opt.
setROI(vigra::Rect2D(left, top, right, bottom));
778 if(opt.
getROI().width()<1) {
779 wxLogError(_(
"Left boundary must be smaller than right."));
784 if(opt.
getROI().height()<1) {
785 wxLogError(_(
"Top boundary must be smaller than bottom."));
830 wxXmlResource::Get()->LoadDialog(&dlg,
this, wxT(
"nona_options_dialog"));
831 wxChoice * interpol_choice = XRCCTRL(dlg,
"nona_choice_interpolator", wxChoice);
832 wxCheckBox * cropped_cb = XRCCTRL(dlg,
"nona_save_cropped", wxCheckBox);
835 dlg.CentreOnParent();
837 if (dlg.ShowModal() == wxID_OK) {
838 int interpol = interpol_choice->GetSelection();
848 wxLogError(_(
"PTmender options not yet implemented"));
867 wxXmlResource::Get()->LoadDialog(&dlg,
this, wxT(
"enblend_options_dialog"));
868 wxTextCtrl * enblend_opts_text = XRCCTRL(dlg,
"blender_arguments_text", wxTextCtrl);
869 enblend_opts_text->ChangeValue(wxString(opt.
enblendOptions.c_str(), wxConvLocal));
870 dlg.Bind(wxEVT_COMMAND_BUTTON_CLICKED, [](wxCommandEvent &) {
MainFrame::Get()->
DisplayHelp(wxT(
"Enblend.html")); }, wxID_HELP);
871 dlg.CentreOnParent();
873 if (dlg.ShowModal() == wxID_OK) {
874 opt.
enblendOptions = enblend_opts_text->GetValue().mb_str(wxConvLocal);
885 wxXmlResource::Get()->LoadDialog(&dlg,
this, wxT(
"verdandi_options_dialog"));
886 wxChoice * verdandiBlendModeChoice = XRCCTRL(dlg,
"verdandi_blend_mode_choice", wxChoice);
889 verdandiBlendModeChoice->SetSelection(1);
893 verdandiBlendModeChoice->SetSelection(0);
895 dlg.CentreOnParent();
897 if (dlg.ShowModal() == wxID_OK)
899 if (verdandiBlendModeChoice->GetSelection() == 1)
912 wxLogError(_(
"PTblender options not yet implemented"));
936 wxXmlResource::Get()->LoadDialog(&dlg,
this, wxT(
"filledge_options_dialog"));
937 wxCheckBox* keepUnfillVersion = XRCCTRL(dlg,
"edgefill_save_input", wxCheckBox);
939 dlg.CentreOnParent();
941 if (dlg.ShowModal() == wxID_OK)
951 DEBUG_DEBUG(
"changing stacking program to " << fusion);
958 wxXmlResource::Get()->LoadDialog(&dlg,
this, wxT(
"enfuse_options_dialog"));
959 wxTextCtrl * enfuse_opts_text = XRCCTRL(dlg,
"enfuse_arguments_text", wxTextCtrl);
960 enfuse_opts_text->ChangeValue(wxString(opt.
enfuseOptions.c_str(), wxConvLocal));
961 dlg.Bind(wxEVT_COMMAND_BUTTON_CLICKED, [](wxCommandEvent &) {
MainFrame::Get()->
DisplayHelp(wxT(
"Enfuse.html")); }, wxID_HELP);
962 dlg.CentreOnParent();
964 if (dlg.ShowModal() == wxID_OK) {
965 opt.
enfuseOptions = enfuse_opts_text->GetValue().mb_str(wxConvLocal);
985 if (dlg.ShowModal() == wxOK)
993 wxLogError(_(
"Options for this HDRMerge program not yet implemented"));
1026 double sizeFactor = 1.0;
1027 if (wxGetKeyState(WXK_COMMAND))
1052 vigra::Rect2D newROI;
1064 if(!newROI.isEmpty())
1092 wxString tempDir= wxConfigBase::Get()->Read(wxT(
"tempDir"),wxT(
""));
1093 if(!tempDir.IsEmpty())
1094 if(tempDir.Last()!=wxFileName::GetPathSeparator())
1095 tempDir.Append(wxFileName::GetPathSeparator());
1096 wxString currentPTOfn = wxFileName::CreateTempFileName(tempDir+wxT(
"huginpto_"));
1097 if(currentPTOfn.empty()) {
1098 wxMessageBox(_(
"Could not create temporary project file"),_(
"Error"),
1099 wxCANCEL | wxICON_ERROR,
this);
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 == wxT(
""))
1114 DEBUG_ERROR(
"hugin_stitch_project could not be found in the bundle.");
1118 #elif defined __WXMAC__
1120 wxFileName hugin_stitch_project_app(wxT(INSTALL_OSX_BUNDLE_DIR), wxEmptyString);
1121 hugin_stitch_project_app.AppendDir(wxT(
"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 = wxT(
"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(), wxT(
""),
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 wxMessageBox(wxString::Format(_(
"You have no permissions to write in folder \"%s\".\nPlease select another folder for the final output."), prefix.GetPath().c_str()),
1161 wxOK | wxICON_INFORMATION);
1162 if (dlg.ShowModal() != wxID_OK)
1166 prefix = dlg.GetPath();
1174 wxString switches(wxT(
" --delete -o "));
1176 switches=wxT(
" --overwrite")+switches;
1177 if (!userDefinedSetting.IsEmpty())
1183 wxConfigBase::Get()->Flush();
1187 wxProcess *my_process =
new wxProcess(
this);
1188 my_process->Redirect();
1191 my_process->Detach();
1192 wxExecute(command,wxEXEC_ASYNC, my_process);
1217 wxString switches(wxT(
" "));
1220 switches += wxT(
"-b ");
1224 switches += wxT(
"-o ");
1228 switches += wxT(
"-v ");
1230 if (!userDefinedSetting.IsEmpty())
1236 bool showDlg=wxConfigBase::Get()->Read(wxT(
"ShowSaveMessage"), 1l)==1;
1242 wxXmlResource::Get()->LoadDialog(&dlg,
this, wxT(
"stitch_message_dlg"));
1246 XRCCTRL(dlg,
"stitch_message_text", wxStaticText)->SetLabel(
1247 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."),
1254 if(XRCCTRL(dlg,
"stitch_dont_show_checkbox", wxCheckBox)->IsChecked())
1256 wxConfigBase::Get()->Write(wxT(
"ShowSaveMessage"), 0l);
1260 wxCommandEvent dummy;
1272 outputPrefix.Normalize(wxPATH_NORM_ABSOLUTE | wxPATH_NORM_DOTS | wxPATH_NORM_TILDE | wxPATH_NORM_SHORTCUT);
1276 wxFileDialog dlg(
this,_(
"Specify output prefix"),
1277 outputPrefix.GetPath(), outputPrefix.GetName(), wxT(
""),
1278 wxFD_SAVE, wxDefaultPosition);
1279 if (dlg.ShowModal() != wxID_OK)
1286 list.Add(dlg.GetPath());
1288 if(dlg.ShowModal()!=wxID_OK)
1291 wxFileName prefix(dlg.GetPath());
1292 while (!prefix.IsDirWritable())
1294 wxMessageBox(wxString::Format(_(
"You have no permissions to write in folder \"%s\".\nPlease select another folder for the final output."), prefix.GetPath().c_str()),
1300 wxOK | wxICON_INFORMATION);
1301 if (dlg.ShowModal() != wxID_OK)
1305 prefix = dlg.GetPath();
1313 #if defined __WXMAC__ && defined MAC_SELF_CONTAINED_BUNDLE
1314 wxString cmd = MacGetPathToMainExecutableFileOfRegisteredBundle(CFSTR(
"net.sourceforge.hugin.PTBatcherGUI"));
1326 wxMessageBox(wxString::Format(_(
"External program %s not found in the bundle, reverting to system path"), wxT(
"open")), _(
"Error"));
1332 const wxFileName exePath(wxStandardPaths::Get().GetExecutablePath());
1356 wxFileName userOutputSequence;
1357 if (settings.IsEmpty())
1360 wxConfigBase* config = wxConfigBase::Get();
1362 wxFileDialog userOutputDlg(
this, _(
"Select user defined output"),
1363 path, wxT(
""), _(
"User defined output|*.executor"),
1364 wxFD_OPEN | wxFD_FILE_MUST_EXIST, wxDefaultPosition);
1365 if (userOutputDlg.ShowModal() != wxID_OK)
1370 config->Write(wxT(
"/userDefinedOutputPath"), userOutputDlg.GetDirectory());
1371 userOutputSequence = userOutputDlg.GetPath();
1376 userOutputSequence = settings;
1377 if (!userOutputSequence.Exists())
1379 wxMessageBox(wxString::Format(wxT(
"User defined output %s not found.\nStopping processing."), userOutputSequence.GetFullPath()), _(
"Warning"), wxOK | wxICON_INFORMATION);
1389 if(wxGetKeyState(WXK_COMMAND))
1486 switch(e.GetSelection()) {
1513 switch(e.GetSelection()) {
1538 if (
id == XRCID(
"pano_cb_ldr_output_blended") ) {
1540 }
else if (
id == XRCID(
"pano_cb_ldr_output_layers") ) {
1542 }
else if (
id == XRCID(
"pano_cb_ldr_output_exposure_layers") ) {
1544 }
else if (
id == XRCID(
"pano_cb_ldr_output_exposure_blended") ) {
1546 }
else if (
id == XRCID(
"pano_cb_ldr_output_exposure_layers_fused") ) {
1548 }
else if (
id == XRCID(
"pano_cb_ldr_output_exposure_remapped") ) {
1550 }
else if (
id == XRCID(
"pano_cb_ldr_output_stacks") ) {
1552 }
else if (
id == XRCID(
"pano_cb_hdr_output_blended") ) {
1554 }
else if (
id == XRCID(
"pano_cb_hdr_output_stacks") ) {
1556 }
else if (
id == XRCID(
"pano_cb_hdr_output_layers") ) {
1568 const vigra::Rect2D cropped_region (opts.getROI());
1570 if (opts.outputImageType ==
"jpg" &&
1571 (opts.outputLDRBlended || opts.outputLDRExposureBlended || opts.outputLDRExposureLayersFused) &&
1572 (cropped_region.width()>65500 || cropped_region.height()>65500)
1576 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()),
1582 wxICON_EXCLAMATION | wxOK);
1586 const unsigned long long area = (
static_cast<unsigned long long>(cropped_region.width()) * cropped_region.height());
1588 if (area > 500000000)
1590 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."),
1591 area / 1000000000.0);
1595 if (cropped_region.width() > 32700 || cropped_region.height() > 32700)
1597 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.");
1600 if (!message.empty())
1604 wxMessageDialog dialog(
this,
1605 _(
"Are you sure you want to stitch such a large panorama?"),
1611 wxICON_EXCLAMATION | wxYES_NO);
1612 dialog.SetExtendedMessage(message);
1613 dialog.SetYesNoLabels(_(
"Stitch anyway"), _(
"Let me fix that"));
1614 switch (dialog.ShowModal())
1624 if (!mainframe->IsShown())
1641 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."),
1647 wxOK | wxICON_INFORMATION);
1649 return !images.empty();
1654 wxLongLong freeSpace;
1655 if (wxGetDiskSpace(folder, NULL, &freeSpace))
1660 wxMessageDialog dialog(
this,
1661 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),
1667 wxICON_EXCLAMATION | wxYES_NO);
1668 dialog.SetYesNoLabels(_(
"Stitch anyway"), _(
"Let me fix that"));
1669 if (dialog.ShowModal() == wxID_NO)
1673 if (!mainframe->IsShown())
1694 : wxXmlResourceHandler()
1703 cp->Create(m_parentAsWindow,
1705 GetPosition(), GetSize(),
1706 GetStyle(wxT(
"style")),
1716 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