27#include "hugin_config.h"
29#include "wx/listbook.h"
30#include <wx/stdpaths.h>
49#define MY_STR_VAL(id, val) { XRCCTRL(*this, id, wxTextCtrl)->SetValue(val); };
50#define MY_SPIN_VAL(id, val) { XRCCTRL(*this, id, wxSpinCtrl)->SetValue(val); };
51#define MY_BOOL_VAL(id, val) { XRCCTRL(*this, id, wxCheckBox)->SetValue(val); };
52#define MY_CHOICE_VAL(id, val) { XRCCTRL(*this, id, wxChoice)->SetSelection(val); };
53#define MY_STATIC_VAL(id, val) { XRCCTRL(*this, id, wxStaticText)->SetLabel(val); };
55#define MY_G_STR_VAL(id) XRCCTRL(*this, id, wxTextCtrl)->GetValue()
56#define MY_G_SPIN_VAL(id) XRCCTRL(*this, id, wxSpinCtrl)->GetValue()
57#define MY_G_BOOL_VAL(id) XRCCTRL(*this, id, wxCheckBox)->GetValue()
58#define MY_G_CHOICE_VAL(id) XRCCTRL(*this, id, wxChoice)->GetSelection()
66 wxXmlResource::Get()->LoadDialog(
this,
parent,
"pref_dialog");
164 XRCCTRL(*
this,
"pref_raw_dcraw_exe", wxTextCtrl)->AutoCompleteFileNames();
165 XRCCTRL(*
this,
"pref_raw_rt_exe", wxTextCtrl)->AutoCompleteFileNames();
166 XRCCTRL(*
this,
"pref_raw_darktable_exe", wxTextCtrl)->AutoCompleteFileNames();
176 XRCCTRL(*
this,
"prefs_misc_tempdir", wxTextCtrl)->AutoCompleteDirectories();
177 XRCCTRL(*
this,
"pref_exiftool_argfile", wxTextCtrl)->AutoCompleteFileNames();
178 XRCCTRL(*
this,
"pref_exiftool_argfile2", wxTextCtrl)->AutoCompleteFileNames();
179 XRCCTRL(*
this,
"prefs_enblend_EnblendExe", wxTextCtrl)->AutoCompleteFileNames();
180 XRCCTRL(*
this,
"prefs_enblend_EnfuseExe", wxTextCtrl)->AutoCompleteFileNames();
188#if defined __APPLE__ && defined __aarch64__
194 cfg->Write(
"/Nona/UseGPU",
false);
235#if defined __WXMSW__ || defined MAC_SELF_CONTAINED_BUNDLE
265 delete static_cast<long*
>(
lang_choice->GetClientData(
i));
292 _(
"Executables (*.exe)|*.exe"),
299 XRCCTRL(*
this,
"prefs_enblend_EnblendExe", wxTextCtrl)->SetValue(
309 _(
"Executables (*.exe)|*.exe"),
316 XRCCTRL(*
this,
"prefs_enblend_EnfuseExe", wxTextCtrl)->SetValue(
323 wxTextCtrl*
ctrl =
XRCCTRL(*
this,
"pref_raw_dcraw_exe", wxTextCtrl);
326 _(
"Executables (*.exe)|*.exe"),
339 wxTextCtrl*
ctrl =
XRCCTRL(*
this,
"pref_raw_rt_exe", wxTextCtrl);
342 _(
"Executables (*.exe)|*.exe"),
355 wxTextCtrl*
ctrl =
XRCCTRL(*
this,
"pref_raw_darktable_exe", wxTextCtrl);
358 _(
"Executables (*.exe)|*.exe"),
372 XRCCTRL(*
this,
"prefs_enblend_EnblendExe", wxTextCtrl)->Enable(e.IsChecked());
373 XRCCTRL(*
this,
"prefs_enblend_select",
wxButton)->Enable(e.IsChecked());
378 XRCCTRL(*
this,
"prefs_enblend_EnfuseExe", wxTextCtrl)->Enable(e.IsChecked());
379 XRCCTRL(*
this,
"prefs_enblend_enfuse_select",
wxButton)->Enable(e.IsChecked());
386 _(
"ExifTool Argfiles (*.arg)|*.arg|All Files(*)|*"),
390 XRCCTRL(*
this,
"pref_exiftool_argfile", wxTextCtrl)->SetValue(
415 wxString filename=
XRCCTRL(*
this,
"pref_exiftool_argfile", wxTextCtrl)->GetValue();
416 if(!filename.empty())
422 if (
hugin_utils::HuginMessageBox(wxString::Format(
_(
"Argfile %s does not exist.\nShould the argfile be created with default tags?"), filename),
427 filename = file.GetFullPath();
432 filename = file.GetFullPath();
444 _(
"ExifTool Argfiles (*.arg)|*.arg|All Files(*)|*"),
450 filename=
dlg.GetPath();
453 XRCCTRL(*
this,
"pref_exiftool_argfile", wxTextCtrl)->SetValue(filename);
455 wxXmlResource::Get()->LoadDialog(&
edit_dlg,
this,
"pref_edit_argfile");
474 _(
"ExifTool Argfiles (*.arg)|*.arg|All Files(*)|*"),
478 XRCCTRL(*
this,
"pref_exiftool_argfile2", wxTextCtrl)->SetValue(
485 wxString filename =
XRCCTRL(*
this,
"pref_exiftool_argfile2", wxTextCtrl)->GetValue();
486 if (!filename.empty())
497 filename = file.GetFullPath();
502 filename = file.GetFullPath();
514 _(
"ExifTool Argfiles (*.arg)|*.arg|All Files(*)|*"),
520 filename =
dlg.GetPath();
523 XRCCTRL(*
this,
"pref_exiftool_argfile2", wxTextCtrl)->SetValue(filename);
525 wxXmlResource::Get()->LoadDialog(&
edit_dlg,
this,
"pref_edit_argfile_placeholders");
559 XRCCTRL(*
this,
"prefs_ft_rot_panel", wxPanel)->Enable(
enable);
577 unsigned long mem_high =
cfg->Read(
"/ImageCache/UpperBoundHigh", (
long) 0);
628 t =
cfg->Read(
"CopyLogToClipboard", 0l) == 1;
634 t =
cfg->Read(
"/CPEditorPanel/AutoRot", 1l) == 1;
638 MY_STR_VAL(
"pref_raw_dcraw_exe",
cfg->Read(
"/RawImportDialog/dcrawExe",
""));
639 MY_STR_VAL(
"pref_raw_rt_exe",
cfg->Read(
"/RawImportDialog/RTExe",
""));
640 MY_STR_VAL(
"pref_raw_darktable_exe",
cfg->Read(
"/RawImportDialog/DarktableExe",
""));
651 filename.Replace(
"/",
"\\",
true);
653 MY_STR_VAL(
"prefs_project_filename", filename);
656 filename.Replace(
"/",
"\\",
true);
658 MY_STR_VAL(
"prefs_output_filename", filename);
666 t =
cfg->Read(
"/General/IgnoreFovRectilinearOnAdd", 1l) == 1l;
671 cfg->Read(
"/Assistant/panoDownsizeFactor", &factor);
672 MY_SPIN_VAL(
"prefs_ass_panoDownsizeFactor",(
int)(factor*100.0));
679 t =
cfg->Read(
"/Assistant/UserDefinedOutputOption", 0l) == 1;
681 wxCommandEvent
dummy;
692 int val = wxConfigBase::Get()->Read(
"/CPEditorPanel/MagnifierWidth", 61l);
694 val = std::min(val, 3);
695 XRCCTRL(*
this,
"prefs_misc_magnifier_width",
wxChoice)->SetSelection(val);
700 MY_SPIN_VAL(
"prefs_ft_SearchAreaPercent",
cfg->Read(
"/Finetune/SearchAreaPercent",
702 MY_SPIN_VAL(
"prefs_ft_LocalSearchWidth",
cfg->Read(
"/Finetune/LocalSearchWidth",
726 MY_SPIN_VAL(
"prefs_ft_RotationSteps",
cfg->Read(
"/Finetune/RotationSteps",
758 XRCCTRL(*
this,
"pref_internal_blender_seam",
wxChoice)->SetSelection(1);
762 XRCCTRL(*
this,
"pref_internal_blender_seam",
wxChoice)->SetSelection(0);
787 wxCommandEvent
dummy;
790 int nThreads =
cfg->Read(
"/output/NumberOfThreads", 0l);
807 MY_STR_VAL(
"prefs_enblend_EnblendExe",
cfg->Read(
"/Enblend/Exe",
814 MY_STR_VAL(
"prefs_enblend_EnblendArgs",
cfg->Read(
"/Enblend/Args",
818 MY_STR_VAL(
"prefs_enblend_EnfuseExe",
cfg->Read(
"/Enfuse/Exe",
825 MY_STR_VAL(
"prefs_enblend_EnfuseArgs",
cfg->Read(
"/Enfuse/Args",
840 t =
cfg->Read(
"/ShowSaveMessage", 1l) == 1;
842 t =
cfg->Read(
"/ShowExposureWarning", 1l) == 1;
844 t =
cfg->Read(
"/ShowFisheyeCropHint", 1l) == 1;
858 if (
noteb->GetSelection() == 0)
875 cfg->Write(
"CopyLogToClipboard", 0l);
878 cfg->Write(
"/CPEditorPanel/AutoRot", 1l);
880 cfg->Write(
"/RawImportDialog/dcrawExe",
"");
881 cfg->Write(
"/RawImportDialog/RTExe",
"");
882 cfg->Write(
"/RawImportDialog/DarktableExe",
"");
884 if(
noteb->GetSelection() == 1)
890 if (
noteb->GetSelection() == 2)
893 cfg->Write(
"/General/IgnoreFovRectilinearOnAdd", 1l);
899 cfg->Write(
"/Assistant/UserDefinedOutputOption", 0l);
901 if (
noteb->GetSelection() == 3)
906 cfg->Write(
"/CPEditorPanel/MagnifierWidth", 61l);
920 if (
noteb->GetSelection() == 4)
927 if (
noteb->GetSelection() == 5)
944 if (
noteb->GetSelection() == 6)
950 cfg->Write(
"/output/NumberOfThreads", 0l);
952 if (
noteb->GetSelection() == 7)
964 if (
noteb->GetSelection() == 8)
970 cfg->Write(
"/ShowSaveMessage", 1l);
971 cfg->Write(
"/ShowExposureWarning", 1l);
972 cfg->Write(
"/ShowFisheyeCropHint", 1l);
973 cfg->Write(
"/EditCPAfterAction", 0l);
993 cfg->Write(
"/General/IgnoreFovRectilinearOnAdd", !
MY_G_BOOL_VAL(
"prefs_ass_loadFovRectilinear"));
994 cfg->Write(
"/Assistant/nControlPoints",
MY_G_SPIN_VAL(
"prefs_ass_nControlPoints"));
995 cfg->Write(
"/Assistant/panoDownsizeFactor",
MY_G_SPIN_VAL(
"prefs_ass_panoDownsizeFactor") / 100.0);
999 cfg->Write(
"/Assistant/UserDefinedOutputOption",
MY_G_BOOL_VAL(
"pref_ass_output"));
1004 cfg->Write(
"/CPEditorPanel/MagnifierWidth",
MY_G_CHOICE_VAL(
"prefs_misc_magnifier_width") * 20 + 61l);
1007 cfg->Write(
"/Finetune/SearchAreaPercent",
MY_G_SPIN_VAL(
"prefs_ft_SearchAreaPercent"));
1008 cfg->Write(
"/Finetune/TemplateSize",
MY_G_SPIN_VAL(
"prefs_ft_TemplateSize"));
1009 cfg->Write(
"/Finetune/LocalSearchWidth",
MY_G_SPIN_VAL(
"prefs_ft_LocalSearchWidth"));
1013 cfg->Write(
"/Finetune/CorrThreshold",
td);
1018 cfg->Write(
"/Finetune/CurvThreshold",
td);
1020 cfg->Write(
"/Finetune/RotationSearch",
MY_G_BOOL_VAL(
"prefs_ft_RotationSearch"));
1021 cfg->Write(
"/Finetune/RotationStartAngle", (
double)
MY_G_SPIN_VAL(
"prefs_ft_RotationStartAngle"));
1022 cfg->Write(
"/Finetune/RotationStopAngle", (
double)
MY_G_SPIN_VAL(
"prefs_ft_RotationStopAngle"));
1023 cfg->Write(
"/Finetune/RotationSteps",
MY_G_SPIN_VAL(
"prefs_ft_RotationSteps"));
1030 cfg->Write(
"/ImageCache/UpperBoundHigh", (
long)
MY_G_SPIN_VAL(
"prefs_cache_UpperBound") >> 12);
1032 cfg->Write(
"/ImageCache/UpperBound", (
long)
MY_G_SPIN_VAL(
"prefs_cache_UpperBound") << 20);
1048 cfg->Write(
"/GLPreviewFrame/ShowProjectionHints",
MY_G_BOOL_VAL(
"pref_show_projection_hints"));
1052 cfg->Write(
"/RawImportDialog/dcrawExe",
MY_G_STR_VAL(
"pref_raw_dcraw_exe"));
1053 cfg->Write(
"/RawImportDialog/RTExe",
MY_G_STR_VAL(
"pref_raw_rt_exe"));
1054 cfg->Write(
"/RawImportDialog/DarktableExe",
MY_G_STR_VAL(
"pref_raw_darktable_exe"));;
1058 wxString filename=
XRCCTRL(*
this,
"prefs_project_filename", wxTextCtrl)->GetValue();
1060 filename.Replace(
"\\",
"/",
true);
1062 cfg->Write(
"ProjectFilename", filename);
1063 filename=
XRCCTRL(*
this,
"prefs_output_filename", wxTextCtrl)->GetValue();
1065 filename.Replace(
"\\",
"/",
true);
1067 cfg->Write(
"OutputFilename", filename);
1081 if (
XRCCTRL(*
this,
"pref_internal_blender_seam",
wxChoice)->GetSelection() == 1)
1083 cfg->Write(
"/VerdandiDefaultArgs",
"--seam=blend");
1094 cfg->Write(
"/Processor/overwrite",
MY_G_BOOL_VAL(
"pref_processor_overwrite"));
1097 cfg->Write(
"/output/useExiftool",
MY_G_BOOL_VAL(
"pref_exiftool_metadata"));
1098 cfg->Write(
"/output/CopyArgfile",
MY_G_STR_VAL(
"pref_exiftool_argfile"));
1099 cfg->Write(
"/output/FinalArgfile",
MY_G_STR_VAL(
"pref_exiftool_argfile2"));
1101 cfg->Write(
"/output/NumberOfThreads",
MY_G_SPIN_VAL(
"prefs_output_NumberOfThreads"));
1105 cfg->Write(
"/Nona/CroppedImages",
MY_G_BOOL_VAL(
"prefs_nona_createCroppedImages"));
1112 cfg->Write(
"/Enblend/Args",
MY_G_STR_VAL(
"prefs_enblend_EnblendArgs"));
1122 cfg->Write(
"/Celeste/Threshold",
td);
1125 cfg->Write(
"/OptimizePhotometric/nRandomPointsPerImage",
MY_G_SPIN_VAL(
"prefs_photo_optimizer_nr_points"));
1127 cfg->Write(
"/ShowExposureWarning",
MY_G_BOOL_VAL(
"prefs_warning_exposure"));
1128 cfg->Write(
"/ShowFisheyeCropHint",
MY_G_BOOL_VAL(
"prefs_warning_fisheye_crop"));
1234 wxConfig::Get()->Write(
"/actualPath",
dlg.GetDirectory());
1249 wxConfig::Get()->Write(
"/actualPath",
dlg.GetDirectory());
1254 if(
fn.Right(8)!=
".setting")
1256 fn.Append(
".setting");
1275 XRCCTRL(*
this,
"pref_tiff_compression",
wxChoice)->GetParent()->Layout();
declaration of CPDetectorDialog class, which are for storing and changing settings of different autop...
wxString GetDataPath()
return path to data directory, it depends on operating system
Definition of dialog for editing user-defined output ini file.
#define MY_CHOICE_VAL(id, val)
#define MY_G_CHOICE_VAL(id)
#define MY_G_SPIN_VAL(id)
#define MY_STR_VAL(id, val)
#define MY_BOOL_VAL(id, val)
#define MY_G_BOOL_VAL(id)
#define MY_SPIN_VAL(id, val)
void CreateNewArgFile(const wxString &newFilename, const wxString &sourceFile)
unsigned int GetCount()
return counts of cp detector settings
void FillControl(wxControlWithItems *control, bool select_default=false, bool show_default=false)
fills a wxControlWithItems with the available generators
unsigned int GetDefaultGenerator()
return index of default generator (this one is used for assistent)
void Read(wxConfigBase *config=wxConfigBase::Get(), wxString loadFromFile=wxEmptyString)
read the settings of different cp generators from config
void ReadFromFile(wxString filename)
import the cp detector settings from external file
void Write(wxConfigBase *config=wxConfigBase::Get())
writes the settings of different cp generators to config
ArraySettings settings
array which stores the different autopano settings
void SetDefaultGenerator(unsigned int new_default_generator)
sets new default generator, which is used by assistent
void WriteToFile(wxString filename)
exporth the cp detector settings to external file
void Swap(int index)
swaps setting which index and index+1
dialog for input settings of one autopano generator
class, which stores all settings of one cp detector
Dialog for editing user defined output settings (ini file)
static MainFrame * Get()
hack.. kind of a pseudo singleton...
void DisplayHelp(wxString section=wxEmptyString)
call help browser with given file
void OnExifArgfile2Edit(wxCommandEvent &e)
void UpdateFileFormatControls()
void OnUpdateOutputFilename(wxCommandEvent &e)
event handler to update preview for project filename
virtual ~PreferencesDialog()
dtor.
void OnExifTool(wxCommandEvent &e)
void OnBlenderChanged(wxCommandEvent &e)
event handler if blender was changed
void OnExifArgfileEdit(wxCommandEvent &e)
void OnHelp(wxCommandEvent &e)
void OnRotationCheckBox(wxCommandEvent &e)
void OnDcrawExe(wxCommandEvent &e)
void OnEnfuseExe(wxCommandEvent &e)
void OnChangeUserDefinedOutputOptions(wxCommandEvent &e)
void OnProcessorChanged(wxCommandEvent &e)
event handler if processor was changed
void OnFileFormatChanged(wxCommandEvent &e)
event handler if default file format was changed
void OnCPDetectorSave(wxCommandEvent &e)
event handler for saving cp detector settings
void EnableRotationCtrls(bool enable)
void OnCPDetectorEdit(wxCommandEvent &e)
PreferencesDialog(wxWindow *parent)
ctor.
void UpdateBlenderControls()
void UpdateDisplayData(int panel)
Config to Window.
void OnCPDetectorAdd(wxCommandEvent &e)
void OnUpdateProjectFilename(wxCommandEvent &e)
event handler to update preview for project filename
void OnExifArgfile2Choose(wxCommandEvent &e)
void UpdateProcessorControls()
void OnCustomEnblend(wxCommandEvent &e)
void OnEnblendExe(wxCommandEvent &e)
void OnCPDetectorMoveUp(wxCommandEvent &e)
void OnExifArgfileChoose(wxCommandEvent &e)
void OnCPDetectorLoad(wxCommandEvent &e)
event handler for loading cp detector settings
void OnCPDetectorMoveDown(wxCommandEvent &e)
void OnCPDetectorDefault(wxCommandEvent &e)
void OnRawTherapeeExe(wxCommandEvent &e)
void OnOk(wxCommandEvent &e)
CPDetectorConfig cpdetector_config_edit
void OnCPDetectorDelete(wxCommandEvent &e)
wxListBox * m_CPDetectorList
void OnRestoreDefaults(wxCommandEvent &e)
void UpdateConfigData()
Window to Config.
void OnUserDefinedOutputOptionsCheckBox(wxCommandEvent &e)
void OnCustomEnfuse(wxCommandEvent &e)
void OnDarktableExe(wxCommandEvent &e)
static huginApp * Get()
hack.. kind of a pseudo singleton...
#define HUGIN_FT_TEMPLATE_SIZE
#define HUGIN_FT_ROTATION_START_ANGLE
#define HUGIN_PROCESSOR_VERBOSE
#define HUGIN_USE_EXIFTOOL
#define HUGIN_PROCESSOR_GUI
#define HUGIN_DEFAULT_OUTPUT_NAME
#define HUGIN_JPEG_QUALITY
#define HUGIN_IMGCACHE_UPPERBOUND
#define HUGIN_ENBLEND_ARGS
#define HUGIN_FT_ROTATION_STEPS
#define HUGIN_PROCESSOR_START
#define HUGIN_EXIFTOOL_CREATE_GPANO
#define HUGIN_NONA_USEGPU
#define HUGIN_NONA_CROPPEDIMAGES
#define HUGIN_FT_ROTATION_SEARCH
#define HUGIN_ENBLEND_EXE_CUSTOM
#define HUGIN_TIFF_COMPRESSION
#define HUGIN_DEFAULT_PROJECT_NAME
#define HUGIN_FT_CURV_THRESHOLD
#define HUGIN_FT_LOCAL_SEARCH_WIDTH
#define HUGIN_ENFUSE_ARGS
#define HUGIN_CELESTE_FILTER
#define HUGIN_DEFAULT_BLENDER
#define HUGIN_ENBLEND_EXE
#define HUGIN_ASS_AUTO_ALIGN
#define HUGIN_ASS_LINEFIND
#define HUGIN_ASS_PANO_DOWNSIZE_FACTOR
#define HUGIN_ASS_AUTO_CPCLEAN
#define HUGIN_FT_ROTATION_STOP_ANGLE
#define HUGIN_NONA_INTERPOLATOR
#define HUGIN_ENFUSE_EXE_CUSTOM
#define HUGIN_PROCESSOR_OVERWRITE
#define HUGIN_LDR_OUTPUT_FORMAT
#define HUGIN_ASS_NCONTROLPOINTS
#define HUGIN_PHOTOMETRIC_OPTIMIZER_NRPOINTS
#define HUGIN_CELESTE_AUTO
#define HUGIN_CELESTE_THRESHOLD
#define HUGIN_SHOW_PROJECTION_HINTS
#define HUGIN_FT_SEARCH_AREA_PERCENT
#define HUGIN_IMGCACHE_MAPPING_FLOAT
#define HUGIN_FT_CORR_THRESHOLD
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 getDefaultProjectName(const HuginBase::Panorama &pano, const wxString filenameTemplate)
gets the default project name, as defined in the preferences
functions for interaction with the hugin configuration file
wxString doubleTowxString(double d, int digits)
int HuginMessageBox(const wxString &message, const wxString &caption, int style, wxWindow *parent)
bool stringToDouble(const STR &str_, double &dest)
convert a string to a double, ignore localisation.
void StoreFramePosition(wxTopLevelWindow *frame, const wxString &basename, const bool ignoreMaximize)
void RestoreFramePosition(wxTopLevelWindow *frame, const wxString &basename, const bool ignoreMaximize)
include file for the hugin project
include file for the hugin project
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.