Hugin trunk 0.1
Loading...
Searching...
No Matches
Classes | Namespaces | Typedefs | Functions
LensTools.h File Reference

some helper classes for graphes More...

#include <hugin_shared.h>
#include "panoinc_WX.h"
#include "panoinc.h"
#include "base_wx/Command.h"
Include dependency graph for LensTools.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  HuginLensTools::LensInfo
 structure to name of lens projections and their ids More...
 

Namespaces

namespace  HuginLensTools
 
namespace  FormatString
 

Typedefs

typedef std::vector< LensInfoHuginLensTools::LensInfoVector
 vector of LensInfo to hold all available lens types
 

Functions

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

Detailed Description

some helper classes for graphes

some helper classes for working with lenses

Author
T. Modes

Definition in file LensTools.h.

Function Documentation

◆ ApplyLensParameters()

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

Parameters
parentparent window for showing message boxes
panoPanorama in which the lens data should read
imagesimages for which the lens parameters should be set, check image sizes before running this function
commandpointer to PanoCommand::PanoCommand for insertion into command history
Returns
true if sucessful loaded lens parameters
Todo:
I think the sensor size should be copied over, but SrcPanoImage doesn't have such a variable yet.

Definition at line 206 of file LensTools.cpp.

References HuginBase::Lens::getCropFactor(), HuginBase::Panorama::getImageVariables(), HuginBase::ConstStandardImageVariableGroups::getLensVariables(), HuginBase::Lens::getProjection(), LoadLensParametersChoose(), HuginBase::BaseSrcPanoImage::NO_CROP, threshold(), and HuginBase::Lens::variables.

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

◆ CheckLensStacks()

WXIMPEX 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 447 of file LensTools.cpp.

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

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

◆ FillBlenderList()

WXIMPEX 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 82 of file LensTools.cpp.

References HuginBase::PanoramaOptions::ENBLEND_BLEND, HuginBase::PanoramaOptions::INTERNAL_BLEND, and threshold().

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

◆ FillLensProjectionList()

WXIMPEX void FillLensProjectionList ( wxControlWithItems list)

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

Definition at line 36 of file LensTools.cpp.

References GetLensProjectionList(), and threshold().

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

◆ GetLensProjectionList()

WXIMPEX HuginLensTools::LensInfoVector GetLensProjectionList ( )

◆ getProjectionString()

WXIMPEX wxString getProjectionString ( const HuginBase::SrcPanoImage img)

◆ getResponseString()

WXIMPEX wxString getResponseString ( const HuginBase::SrcPanoImage img)

◆ GetSelectedValue()

WXIMPEX size_t GetSelectedValue ( wxControlWithItems list)

◆ LoadLensParametersChoose()

WXIMPEX 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 291 of file LensTools.cpp.

References DEBUG_DEBUG, HuginBase::Lens::getImageSize(), hugin_utils::HuginMessageBox(), map_get(), HuginBase::Lens::setCropFactor(), HuginBase::Lens::setProjection(), threshold(), HuginBase::Lens::variableNames, and HuginBase::Lens::variables.

Referenced by ApplyLensParameters(), and HFOVDialog::OnLoadLensParameters().

◆ SaveLensParameters()

WXIMPEX void SaveLensParameters ( const wxString  filename,
HuginBase::Panorama pano,
unsigned int  imgNr 
)

◆ SaveLensParametersToIni()

WXIMPEX 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 412 of file LensTools.cpp.

References hugin_utils::AskUserOverwrite(), SaveLensParameters(), and threshold().

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

◆ SelectListValue()

WXIMPEX void SelectListValue ( wxControlWithItems list,
size_t  newValue 
)