Hugintrunk  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Namespaces | Functions
LensTools.cpp File Reference

some helper classes for working with lenses More...

#include "panoinc_WX.h"
#include <wx/msgdlg.h>
#include "panoinc.h"
#include "LensTools.h"
#include <algorithm>
#include "panodata/ImageVariableTranslate.h"
#include "panodata/StandardImageVariableGroups.h"
#include "base_wx/PanoCommand.h"
#include "panodata/image_variables.h"
Include dependency graph for LensTools.cpp:

Go to the source code of this file.

Namespaces

 FormatString
 

Functions

void FillLensProjectionList (wxControlWithItems *list)
 Fills a wxControlWithItem with all input projection formats, the client data contains the associated projection number. More...
 
WXIMPEX
HuginLensTools::LensInfoVector 
GetLensProjectionList ()
 return a vector with all available projections More...
 
void FillBlenderList (wxControlWithItems *list)
 Fills a wxControlWithItem with all possible blender options, the client data contains the associated blender mod from PanoramaOptions. More...
 
void SelectListValue (wxControlWithItems *list, size_t newValue)
 Selects the given value (stored in the client data) in the given list item. More...
 
size_t GetSelectedValue (wxControlWithItems *list)
 Returns the client value of the selected item from list. More...
 
wxString getProjectionString (const HuginBase::SrcPanoImage &img)
 Returns translated projection for given image. More...
 
wxString getResponseString (const HuginBase::SrcPanoImage &img)
 Returns translated response type for given SrcPanoImage. More...
 
void SaveLensParameters (const wxString filename, HuginBase::Panorama *pano, unsigned int imgNr)
 save the lens parameters of the image to a lens file named filename More...
 
bool LoadLensParametersChoose (wxWindow *parent, HuginBase::Lens &lens, bool &cropped, bool &autoCenterCrop, vigra::Rect2D &cropRect)
 load lens parameters from lens ini file More...
 
void SaveLensParametersToIni (wxWindow *parent, HuginBase::Panorama *pano, const HuginBase::UIntSet images)
 saves the lens parameters to ini files, provides all necessary dialogs More...
 
bool CheckLensStacks (HuginBase::Panorama *pano, bool allowCancel)
 check, if lens and stacks are correctly linked shows message box with short information if not More...
 
wxString FormatString::GetExifDateTime (const HuginBase::SrcPanoImage *img)
 returns Exif DateTimeOriginal as formatted wxString More...
 
wxString FormatString::GetFocalLength (const HuginBase::SrcPanoImage *img)
 return focallength and focallength 35 mm as wxString More...
 
wxString FormatString::GetAperture (const HuginBase::SrcPanoImage *img)
 returns formatted aperture value More...
 
wxString FormatString::GetExposureTime (const HuginBase::SrcPanoImage *img)
 returns formatted exposure time More...
 
wxString FormatString::GetIso (const HuginBase::SrcPanoImage *img)
 returns formatted iso value More...
 

Detailed Description

some helper classes for working with lenses

Author
T. Modes

Definition in file LensTools.cpp.

Function Documentation

bool CheckLensStacks ( HuginBase::Panorama pano,
bool  allowCancel 
)

check, if lens and stacks are correctly linked shows message box with short information if not

Parameters
panoPanorama which should be checked
allowCancelif true the message box contains also a Cancel button, if false there is only ok button
Returns
true, if all conditions are satisfied, false if user selected cancel in dialog box

Definition at line 446 of file LensTools.cpp.

References flags, HuginBase::Panorama::getImage(), and HuginBase::Panorama::getNrOfImages().

Referenced by OptimizePanel::OnOptimizeButton(), and PanoCommand::wxLoadPTProjectCmd::processPanorama().

void FillBlenderList ( wxControlWithItems *  list)

Fills a wxControlWithItem with all possible blender options, the client data contains the associated blender mod from PanoramaOptions.

Definition at line 81 of file LensTools.cpp.

References HuginBase::PanoramaOptions::ENBLEND_BLEND, and HuginBase::PanoramaOptions::INTERNAL_BLEND.

Referenced by PanoPanel::Create(), FindPanoDialog::FindPanoDialog(), and PreferencesDialog::PreferencesDialog().

void FillLensProjectionList ( wxControlWithItems *  list)

Fills a wxControlWithItem with all input projection formats, the client data contains the associated projection number.

Definition at line 35 of file LensTools.cpp.

References GetLensProjectionList().

Referenced by ImagesPanel::Create(), HFOVDialog::HFOVDialog(), and LensCalFrame::LensCalFrame().

WXIMPEX HuginLensTools::LensInfoVector GetLensProjectionList ( )
wxString getProjectionString ( const HuginBase::SrcPanoImage img)
wxString getResponseString ( const HuginBase::SrcPanoImage img)
size_t GetSelectedValue ( wxControlWithItems *  list)
bool LoadLensParametersChoose ( wxWindow *  parent,
HuginBase::Lens lens,
bool &  cropped,
bool &  autoCenterCrop,
vigra::Rect2D &  cropRect 
)

load lens parameters from lens ini file

Parameters
parentparent window, for showing messageboxes
lenslens, for reading projection and lensparameters
croppedread if cropped enabled
autoCenterCropread if automatic center crop
cropRectread crop rect
Returns
true if lens parameters were sucessful read

Definition at line 290 of file LensTools.cpp.

References DEBUG_DEBUG, HuginBase::Lens::getImageSize(), vigra_ext::EMoR::h, map_get(), HuginBase::Lens::setCropFactor(), HuginBase::Lens::setProjection(), HuginBase::Lens::variableNames, and HuginBase::Lens::variables.

Referenced by HFOVDialog::OnLoadLensParameters().

void SaveLensParameters ( const wxString  filename,
HuginBase::Panorama pano,
unsigned int  imgNr 
)
void SaveLensParametersToIni ( wxWindow *  parent,
HuginBase::Panorama pano,
const HuginBase::UIntSet  images 
)

saves the lens parameters to ini files, provides all necessary dialogs

Definition at line 410 of file LensTools.cpp.

References SaveLensParameters().

Referenced by PanoOperation::SaveLensOperation::GetInternalCommand().

void SelectListValue ( wxControlWithItems *  list,
size_t  newValue 
)