HuginBase::LensDB::LensDB Class Reference

main database class More...

#include <LensDB.h>

List of all members.

Public Member Functions

 LensDB ()
 constructor
virtual ~LensDB ()
 destructor
bool GetCropFactor (const std::string &maker, const std::string &model, double &cropFactor) const
 returns the crop factor for the given camera (maker/model)
bool GetProjection (const std::string &lens, BaseSrcPanoImage::Projection &projection) const
 returns the projection of the lens
bool GetCrop (const std::string &lens, const double focal, const vigra::Size2D &imageSize, vigra::Rect2D &cropRect) const
 returns the crop of the lens the information for landscape and portrait images are stored separately
bool GetFov (const std::string &lens, const double focal, double &fov) const
 returns the field of view of the lens the fov is always returned for a landscape image with aspect ratio 3:2
bool GetDistortion (const std::string &lens, const double focal, std::vector< double > &distortion) const
 returns the distortion parameters of the lens
bool GetVignetting (const std::string &lens, const double focal, const double aperture, const double distance, std::vector< double > &vignetting) const
 returns the vignetting parameters of the lens
bool GetTCA (const std::string &lens, const double focal, std::vector< double > &tca_red, std::vector< double > &tca_blue) const
 returns the tca distortion parameters of the lens
bool GetLensNames (const bool distortion, const bool vignetting, const bool tca, LensList &lensList) const
 return a vector of lenses with selected database entries
bool CleanUpDatabase ()
 compress database by remove all entries and insert instead the average values
bool RemoveLens (const std::string &lensname)
 remove all database entry which refers to given lens
bool RemoveCamera (const std::string &maker, const std::string &model)
 remove all database entry which refers to given camera
bool SaveCameraCrop (const std::string &maker, const std::string &model, const double cropfactor)
 save the camera with the given cropfactor into the database
bool SaveEMoR (const std::string &maker, const std::string &model, const int iso, const std::vector< float > &emor, const int weight=10)
 save the camera with the given EMoR parameters into the database
bool SaveLensProjection (const std::string &lens, const BaseSrcPanoImage::Projection projection)
 saves the projection for the lens in the database
bool SaveLensCrop (const std::string &lens, const double focal, const vigra::Size2D &imageSize, const vigra::Rect2D &cropRect)
 saves the crop information of the lens in the database the information for landscape and portrait images are stored separately
bool SaveLensFov (const std::string &lens, const double focal, const double fov, const int weight=10)
 saves the field of view of the lens the fov should always calculated for a landscape image with aspect ratio 3:2
bool SaveDistortion (const std::string &lens, const double focal, const std::vector< double > &distortion, const int weight=10)
 saves the distortion parameters of the lens in the database
bool SaveVignetting (const std::string &lens, const double focal, const double aperture, const double distance, const std::vector< double > &vignetting, const int weight=10)
 saves the vignetting parameters of the lens
bool SaveTCA (const std::string &lens, const double focal, const std::vector< double > &tca_red, const std::vector< double > &tca_blue, const int weight=10)
 saves the tca distortion parameters of the lens
std::string GetDBFilename () const
 returns the filename of the lens database
bool ExportToFile (const std::string &filename)
 export database to file
bool ImportFromFile (const std::string &filename)
 import data from external file

Static Public Member Functions

static LensDBGetSingleton ()
 returns the static LensDB instance
static void Clean ()
 cleanup the static LensDB instance, must be called at the end of the program

Private Member Functions

 LensDB (const LensDB &)
LensDBoperator= (const LensDB &)

Private Attributes

Databasem_db

Static Private Attributes

static LensDBm_instance = NULL

Classes

class  Database


Detailed Description

main database class

Definition at line 44 of file LensDB.h.


Constructor & Destructor Documentation

HuginBase::LensDB::LensDB::LensDB (  ) 

constructor

Definition at line 1972 of file LensDB.cpp.

References hugin_utils::GetUserAppDataDir(), and m_db.

Referenced by GetSingleton().

HuginBase::LensDB::LensDB::~LensDB (  )  [virtual]

destructor

Definition at line 1995 of file LensDB.cpp.

References m_db.

HuginBase::LensDB::LensDB::LensDB ( const LensDB  )  [private]


Member Function Documentation

void HuginBase::LensDB::LensDB::Clean (  )  [static]

cleanup the static LensDB instance, must be called at the end of the program

Definition at line 2010 of file LensDB.cpp.

References m_instance.

Referenced by main(), PTBatcherGUI::OnExit(), print_result(), and huginApp::~huginApp().

bool HuginBase::LensDB::LensDB::CleanUpDatabase (  ) 

compress database by remove all entries and insert instead the average values

Returns:
true, if cleanup was successful

Definition at line 2508 of file LensDB.cpp.

References HuginBase::LensDB::LensDB::Database::CleanUp(), and m_db.

bool HuginBase::LensDB::LensDB::ExportToFile ( const std::string filename  ) 

export database to file

Definition at line 2535 of file LensDB.cpp.

References HuginBase::LensDB::LensDB::Database::ExportToFile(), and m_db.

bool HuginBase::LensDB::LensDB::GetCrop ( const std::string lens,
const double  focal,
const vigra::Size2D &  imageSize,
vigra::Rect2D &  cropRect 
) const

returns the crop of the lens the information for landscape and portrait images are stored separately

Parameters:
lens name of the lens, or for compact camera Maker|Model
focal focal length, for which the crop should be returned
imageSize size of the image for which the crop information is wanted
cropRect contains the crop information
Returns:
true, if the database has stored information about the lens crop

Definition at line 2073 of file LensDB.cpp.

References HuginBase::LensDB::LensDB::Database::GetLensCrop(), HuginBase::LensDB::InterpolateValue(), HuginBase::LensDB::IsFocallengthNearRange(), m_db, and hugin_utils::roundi().

bool HuginBase::LensDB::LensDB::GetCropFactor ( const std::string maker,
const std::string model,
double &  cropFactor 
) const

returns the crop factor for the given camera (maker/model)

Parameters:
maker maker of the desired camera
model camera model
cropFactor contains the crop factor
Returns:
true, if the crop factor could be obtained from the database, otherwise false

Definition at line 2031 of file LensDB.cpp.

References HuginBase::LensDB::LensDB::Database::GetCropFactor(), and m_db.

std::string HuginBase::LensDB::LensDB::GetDBFilename (  )  const

returns the filename of the lens database

Definition at line 2019 of file LensDB.cpp.

References HuginBase::LensDB::LensDB::Database::GetDBFilename(), and m_db.

Referenced by AboutDialog::GetSystemInformation().

bool HuginBase::LensDB::LensDB::GetDistortion ( const std::string lens,
const double  focal,
std::vector< double > &  distortion 
) const

returns the distortion parameters of the lens

Parameters:
lens name of the lens, or for compact camera Maker|Model
focal focal length, for which the distortion parameters should be returned
distortion stored the returned distortion parameters
Returns:
true, if the database has stored information about the distortion

Definition at line 2162 of file LensDB.cpp.

References cout, HuginBase::LensDB::LensDB::Database::GetDistortionData(), HuginBase::LensDB::InterpolateValue(), HuginBase::LensDB::IsFocallengthNearRange(), and m_db.

bool HuginBase::LensDB::LensDB::GetFov ( const std::string lens,
const double  focal,
double &  fov 
) const

returns the field of view of the lens the fov is always returned for a landscape image with aspect ratio 3:2

Parameters:
lens name of the lens, or for compact camera Maker|Model
focal focal length, for which the fov should be returned
fov stored the returned field of view
Returns:
true, if the database has stored information about the field of view

Definition at line 2119 of file LensDB.cpp.

References HuginBase::LensDB::LensDB::Database::GetHFOV(), HFOV, HuginBase::LensDB::InterpolateValue(), HuginBase::LensDB::IsFocallengthNearRange(), and m_db.

bool HuginBase::LensDB::LensDB::GetLensNames ( const bool  distortion,
const bool  vignetting,
const bool  tca,
LensList lensList 
) const

return a vector of lenses with selected database entries

Parameters:
distortion vector contains lenses with distortion data
vignetting vector contains lenses with vignetting data
tca vector contains lenses with tca data
lensList vector containing the lens names
Returns:
true, if lenses were found

Definition at line 2419 of file LensDB.cpp.

References HuginBase::LensDB::LensDB::Database::GetLensNames(), and m_db.

bool HuginBase::LensDB::LensDB::GetProjection ( const std::string lens,
BaseSrcPanoImage::Projection projection 
) const

returns the projection of the lens

Parameters:
lens name of the lens, or for compact camera Maker|Model
projection contains the projection of the lens
Returns:
true, if the database has stored information about the lens projection

Definition at line 2040 of file LensDB.cpp.

References HuginBase::LensDB::LensDB::Database::GetLensProjection(), and m_db.

LensDB & HuginBase::LensDB::LensDB::GetSingleton (  )  [static]

returns the static LensDB instance

Definition at line 2001 of file LensDB.cpp.

References LensDB(), and m_instance.

Referenced by ApplyLensDBParameters(), LoadLensDBDialog::FillLensList(), AboutDialog::GetSystemInformation(), main(), print_result(), and SaveLensParameters().

bool HuginBase::LensDB::LensDB::GetTCA ( const std::string lens,
const double  focal,
std::vector< double > &  tca_red,
std::vector< double > &  tca_blue 
) const

returns the tca distortion parameters of the lens

Parameters:
lens name of the lens, or for compact camera Maker|Model
focal focal length, for which the distortion parameters should be returned
tca_red stored the returned tca distortion parameters for red channel
tca_blue stored the returned tca distortion parameters for blue channel
Returns:
true, if the database has stored information about the distortion

Definition at line 2366 of file LensDB.cpp.

References HuginBase::LensDB::LensDB::Database::GetTCAData(), HuginBase::LensDB::InterpolateValue(), HuginBase::LensDB::IsFocallengthNearRange(), and m_db.

Referenced by main().

bool HuginBase::LensDB::LensDB::GetVignetting ( const std::string lens,
const double  focal,
const double  aperture,
const double  distance,
std::vector< double > &  vignetting 
) const

returns the vignetting parameters of the lens

Parameters:
lens name of the lens, or for compact camera Maker|Model
focal focal length, for which the vignetting parameters should be returned
aperture aperture, for which the vignetting parameters should be returned
distance distance, for which the vignetting parameters should be returned (currently ignored)
vignetting stored the returned vignetting
Returns:
true, if the database has stored information about the vignetting

Definition at line 2205 of file LensDB.cpp.

References HuginBase::LensDB::LensDB::Database::GetVignettingData(), HuginBase::LensDB::InterpolateValue(), HuginBase::LensDB::InterpolateValueTriangle(), HuginBase::LensDB::IsFocallengthNearRange(), and m_db.

bool HuginBase::LensDB::LensDB::ImportFromFile ( const std::string filename  ) 

import data from external file

Definition at line 2544 of file LensDB.cpp.

References HuginBase::LensDB::LensDB::Database::ImportFromFile(), and m_db.

LensDB& HuginBase::LensDB::LensDB::operator= ( const LensDB  )  [private]

bool HuginBase::LensDB::LensDB::RemoveCamera ( const std::string maker,
const std::string model 
)

remove all database entry which refers to given camera

Returns:
true, if all was successful, false, if there were errors

Definition at line 2526 of file LensDB.cpp.

References m_db, and HuginBase::LensDB::LensDB::Database::RemoveCamera().

bool HuginBase::LensDB::LensDB::RemoveLens ( const std::string lensname  ) 

remove all database entry which refers to given lens

Returns:
true, if all was successful, false, if there were errors

Definition at line 2517 of file LensDB.cpp.

References m_db, and HuginBase::LensDB::LensDB::Database::RemoveLens().

bool HuginBase::LensDB::LensDB::SaveCameraCrop ( const std::string maker,
const std::string model,
const double  cropfactor 
)

save the camera with the given cropfactor into the database

Parameters:
maker camera maker to save
model camera model to save
cropfactor crop factor for given camera
Returns:
true, if saving was successful

Definition at line 2429 of file LensDB.cpp.

References m_db, and HuginBase::LensDB::LensDB::Database::SaveCropFactor().

Referenced by HuginBase::LensDB::SaveLensDataFromPano(), and SaveLensParameters().

bool HuginBase::LensDB::LensDB::SaveDistortion ( const std::string lens,
const double  focal,
const std::vector< double > &  distortion,
const int  weight = 10 
)

saves the distortion parameters of the lens in the database

Parameters:
lens name of the lens, or for compact camera Maker|Model
focal focal length, for which the distortion parameters should be saved
distortion distortion parameters which should be stored in database
weight weight factor for given values (0-100, default is 10)
Returns:
true, if saving was successful

Definition at line 2481 of file LensDB.cpp.

References m_db, and HuginBase::LensDB::LensDB::Database::SaveDistortion().

Referenced by HuginBase::LensDB::SaveLensDataFromPano(), and SaveLensParameters().

bool HuginBase::LensDB::LensDB::SaveEMoR ( const std::string maker,
const std::string model,
const int  iso,
const std::vector< float > &  emor,
const int  weight = 10 
)

save the camera with the given EMoR parameters into the database

Parameters:
maker camera maker to save
model camera model to save
ISO ISO settings for which the EMoR parameters applies
emor EMoR parameters to save
weight weight factor for given values (0-100, default is 10)
Returns:
true, if saving was successful

Definition at line 2438 of file LensDB.cpp.

References m_db, and HuginBase::LensDB::LensDB::Database::SaveEMoR().

Referenced by HuginBase::LensDB::SaveLensDataFromPano().

bool HuginBase::LensDB::LensDB::SaveLensCrop ( const std::string lens,
const double  focal,
const vigra::Size2D &  imageSize,
const vigra::Rect2D &  cropRect 
)

saves the crop information of the lens in the database the information for landscape and portrait images are stored separately

Parameters:
lens name of the lens, or for compact camera Maker|Model
focal focal length, for which the crop should be saved
imageSize size of the image for which the crop information is saved
cropRect contains the crop information which should be saved
Returns:
true, if saving was successful

Definition at line 2456 of file LensDB.cpp.

References m_db, HuginBase::LensDB::LensDB::Database::RemoveLensCrop(), and HuginBase::LensDB::LensDB::Database::SaveLensCrop().

Referenced by HuginBase::LensDB::SaveLensDataFromPano().

bool HuginBase::LensDB::LensDB::SaveLensFov ( const std::string lens,
const double  focal,
const double  fov,
const int  weight = 10 
)

saves the field of view of the lens the fov should always calculated for a landscape image with aspect ratio 3:2

Parameters:
lens name of the lens, or for compact camera Maker|Model
focal focal length, for which the fov should be saved
fov field of view for storing
weight weight factor for given values (0-100, default is 10)
Returns:
true, if saving was successful

Definition at line 2472 of file LensDB.cpp.

References m_db, and HuginBase::LensDB::LensDB::Database::SaveHFOV().

Referenced by HuginBase::LensDB::SaveLensDataFromPano(), and SaveLensParameters().

bool HuginBase::LensDB::LensDB::SaveLensProjection ( const std::string lens,
const BaseSrcPanoImage::Projection  projection 
)

saves the projection for the lens in the database

Parameters:
lens name of the lens, or for compact camera Maker|Model
projection projection of the lens
Returns:
true, if saving was successful

Definition at line 2447 of file LensDB.cpp.

References m_db, and HuginBase::LensDB::LensDB::Database::SaveLensProjection().

Referenced by HuginBase::LensDB::SaveLensDataFromPano().

bool HuginBase::LensDB::LensDB::SaveTCA ( const std::string lens,
const double  focal,
const std::vector< double > &  tca_red,
const std::vector< double > &  tca_blue,
const int  weight = 10 
)

saves the tca distortion parameters of the lens

Parameters:
lens name of the lens, or for compact camera Maker|Model
focal focal length, for which the distortion parameters should be saved
tca_red tca distortion parameters for red channel
tca_blue tca distortion parameters for blue channel
weight weight factor for given values (0-100, default is 10)
Returns:
true, if saving was successful

Definition at line 2499 of file LensDB.cpp.

References m_db, and HuginBase::LensDB::LensDB::Database::SaveTCAData().

Referenced by print_result().

bool HuginBase::LensDB::LensDB::SaveVignetting ( const std::string lens,
const double  focal,
const double  aperture,
const double  distance,
const std::vector< double > &  vignetting,
const int  weight = 10 
)

saves the vignetting parameters of the lens

Parameters:
lens name of the lens, or for compact camera Maker|Model
focal focal length, for which the vignetting parameters should be saved
aperture aperture, for which the vignetting parameters should be saved
distance distance, for which the vignetting parameters should be saved
vignetting vignetting parameters which should be stored
weight weight factor for given values (0-100, default is 10)
Returns:
true, if saving was successful

Definition at line 2490 of file LensDB.cpp.

References m_db, and HuginBase::LensDB::LensDB::Database::SaveVignetting().

Referenced by HuginBase::LensDB::SaveLensDataFromPano(), and SaveLensParameters().


Member Data Documentation

Database* HuginBase::LensDB::LensDB::m_db [private]

Definition at line 193 of file LensDB.h.

Referenced by CleanUpDatabase(), ExportToFile(), GetCrop(), GetCropFactor(), GetDBFilename(), GetDistortion(), GetFov(), GetLensNames(), GetProjection(), GetTCA(), GetVignetting(), ImportFromFile(), LensDB(), RemoveCamera(), RemoveLens(), SaveCameraCrop(), SaveDistortion(), SaveEMoR(), SaveLensCrop(), SaveLensFov(), SaveLensProjection(), SaveTCA(), SaveVignetting(), and ~LensDB().

LensDB * HuginBase::LensDB::LensDB::m_instance = NULL [static, private]

Definition at line 195 of file LensDB.h.

Referenced by Clean(), and GetSingleton().


The documentation for this class was generated from the following files:
Generated on 30 Jul 2015 for Hugintrunk by  doxygen 1.4.7