28#include "hugin_config.h"
32#include <wx/fileconf.h>
33#include <wx/wfstream.h>
34#include <wx/sstream.h>
35#include <wx/propgrid/advprops.h>
49 for (
int n = 0;
n <
nP;
n++)
82 "Condition1=ImageCount>1\n"
83 "Condition2=PanoVFOV<100\n"
84 "Condition3=PanoHFOV>=100\n"
87 "Projection=Cylindrical\n"
90 "Condition1=ImageCount>1\n"
91 "Condition2=PanoVFOV>=100\n"
94 "Projection=Equirectangular\n"
97 "Condition1=ImageCount>1\n"
98 "Condition2=PanoHFOV<100\n"
99 "Condition3=PanoVFOV<100\n"
102 "Projection=Rectilinear"
161 if (
key.SubString(0, 8).CmpNoCase(
"Condition") == 0)
164 p->SetHelpString(
_(
"Define which condition should be fulfilled to apply this setting.\nThe variables CameraModel, CameraMaker, Lens, HFOV, LensType, Focallength, Focallength35mm, Filename, Path, ImageCount, PanoHFOV and PanoVFOV can be used.\nFor comparison you can use ==, !=, =~ and !~ for strings and ==, !=, <, <=, > and >= for numbers."));
167 if (
key.CmpNoCase(
"Projection") == 0)
178 p->SetHelpString(
_(
"Select which projection should be selected."));
181 if (
key.CmpNoCase(
"FOV") == 0)
184 p->SetHelpString(
_(
"Select which field of view should be set.\nCan be Auto for automatic detection, or a fixed horizontal field of view (e.g. 120) or horizontal x vertical field of view (e.g. 140x70)."));
187 if (
key.CmpNoCase(
"Canvas") == 0)
190 p->SetHelpString(
_(
"Select to which size the canvas should be set.\nFor automatic detection use Auto or a scale factor in percent (e.g. 70%).\nOr give a width x height (e.g. 8000x4000)."));
193 if (
key.CmpNoCase(
"Crop") == 0)
196 p->SetHelpString(
_(
"Select which crop should be used.\nFor automatic detection use Auto, AutoOutside or AutoHDR.\nOr give 4 numbers as left, right, top and bottom. You can use absolute pixel values (e.g. 100,7900,1000,3900) or relative values by appending a percentage sign (e.g. 10,90,10,90%)."));
199 if (
key.CmpNoCase(
"OutputExposure") == 0)
202 p->SetHelpString(
_(
"Select which output exposure value should be used.\nFor automatic detection use Auto or give a fixed exposure value."));
205 if (
key.CmpNoCase(
"OutputType") == 0)
209 for (
size_t i = 0;
i < values.size(); ++
i)
212 values[
i].Trim(
true).Trim(
false);
215 p->SetHelpString(
_(
"Select which output types should be activated."));
218 if (
key.CmpNoCase(
"Blender") == 0)
229 p->SetHelpString(
_(
"Select which blender should be used (can be enblend or internal)."));
232 if (
key.CmpNoCase(
"BlenderArgs") == 0)
235 p->SetHelpString(
_(
"Select which arguments should be passed to the blender."));
238 if (
key.CmpNoCase(
"LDRFileType") == 0)
249 p->SetHelpString(
_(
"Select fileformat for LDR output should be set."));
252 if (
key.CmpNoCase(
"LDRCompression") == 0)
255 p->SetHelpString(
_(
"Select which compressions should be used for LDR images.\nFor TIFF images NONE, PACKBITS, LZW and DEFLATE are supported.\nFor JPEG image give a number as quality (0-100)."));
258 if (
key.CmpNoCase(
"HDRFileType") == 0)
269 p->SetHelpString(
_(
"Select fileformat for HDR output should be set."));
272 if (
key.CmpNoCase(
"HDRCompression") == 0)
275 p->SetHelpString(
_(
"Select which compressions should be used for HDR images.\nFor TIFF images NONE, PACKBITS, LZW and DEFLATE are supported."));
339 iniFile.SetPath(
"/" + p->GetLabel());
346 if (value.GetType().CmpNoCase(
"string") == 0)
353 if (value.GetType().CmpNoCase(
"long") == 0)
355 const long i = value.GetLong();
361 if (value.GetType().CmpNoCase(
"arrstring") == 0)
365 for (
size_t i = 0;
i < values.size(); ++
i)
367 s << values[
i] <<
",";
407#define ADDKEYITEM(s) val=s;\
408 if (!contains(knownValues, val))\
410 item = menu.Append(wxID_ANY, wxString::Format(_("Add %s"), val.c_str()));\
411 Bind(wxEVT_MENU, [this, category, val](wxCommandEvent&) { AddKey(category, val, wxEmptyString); m_grid->RefreshGrid(); }, item->GetId());\
429 menu.AppendSeparator();
443 if (
prop->IsCategory())
455 if (
prop->IsCategory())
498 values.Add(
it.GetProperty()->GetLabel());
568 index = std::max<long>(index, x);
573 const wxString val = wxString::Format(
"Condition%d", index);
static wxArrayString ProjectionArray
static wxArrayString BlenderArray
bool contains(const wxArrayString &stringArray, const wxString &string, bool caseInSensitive=true)
check if given string is in wxArrayString, do comparison case insentive or case sensitive
static wxArrayString OutputTypeArray
static const wxString defaultIni
default ini, if no one exists load this one
static wxArrayString HDRFileTypeArray
static wxArrayString LDRFileTypeArray
Definition of dialog for editing user-defined output ini file.
wxPGProperty * m_currentSection
void AddKey(wxPGProperty *section, const wxString &key, const wxString &value)
add key with value to wxPropertyGrid, generate if necessary all sub properties
wxArrayString GetChildren(wxPGProperty *prop) const
return wxArrayString with all sub-entries of given wxPGProperty
void BuildAddContextMenu(wxMenu &menu, wxPGProperty *category, const bool addSeparator)
function to build context menu with all missing entries
EditOutputIniDialog(wxWindow *parent)
Constructor, constructs dialog; restore last uses settings, size and position.
void OnRenameSection(wxCommandEvent &e)
renames a new section
void OnOk(wxCommandEvent &e)
save ini and close dialog
void OnContextMenu(wxContextMenuEvent &e)
right click handler, show popup menu
wxArrayString GetSections() const
return wxArrayString with all sections
void OnAddSection(wxCommandEvent &e)
add a new section
wxPropertyGridManager * m_grid
void ReadIni()
read the ini file and populate the control
~EditOutputIniDialog()
destructor, saves size and position
void OnAddCondition(wxCommandEvent &e)
adds a new condition to list
wxFileName GetIniFileName()
return the filename of the default ini file
void WriteIni()
write the ini to disc
int HuginMessageBox(const wxString &message, const wxString &caption, int style, wxWindow *parent)
std::string GetUserAppDataDir()
returns the directory for user specific Hugin settings, e.g.
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
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.