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[
"%firstimage"]=_(
"first image");
52 placeholder[
"%lastimage"]=_(
"last image");
53 placeholder[
"%#images"]=
"0";
54 placeholder[
"%directory"]=_(
"directory");
55 placeholder[
"%projection"]=_(
"Equirectangular");
56 placeholder[
"%focallength"]=
"28";
57 wxDateTime datetime=wxDateTime(13,wxDateTime::May,2012,11,35);
60 placeholder[
"%maker"]=_(
"Camera maker");
61 placeholder[
"%model"]=_(
"Camera model");
62 placeholder[
"%lens"]=_(
"Lens");
69 placeholder[
"%firstimage"]=firstImg.GetName();
70 if (firstImg.GetDirCount() > 0)
72 placeholder[
"%directory"] = firstImg.GetDirs().Last();
76 placeholder[
"%directory"] = wxEmptyString;
78 placeholder[
"%focallength"]=wxString::Format(
"%.0f", img0.getExifFocalLength());
79 struct tm exifdatetime;
82 wxDateTime datetime = wxDateTime(exifdatetime);
89 const wxFileName firstFile(img0.getFilename());
90 wxDateTime createTime;
91 firstFile.GetTimes(NULL, NULL, &createTime);
92 placeholder[
"%date"] =
CleanDateTime(createTime.FormatDate());
93 placeholder[
"%time"] =
CleanDateTime(createTime.FormatTime());
95 placeholder[
"%maker"]=wxString(img0.getExifMake().c_str(), wxConvLocal);
96 placeholder[
"%model"]=wxString(img0.getExifModel().c_str(), wxConvLocal);
97 placeholder[
"%lens"]=wxString(img0.getExifLens().c_str(), wxConvLocal);
100 placeholder[
"%lastimage"]=lastImg.GetName();
101 placeholder[
"%#images"]=wxString::Format(
"%lu", (
unsigned long)pano.
getNrOfImages());
103 pano_projection_features proj;
104 if (panoProjectionFeaturesQuery(opts.getProjection(), &proj))
106 wxString str2(proj.name, wxConvLocal);
107 placeholder[
"%projection"]=wxGetTranslation(str2);
111 placeholder[
"%projection"]=_(
"unknown projection");
118 if(filenameTemplate.IsEmpty())
122 filename.Replace(
"/",
"\\",
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);
151 wxFileName fileName(filename);
152 if (fileName.IsAbsolute())
156 return pathPrefix+filename;
164 if (projectname.IsEmpty())
178 if(filenameTemplate.IsEmpty())
182 filename.Replace(
"/",
"\\",
true);
187 filename=filenameTemplate;
189 wxString pathPrefix=project.GetPathWithSep();
200 placeholder.insert(std::make_pair(
"%projectname", project.GetName()));
202 for(Placeholdersmap::const_iterator it=placeholder.begin(); it!=placeholder.end(); ++it)
204 filename.Replace(it->first, it->second,
true);
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