Hugintrunk  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
LensTools.cpp
Go to the documentation of this file.
1 // -*- c-basic-offset: 4 -*-
10 /* This program is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU General Public
12  * License as published by the Free Software Foundation; either
13  * version 2 of the License, or (at your option) any later version.
14  *
15  * This software is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18  * General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public
21  * License along with this software. If not, see
22  * <http://www.gnu.org/licenses/>.
23  *
24  */
25 
26 #include "panoinc_WX.h"
27 #include <wx/msgdlg.h>
28 #include "panoinc.h"
29 #include "LensTools.h"
30 #include <algorithm>
33 #include "base_wx/PanoCommand.h"
34 
35 void FillLensProjectionList(wxControlWithItems* list)
36 {
37  list->Clear();
39  for (auto& lensInfo : lensInfoVector)
40  {
41  list->Append(lensInfo.name, (void*)lensInfo.id);
42  };
43  list->SetSelection(0);
44 }
46 {
47  // add all lens types to vector
48  HuginLensTools::LensInfo lensInfo;
49  HuginLensTools::LensInfoVector lensInfoVector;;
51  lensInfo.name = _("Normal (rectilinear)");
52  lensInfoVector.push_back(lensInfo);
54  lensInfo.name = _("Panoramic (cylindrical)");
55  lensInfoVector.push_back(lensInfo);
57  lensInfo.name = _("Circular fisheye");
58  lensInfoVector.push_back(lensInfo);
60  lensInfo.name = _("Full frame fisheye");
61  lensInfoVector.push_back(lensInfo);
63  lensInfo.name = _("Equirectangular");
64  lensInfoVector.push_back(lensInfo);
66  lensInfo.name = _("Orthographic");
67  lensInfoVector.push_back(lensInfo);
69  lensInfo.name = _("Stereographic");
70  lensInfoVector.push_back(lensInfo);
72  lensInfo.name = _("Equisolid");
73  lensInfoVector.push_back(lensInfo);
75  lensInfo.name = _("Fisheye Thoby");
76  lensInfoVector.push_back(lensInfo);
77  return lensInfoVector;
78 }
79 ;
80 
81 void FillBlenderList(wxControlWithItems* list)
82 {
83  list->Clear();
84  list->Append(_("enblend"), (void*)HuginBase::PanoramaOptions::ENBLEND_BLEND);
85  list->Append(_("builtin"), (void*)HuginBase::PanoramaOptions::INTERNAL_BLEND);
86  list->SetSelection(0);
87 };
88 
89 void SelectListValue(wxControlWithItems* list, size_t newValue)
90 {
91  for(unsigned int i=0;i<list->GetCount();i++)
92  {
93  if((size_t)list->GetClientData(i)==newValue)
94  {
95  list->SetSelection(i);
96  return;
97  };
98  };
99  list->SetSelection(0);
100 };
101 
102 size_t GetSelectedValue(wxControlWithItems* list)
103 {
104  return (size_t)(list->GetClientData(list->GetSelection()));
105 };
106 
108 {
109  wxString ps;
110  switch (img.getProjection())
111  {
112  case HuginBase::SrcPanoImage::RECTILINEAR: ps << _("Normal (rectilinear)"); break;
113  case HuginBase::SrcPanoImage::PANORAMIC: ps << _("Panoramic (cylindrical)"); break;
114  case HuginBase::SrcPanoImage::CIRCULAR_FISHEYE: ps << _("Circular fisheye"); break;
115  case HuginBase::SrcPanoImage::FULL_FRAME_FISHEYE: ps << _("Full frame fisheye"); break;
116  case HuginBase::SrcPanoImage::EQUIRECTANGULAR: ps << _("Equirectangular"); break;
117  case HuginBase::SrcPanoImage::FISHEYE_ORTHOGRAPHIC: ps << _("Orthographic"); break;
118  case HuginBase::SrcPanoImage::FISHEYE_STEREOGRAPHIC:ps << _("Stereographic"); break;
119  case HuginBase::SrcPanoImage::FISHEYE_EQUISOLID: ps << _("Equisolid"); break;
120  case HuginBase::SrcPanoImage::FISHEYE_THOBY: ps << _("Fisheye Thoby"); break;
121  }
122  return ps;
123 };
124 
126 {
127  wxString s;
128  switch (img.getResponseType())
129  {
131  s = _("custom (EMoR)");
132  break;
134  s = _("Linear");
135  break;
136  default:
137  s = wxEmptyString;
138  break;
139  };
140  return s;
141 };
142 
143 void SaveLensParameters(const wxString filename, HuginBase::Panorama* pano, unsigned int imgNr)
144 {
145  HuginBase::StandardImageVariableGroups variable_groups(*pano);
146  const HuginBase::Lens & lens = variable_groups.getLensForImage(imgNr);
147  const HuginBase::VariableMap & vars = pano->getImageVariables(imgNr);
148  // get the variable map
149  char * p = setlocale(LC_NUMERIC,NULL);
150  char * old_locale = strdup(p);
151  setlocale(LC_NUMERIC,"C");
152  wxFileConfig cfg(wxT("hugin lens file"),wxT(""),filename);
153  cfg.Write(wxT("Lens/image_width"), (long) lens.getImageSize().x);
154  cfg.Write(wxT("Lens/image_height"), (long) lens.getImageSize().y);
155  cfg.Write(wxT("Lens/type"), (long) lens.getProjection());
156  cfg.Write(wxT("Lens/hfov"), const_map_get(vars,"v").getValue());
157  cfg.Write(wxT("Lens/hfov_link"), const_map_get(lens.variables,"v").isLinked() ? 1:0);
158  cfg.Write(wxT("Lens/crop"), lens.getCropFactor());
159 
160  // loop to save lens variables
161  const char ** varname = HuginBase::Lens::variableNames;
162  while (*varname)
163  {
164  //ignore hfov, hfov is separately handled by the code above
165  if (std::string(*varname) == "v")
166  {
167  varname++;
168  continue;
169  }
170  wxString key(wxT("Lens/"));
171  key.append(wxString(*varname, wxConvLocal));
172  cfg.Write(key, const_map_get(vars,*varname).getValue());
173  key.append(wxT("_link"));
174  cfg.Write(key, const_map_get(lens.variables,*varname).isLinked() ? 1:0);
175  varname++;
176  }
177 
178  const HuginBase::SrcPanoImage & image = pano->getImage(imgNr);
179  cfg.Write(wxT("Lens/crop/enabled"), image.getCropMode()==HuginBase::SrcPanoImage::NO_CROP ? 0l : 1l);
180  cfg.Write(wxT("Lens/crop/autoCenter"), image.getAutoCenterCrop() ? 1l : 0l);
181  const vigra::Rect2D cropRect=image.getCropRect();
182  cfg.Write(wxT("Lens/crop/left"), cropRect.left());
183  cfg.Write(wxT("Lens/crop/top"), cropRect.top());
184  cfg.Write(wxT("Lens/crop/right"), cropRect.right());
185  cfg.Write(wxT("Lens/crop/bottom"), cropRect.bottom());
186 
187  if (!image.getExifMake().empty() && !image.getExifModel().empty() && image.getExifFocalLength()>0)
188  {
189  // write exif data to ini file
190  cfg.Write(wxT("EXIF/CameraMake"), wxString(image.getExifMake().c_str(), wxConvLocal));
191  cfg.Write(wxT("EXIF/CameraModel"), wxString(image.getExifModel().c_str(), wxConvLocal));
192  cfg.Write(wxT("EXIF/FocalLength"), image.getExifFocalLength());
193  cfg.Write(wxT("EXIF/Aperture"), image.getExifAperture());
194  cfg.Write(wxT("EXIF/ISO"), image.getExifISO());
195  cfg.Write(wxT("EXIF/CropFactor"), image.getCropFactor());
196  cfg.Write(wxT("EXIF/Distance"), image.getExifDistance());
197  }
198  cfg.Flush();
199 
200  // reset locale
201  setlocale(LC_NUMERIC,old_locale);
202  free(old_locale);
203 };
204 
205 bool ApplyLensParameters(wxWindow * parent, HuginBase::Panorama *pano, HuginBase::UIntSet images, PanoCommand::PanoCommand*& cmd)
206 {
207  HuginBase::StandardImageVariableGroups variable_groups(*pano);
208  HuginBase::Lens lens=variable_groups.getLensForImage(*images.begin());
209  bool cropped=false;
210  bool autoCenterCrop=false;
211  vigra::Rect2D cropRect;
212  if (LoadLensParametersChoose(parent, lens, cropped, autoCenterCrop, cropRect))
213  {
214  // Merge the lens parameters with the image variable map.
215  HuginBase::VariableMapVector vars(images.size());
216  size_t i=0;
217  for(HuginBase::UIntSet::const_iterator it=images.begin();it!=images.end();++it,++i)
218  {
219  vars[i]=pano->getImageVariables(*it);
220  for (HuginBase::LensVarMap::iterator it2 = lens.variables.begin(); it2 != lens.variables.end(); ++it2)
221  {
222  if (it2->second.getName() == "Eev" || it2->second.getName() == "Er" || it2->second.getName() == "Eb")
223  {
224  continue;
225  };
226  vars[i].find(it2->first)->second.setValue(it2->second.getValue());
227  }
228  };
229 
233  std::vector<PanoCommand::PanoCommand*> cmds;
234  // update links
235  std::set<HuginBase::ImageVariableGroup::ImageVariableEnum> linkedVariables;
236  std::set<HuginBase::ImageVariableGroup::ImageVariableEnum> unlinkedVariables;
237  for (HuginBase::LensVarMap::iterator it = lens.variables.begin(); it != lens.variables.end(); ++it)
238  {
239  if(it->second.getName()=="Eev" || it->second.getName() == "Er" || it->second.getName() == "Eb")
240  {
241  continue;
242  };
243 #define image_variable( name, type, default_value ) \
244  if (HuginBase::PTOVariableConverterFor##name::checkApplicability(it->second.getName()))\
245  {\
246  if(it->second.isLinked())\
247  linkedVariables.insert(HuginBase::ImageVariableGroup::IVE_##name);\
248  else\
249  unlinkedVariables.insert(HuginBase::ImageVariableGroup::IVE_##name);\
250  }
252 #undef image_variable
253  }
254  if (!linkedVariables.empty())
255  {
256  cmds.push_back(new PanoCommand::ChangePartImagesLinkingCmd(*pano, images, linkedVariables,
258  }
259  if (!unlinkedVariables.empty())
260  {
261  cmds.push_back(new PanoCommand::ChangePartImagesLinkingCmd(*pano, images, unlinkedVariables,
263  }
264  //update lens parameters
265  cmds.push_back(new PanoCommand::UpdateImagesVariablesCmd(*pano, images, vars));
266 
267  // Set the lens projection type.
268  cmds.push_back(new PanoCommand::ChangeImageProjectionCmd(*pano, images, (HuginBase::SrcPanoImage::Projection) lens.getProjection()));
269  // update crop factor
270  cmds.push_back(new PanoCommand::ChangeImageCropFactorCmd(*pano,images,lens.getCropFactor()));
271  // update the crop rect
272  cmds.push_back(new PanoCommand::ChangeImageAutoCenterCropCmd(*pano,images,autoCenterCrop));
273  if(cropped)
274  {
275  cmds.push_back(new PanoCommand::ChangeImageCropRectCmd(*pano,images,cropRect));
276  }
277  else
278  {
279  cmds.push_back(new PanoCommand::ChangeImageCropModeCmd(*pano,images,HuginBase::BaseSrcPanoImage::NO_CROP));
280  };
281  cmd=new PanoCommand::CombinedPanoCommand(*pano, cmds);
282  return true;
283  }
284  else
285  {
286  return false;
287  };
288 };
289 
290 bool LoadLensParametersChoose(wxWindow * parent, HuginBase::Lens & lens,
291  bool & cropped, bool & autoCenterCrop, vigra::Rect2D & cropRect)
292 {
293  wxString fname;
294  wxFileDialog dlg(parent,
295  _("Load lens parameters"),
296  wxConfigBase::Get()->Read(wxT("/lensPath"),wxT("")), wxT(""),
297  _("Lens Project Files (*.ini)|*.ini|All files (*.*)|*.*"),
298  wxFD_OPEN, wxDefaultPosition);
299  dlg.SetDirectory(wxConfigBase::Get()->Read(wxT("/lensPath"),wxT("")));
300  if (dlg.ShowModal() == wxID_OK)
301  {
302  fname = dlg.GetPath();
303  wxConfig::Get()->Write(wxT("/lensPath"), dlg.GetDirectory()); // remember for later
304  // read with with standart C numeric format
305  char * p = setlocale(LC_NUMERIC,NULL);
306  char * old_locale = strdup(p);
307  setlocale(LC_NUMERIC,"C");
308  {
309  wxFileConfig cfg(wxT("hugin lens file"),wxT(""),fname);
310  long w=0;
311  cfg.Read(wxT("Lens/image_width"), &w);
312  long h=0;
313  cfg.Read(wxT("Lens/image_height"), &h);
314  if (w>0 && h>0) {
315  vigra::Size2D sz = lens.getImageSize();
316  if (w != sz.x || h != sz.y) {
317  std::cerr << "Image size: " << sz << " size in lens parameter file: " << w << "x" << h << std::endl;
318  int ret = wxMessageBox(_("Incompatible lens parameter file, image sizes do not match\nApply settings anyway?"), _("Error loading lens parameters"), wxICON_QUESTION |wxYES_NO);
319  if (ret == wxNO) {
320  setlocale(LC_NUMERIC,old_locale);
321  free(old_locale);
322  return false;
323  }
324  }
325  } else {
326  // lens ini file didn't store the image size,
327  // assume everything is all right.
328  }
329  long integer=0;
330  if(cfg.Read(wxT("Lens/type"), &integer))
331  {
333  };
334  double d=1;
335  if(cfg.Read(wxT("Lens/crop"), &d))
336  {
337  lens.setCropFactor(d);
338  };
339  //special treatment for hfov, we are reading hfov and hfov_linked instead of v and v_linked
340  d=50;
341  if(cfg.Read(wxT("Lens/hfov"), &d))
342  {
343  map_get(lens.variables,"v").setValue(d);
344  };
345  integer=1;
346  if(cfg.Read(wxT("Lens/hfov_linked"), &integer))
347  {
348  map_get(lens.variables,"v").setLinked(integer != 0);
349  };
350  DEBUG_DEBUG("read lens hfov: " << d);
351 
352  // loop to load lens variables
353  const char ** varname = HuginBase::Lens::variableNames;
354  while (*varname) {
355  wxString key(wxT("Lens/"));
356  key.append(wxString(*varname, wxConvLocal));
357  d = 0;
358  if (cfg.Read(key,&d))
359  {
360  // only set value if variabe was found in the script
361  map_get(lens.variables, *varname).setValue(d);
362  integer = 1;
363  key.append(wxT("_link"));
364  if(cfg.Read(key, &integer))
365  {
366  map_get(lens.variables, *varname).setLinked(integer != 0);
367  };
368  }
369  varname++;
370  }
371 
372  // crop parameters
373  long v=0;
374  cfg.Read(wxT("Lens/crop/enabled"), &v);
375  cropped=(v!=0);
376  if(cropped)
377  {
378  long left=0;
379  long top=0;
380  long right=0;
381  long bottom=0;
382  if(cfg.Read(wxT("Lens/crop/left"), &left) && cfg.Read(wxT("Lens/crop/top"), &top) &&
383  cfg.Read(wxT("Lens/crop/right"), &right) && cfg.Read(wxT("Lens/crop/bottom"), &bottom))
384  {
385  cropped=true;
386  cropRect=vigra::Rect2D(left,top,right,bottom);
387  }
388  else
389  {
390  cropped=false;
391  };
392  };
393  v=1;
394  if(cfg.Read(wxT("Lens/crop/autoCenter"), &v))
395  {
396  autoCenterCrop=(v!=0);
397  };
398  }
399  // reset locale
400  setlocale(LC_NUMERIC,old_locale);
401  free(old_locale);
402  return true;
403  }
404  else
405  {
406  return false;
407  };
408 };
409 
410 void SaveLensParametersToIni(wxWindow * parent, HuginBase::Panorama *pano, const HuginBase::UIntSet images)
411 {
412  if (images.size() == 1)
413  {
414  unsigned int imgNr = *(images.begin());
415  wxFileDialog dlg(parent,
416  _("Save lens parameters file"),
417  wxConfigBase::Get()->Read(wxT("/lensPath"),wxT("")), wxT(""),
418  _("Lens Project Files (*.ini)|*.ini|All files (*)|*"),
419  wxFD_SAVE | wxFD_OVERWRITE_PROMPT, wxDefaultPosition);
420  dlg.SetDirectory(wxConfigBase::Get()->Read(wxT("/lensPath"),wxT("")));
421  if (dlg.ShowModal() == wxID_OK)
422  {
423  wxFileName filename(dlg.GetPath());
424  if(!filename.HasExt())
425  {
426  filename.SetExt(wxT("ini"));
427  if (filename.Exists())
428  {
429  int d = wxMessageBox(wxString::Format(_("File %s exists. Overwrite?"), filename.GetFullPath().c_str()),
430  _("Save project"), wxYES_NO | wxICON_QUESTION);
431  if (d != wxYES) {
432  return;
433  }
434  }
435  }
436  wxConfig::Get()->Write(wxT("/lensPath"), dlg.GetDirectory()); // remember for later
437  SaveLensParameters(filename.GetFullPath(),pano,imgNr);
438  }
439  }
440  else
441  {
442  wxLogError(_("Please select an image and try again"));
443  }
444 }
445 
446 bool CheckLensStacks(HuginBase::Panorama* pano, bool allowCancel)
447 {
448  if (pano->getNrOfImages() < 2)
449  {
450  return true;
451  };
452  const size_t nrImages = pano->getNrOfImages();
453  bool stacksCorrectLinked = true;
454  for (size_t i = 0; i < nrImages - 1; ++i)
455  {
456  const HuginBase::SrcPanoImage& image1 = pano->getImage(i);
457  if (image1.YawisLinked())
458  {
459  for (size_t j = i + 1; j < nrImages && stacksCorrectLinked; ++j)
460  {
461  const HuginBase::SrcPanoImage& image2 = pano->getImage(j);
462  if (image1.YawisLinkedWith(image2))
463  {
464  stacksCorrectLinked = stacksCorrectLinked &&
465  image1.HFOVisLinkedWith(image2) &&
466  image1.RadialDistortionisLinkedWith(image2) &&
467  image1.RadialDistortionCenterShiftisLinkedWith(image2) &&
468  image1.ShearisLinkedWith(image2);
469  };
470  };
471  };
472  };
473  if (stacksCorrectLinked)
474  {
475  return true;
476  }
477  else
478  {
479  int flags = wxICON_EXCLAMATION | wxOK;
480  if (allowCancel)
481  {
482  flags = flags | wxCANCEL;
483  };
484  if (wxMessageBox(_("This project contains stacks with linked positions. But the lens parameters are not linked for these images.\nThis will result in unwanted results.\nPlease check and correct this before proceeding."),
485 #ifdef _WIN32
486  _("Hugin"),
487 #else
488  wxT(""),
489 #endif
490  flags)==wxOK)
491  {
492  return true;
493  }
494  else
495  {
496  return false;
497  };
498  };
499 }
500 
501 namespace FormatString
502 {
504 {
505  wxString s;
506  struct tm exifdatetime;
507  if (img->getExifDateTime(&exifdatetime) == 0)
508  {
509  wxDateTime s_datetime = wxDateTime(exifdatetime);
510  s = s_datetime.Format();
511  }
512  else
513  {
514  s = wxString(img->getExifDate().c_str(), wxConvLocal);
515  }
516  return s;
517 }
518 
520 {
521  wxString s;
522  if (img->getExifFocalLength() > 0.0)
523  {
524  if (img->getExifFocalLength35() > 0.0)
525  {
526  s = wxString::Format(wxT("%0.1f mm (%0.0f mm)"), img->getExifFocalLength(), img->getExifFocalLength35());
527  }
528  else
529  {
530  s = wxString::Format(wxT("%0.1f mm"), img->getExifFocalLength());
531  };
532  }
533  else
534  {
535  s = wxEmptyString;
536  };
537  return s;
538 };
539 
541 {
542  wxString s;
543  if (img->getExifAperture() > 0)
544  {
545  s = wxString::Format(wxT("F%.1f"), img->getExifAperture());
546  }
547  else
548  {
549  s = wxEmptyString;
550  };
551  return s;
552 };
553 
555 {
556  wxString s;
557  const double exposureTime = img->getExifExposureTime();
558  if (exposureTime > 0.5)
559  {
560  if (exposureTime >= 1.0)
561  {
562  if (exposureTime >= 10.0)
563  {
564  s = wxString::Format(wxT("%3.0f s"), exposureTime);
565  }
566  else
567  {
568  s = wxString::Format(wxT("%1.1f s"), exposureTime);
569  }
570  }
571  else
572  {
573  s = wxString::Format(wxT("%1.2f s"), exposureTime);
574  }
575  }
576  else
577  {
578  if (exposureTime > 1e-9)
579  {
580  s = wxString::Format(wxT("1/%0.0f s"), 1.0 / exposureTime);
581  }
582  else
583  {
584  //Sanity
585  s = wxEmptyString;
586  }
587  }
588  return s;
589 };
590 
591 wxString GetIso(const HuginBase::SrcPanoImage* img)
592 {
593  wxString s;
594  if (img->getExifISO() > 0)
595  {
596  s = wxString::Format(wxT("%0.0f"), img->getExifISO());
597  }
598  else
599  {
600  s = wxEmptyString;
601  };
602  return s;
603 };
604 
605 };
606 
607 
608 
LensVarMap variables
Definition: Lens.h:106
Base class for all panorama commands.
Definition: Command.h:38
static const char * variableNames[]
Definition: Lens.h:110
static const std::set< ConstImageVariableGroup::ImageVariableEnum > & getLensVariables()
Get the set of lens image variables.
vigra::Size2D getImageSize() const
get the image size, in pixels
Definition: Lens.h:89
update variables of a group of images
Definition: PanoCommand.h:174
Change the linking of some variables across parts of an ImageVariableGroup containing some specified ...
Definition: PanoCommand.h:524
WXIMPEX bool ApplyLensParameters(wxWindow *parent, HuginBase::Panorama *pano, HuginBase::UIntSet images, PanoCommand::PanoCommand *&command)
applies lens parameter from user selected file to pano using GlobalCmdHist
Somewhere to specify what variables belong to what.
void setProjection(LensProjectionFormat l)
set projection type
Definition: Lens.h:60
some helper classes for graphes
include file for the hugin project
const Map::mapped_type & const_map_get(const Map &m, const typename Map::key_type &key)
Definition: stl_utils.h:110
void SaveLensParametersToIni(wxWindow *parent, HuginBase::Panorama *pano, const HuginBase::UIntSet images)
saves the lens parameters to ini files, provides all necessary dialogs
Definition: LensTools.cpp:410
PanoCommand to combine other PanoCommands.
Definition: PanoCommand.h:39
std::vector< LensInfo > LensInfoVector
vector of LensInfo to hold all available lens types
Definition: LensTools.h:48
std::set< unsigned int > UIntSet
Definition: PanoramaData.h:51
std::vector< VariableMap > VariableMapVector
wxString getResponseString(const HuginBase::SrcPanoImage &img)
Returns translated response type for given SrcPanoImage.
Definition: LensTools.cpp:125
Model for a panorama.
Definition: Panorama.h:152
LensProjectionFormat getProjection() const
get projection type
Definition: Lens.h:56
empirical model of response
Definition: SrcPanoImage.h:100
size_t GetSelectedValue(wxControlWithItems *list)
Returns the client value of the selected item from list.
Definition: LensTools.cpp:102
const VariableMap getImageVariables(unsigned int imgNr) const
Get the variables of an image.
Definition: Panorama.cpp:128
void SaveLensParameters(const wxString filename, HuginBase::Panorama *pano, unsigned int imgNr)
save the lens parameters of the image to a lens file named filename
Definition: LensTools.cpp:143
std::size_t getNrOfImages() const
number of images.
Definition: Panorama.h:205
WXIMPEX HuginLensTools::LensInfoVector GetLensProjectionList()
return a vector with all available projections
Definition: LensTools.cpp:45
const int getExifDateTime(struct tm *datetime) const
try to convert Exif date time string to struct tm
Map::mapped_type & map_get(Map &m, const typename Map::key_type &key)
get a map element.
Definition: stl_utils.h:98
#define WXIMPEX
Definition: hugin_shared.h:40
IMPEX double h[25][1024]
Definition: emor.cpp:169
void setCropFactor(double newCropFactor)
sets the crop factor
Definition: Lens.h:77
wxString GetExposureTime(const HuginBase::SrcPanoImage *img)
returns formatted exposure time
Definition: LensTools.cpp:554
std::map< std::string, Variable > VariableMap
structure to name of lens projections and their ids
Definition: LensTools.h:42
include file for the hugin project
Convenience functions for SrcPanoImage to use on the image variables.
wxString GetExifDateTime(const HuginBase::SrcPanoImage *img)
returns Exif DateTimeOriginal as formatted wxString
Definition: LensTools.cpp:503
void SelectListValue(wxControlWithItems *list, size_t newValue)
Selects the given value (stored in the client data) in the given list item.
Definition: LensTools.cpp:89
#define DEBUG_DEBUG(msg)
Definition: utils.h:68
const SrcPanoImage & getImage(std::size_t nr) const
get a panorama image, counting starts with 0
Definition: Panorama.h:211
wxString GetFocalLength(const HuginBase::SrcPanoImage *img)
return focallength and focallength 35 mm as wxString
Definition: LensTools.cpp:519
double getCropFactor() const
get crop factor, d35mm/dreal
Definition: Lens.h:73
bool CheckLensStacks(HuginBase::Panorama *pano, bool allowCancel)
check, if lens and stacks are correctly linked shows message box with short information if not ...
Definition: LensTools.cpp:446
static uint16_t flags
HuginBase::BaseSrcPanoImage::Projection id
Definition: LensTools.h:45
All variables of a source image.
Definition: SrcPanoImage.h:194
wxString GetAperture(const HuginBase::SrcPanoImage *img)
returns formatted aperture value
Definition: LensTools.cpp:540
void FillLensProjectionList(wxControlWithItems *list)
Fills a wxControlWithItem with all input projection formats, the client data contains the associated ...
Definition: LensTools.cpp:35
bool LoadLensParametersChoose(wxWindow *parent, HuginBase::Lens &lens, bool &cropped, bool &autoCenterCrop, vigra::Rect2D &cropRect)
load lens parameters from lens ini file
Definition: LensTools.cpp:290
This file specifies what image variables SrcPanoImg should have.
wxString getProjectionString(const HuginBase::SrcPanoImage &img)
Returns translated projection for given image.
Definition: LensTools.cpp:107
void FillBlenderList(wxControlWithItems *list)
Fills a wxControlWithItem with all possible blender options, the client data contains the associated ...
Definition: LensTools.cpp:81
wxString GetIso(const HuginBase::SrcPanoImage *img)
returns formatted iso value
Definition: LensTools.cpp:591
Lens getLensForImage(std::size_t imgNr)
Get the lens object for a specific image, also not for new code.