38 wxString result(input);
39 result.Replace(
"/",
"_");
40 result.Replace(
"\\",
"_");
41 result.Replace(
":",
"-");
42 result.Replace(
"*",
".");
43 result.Replace(
"?",
".");
44 result.Replace(
"<",
".");
45 result.Replace(
">",
".");
46 result.Replace(
"|",
".");
51 placeholder[wxT(
"%firstimage")]=_(
"first image");
52 placeholder[wxT(
"%lastimage")]=_(
"last image");
53 placeholder[wxT(
"%#images")]=wxT(
"0");
54 placeholder[wxT(
"%directory")]=_(
"directory");
55 placeholder[wxT(
"%projection")]=_(
"Equirectangular");
56 placeholder[wxT(
"%focallength")]=wxT(
"28");
57 wxDateTime datetime=wxDateTime(13,wxDateTime::May,2012,11,35);
58 placeholder[wxT(
"%date")] =
CleanDateTime(datetime.FormatDate());
59 placeholder[wxT(
"%time")] =
CleanDateTime(datetime.FormatTime());
60 placeholder[wxT(
"%maker")]=_(
"Camera maker");
61 placeholder[wxT(
"%model")]=_(
"Camera model");
62 placeholder[wxT(
"%lens")]=_(
"Lens");
69 placeholder[wxT(
"%firstimage")]=firstImg.GetName();
70 if (firstImg.GetDirCount() > 0)
72 placeholder[wxT(
"%directory")] = firstImg.GetDirs().Last();
76 placeholder[wxT(
"%directory")] = wxEmptyString;
78 placeholder[wxT(
"%focallength")]=wxString::Format(wxT(
"%.0f"), img0.getExifFocalLength());
79 struct tm exifdatetime;
82 wxDateTime datetime = wxDateTime(exifdatetime);
83 placeholder[wxT(
"%date")] =
CleanDateTime(datetime.FormatDate());
84 placeholder[wxT(
"%time")] =
CleanDateTime(datetime.FormatTime());
89 const wxFileName firstFile(img0.getFilename());
90 wxDateTime createTime;
91 firstFile.GetTimes(NULL, NULL, &createTime);
92 placeholder[wxT(
"%date")] =
CleanDateTime(createTime.FormatDate());
93 placeholder[wxT(
"%time")] =
CleanDateTime(createTime.FormatTime());
95 placeholder[wxT(
"%maker")]=wxString(img0.getExifMake().c_str(), wxConvLocal);
96 placeholder[wxT(
"%model")]=wxString(img0.getExifModel().c_str(), wxConvLocal);
97 placeholder[wxT(
"%lens")]=wxString(img0.getExifLens().c_str(), wxConvLocal);
100 placeholder[wxT(
"%lastimage")]=lastImg.GetName();
101 placeholder[wxT(
"%#images")]=wxString::Format(wxT(
"%lu"), (
unsigned long)pano.
getNrOfImages());
103 pano_projection_features proj;
104 if (panoProjectionFeaturesQuery(opts.getProjection(), &proj))
106 wxString str2(proj.name, wxConvLocal);
107 placeholder[wxT(
"%projection")]=wxGetTranslation(str2);
111 placeholder[wxT(
"%projection")]=_(
"unknown projection");
118 if(filenameTemplate.IsEmpty())
122 filename.Replace(wxT(
"/"), wxT(
"\\"),
true);
127 filename=filenameTemplate;
135 pathPrefix=firstImg.GetPathWithSep();
142 for(Placeholdersmap::const_iterator it=placeholder.begin(); it!=placeholder.end(); ++it)
144 filename.Replace(it->first, it->second,
true);
148 filename=wxT(
"pano");
151 wxFileName fileName(filename);
152 if (fileName.IsAbsolute())
156 return pathPrefix+filename;
164 if (projectname.IsEmpty())
178 if(filenameTemplate.IsEmpty())
182 filename.Replace(wxT(
"/"), wxT(
"\\"),
true);
187 filename=filenameTemplate;
189 wxString pathPrefix=project.GetPathWithSep();
200 placeholder.insert(std::make_pair(wxT(
"%projectname"), project.GetName()));
202 for(Placeholdersmap::const_iterator it=placeholder.begin(); it!=placeholder.end(); ++it)
204 filename.Replace(it->first, it->second,
true);
208 filename=wxT(
"pano");
211 wxFileName fileName(filename);
212 if (fileName.IsAbsolute())
216 return pathPrefix+filename;
std::map< wxString, wxString > Placeholdersmap
void FillDefaultPlaceholders(Placeholdersmap &placeholder)
void FillPlaceholders(Placeholdersmap &placeholder, const HuginBase::Panorama &pano)
std::size_t getNrOfImages() const
number of images.
const int getExifDateTime(struct tm *datetime) const
try to convert Exif date time string to struct tm
#define HUGIN_DEFAULT_PROJECT_NAME
const PanoramaOptions & getOptions() const
returns the options for this panorama
functions for interaction with the hugin configuration file
const SrcPanoImage & getImage(std::size_t nr) const
get a panorama image, counting starts with 0
wxString CleanDateTime(const wxString &input)
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 ...
All variables of a source image.
wxString getDefaultProjectName(const HuginBase::Panorama &pano, const wxString filenameTemplate)
gets the default project name, as defined in the preferences