Hugintrunk  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
HuginBase::LensDB::LensDB::Database Class Reference

Classes

struct  CropData
 
struct  Distortiondata
 
struct  HFOVData
 
struct  TCAdata
 
struct  Vignettingdata
 

Public Member Functions

 Database (const std::string &filename)
 
 ~Database ()
 
bool CreateTables ()
 
int GetDBVersion () const
 
std::string GetDBFilename () const
 
bool GetCropFactor (const std::string &maker, const std::string &model, double &cropFactor) const
 
bool SaveCropFactor (const std::string &maker, const std::string &model, const double cropFactor)
 
bool GetLensProjection (const std::string &lens, int &projection) const
 
bool SaveLensProjection (const std::string &lens, const int projection)
 
bool GetHFOV (const std::string &lens, const double focallength, std::vector< HFOVData > &hfovData) const
 
bool SaveHFOV (const std::string &lens, const double focallength, const double HFOV, const int weight=10)
 
bool GetLensCrop (const std::string &lens, const double focal, const int width, const int height, std::vector< CropData > &cropData) const
 
bool SaveLensCrop (const std::string &lens, const double focal, const int width, const int height, const int left, const int right, const int top, const int bottom)
 
bool RemoveLensCrop (const std::string &lens, const double focal, const int width, const int height)
 
bool GetDistortionData (const std::string &lens, const double focallength, std::vector< Distortiondata > &distData) const
 
bool SaveDistortion (const std::string &lens, const double focallength, const double a, const double b, const double c, const int weight=10)
 
bool GetVignettingData (const std::string &lens, const double focallength, const double aperture, std::vector< Vignettingdata > &vigData) const
 
bool SaveVignetting (const std::string &lens, const double focallength, const double aperture, const double distance, const double Vb, const double Vc, const double Vd, const int weight=10)
 
bool GetTCAData (const std::string &lens, const double focallength, std::vector< TCAdata > &tcaData) const
 
bool SaveTCAData (const std::string &lens, const double focallength, const double ra, const double rb, const double rc, const double rd, const double ba, const double bb, const double bc, const double bd, const int weight=10)
 
bool SaveEMoR (const std::string &maker, const std::string &model, const int iso, const double Ra, const double Rb, const double Rc, const double Rd, const double Re, const int weight=10)
 
bool GetLensNames (const bool distortion, const bool vignetting, const bool tca, LensList &lensList) const
 
bool CleanUp ()
 
bool RemoveLens (const std::string &lensname)
 
bool RemoveCamera (const std::string &maker, const std::string &model)
 
bool ExportToFile (const std::string &filename)
 
bool ImportFromFile (const std::string &filename)
 

Private Member Functions

void BeginTransaction ()
 
void EndTransaction ()
 
bool RemoveLensFromTable (const std::string &table, const std::string &lens)
 
bool RemoveCameraFromTable (const std::string &table, const std::string &maker, const std::string &model)
 
void OutputSQLToStream (const std::string &sqlstatement, std::ostream &stream)
 
bool ImportCropFactor (std::istream &input)
 
bool ImportProjection (std::istream &input)
 
bool ImportHFOV (std::istream &input)
 
bool ImportLensCrop (std::istream &input)
 
bool ImportDistortion (std::istream &input)
 
bool ImportVignetting (std::istream &input)
 
bool ImportTCA (std::istream &input)
 
bool ImportEMOR (std::istream &input)
 

Private Attributes

std::string m_filename
 
sqlite3 * m_db
 
bool m_runningTransaction
 

Detailed Description

Definition at line 44 of file LensDB.cpp.

Constructor & Destructor Documentation

HuginBase::LensDB::LensDB::Database::Database ( const std::string &  filename)
inlineexplicit

Definition at line 77 of file LensDB.cpp.

References CreateTables(), hugin_utils::FileExists(), m_db, and m_filename.

HuginBase::LensDB::LensDB::Database::~Database ( )
inline

Definition at line 105 of file LensDB.cpp.

References EndTransaction(), m_db, and m_runningTransaction.

Member Function Documentation

void HuginBase::LensDB::LensDB::Database::BeginTransaction ( )
inlineprivate
bool HuginBase::LensDB::LensDB::Database::CleanUp ( )
inline
bool HuginBase::LensDB::LensDB::Database::CreateTables ( )
inline

Definition at line 117 of file LensDB.cpp.

References m_db.

Referenced by Database().

void HuginBase::LensDB::LensDB::Database::EndTransaction ( )
inlineprivate
bool HuginBase::LensDB::LensDB::Database::ExportToFile ( const std::string &  filename)
inline

Definition at line 789 of file LensDB.cpp.

References CleanUp(), m_db, and OutputSQLToStream().

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

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

Definition at line 182 of file LensDB.cpp.

References m_db.

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

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

Definition at line 176 of file LensDB.cpp.

References m_filename.

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

int HuginBase::LensDB::LensDB::Database::GetDBVersion ( ) const
inline

Definition at line 156 of file LensDB.cpp.

References m_db.

bool HuginBase::LensDB::LensDB::Database::GetDistortionData ( const std::string &  lens,
const double  focallength,
std::vector< Distortiondata > &  distData 
) const
inline
bool HuginBase::LensDB::LensDB::Database::GetHFOV ( const std::string &  lens,
const double  focallength,
std::vector< HFOVData > &  hfovData 
) const
inline
bool HuginBase::LensDB::LensDB::Database::GetLensCrop ( const std::string &  lens,
const double  focal,
const int  width,
const int  height,
std::vector< CropData > &  cropData 
) const
inline
bool HuginBase::LensDB::LensDB::Database::GetLensNames ( const bool  distortion,
const bool  vignetting,
const bool  tca,
LensList lensList 
) const
inline

Definition at line 676 of file LensDB.cpp.

References m_db.

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

bool HuginBase::LensDB::LensDB::Database::GetLensProjection ( const std::string &  lens,
int &  projection 
) const
inline

Definition at line 248 of file LensDB.cpp.

References m_db.

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

bool HuginBase::LensDB::LensDB::Database::GetTCAData ( const std::string &  lens,
const double  focallength,
std::vector< TCAdata > &  tcaData 
) const
inline
bool HuginBase::LensDB::LensDB::Database::GetVignettingData ( const std::string &  lens,
const double  focallength,
const double  aperture,
std::vector< Vignettingdata > &  vigData 
) const
inline
bool HuginBase::LensDB::LensDB::Database::ImportCropFactor ( std::istream &  input)
inlineprivate

Definition at line 1075 of file LensDB.cpp.

References SaveCropFactor(), hugin_utils::SplitString(), and hugin_utils::stringToDouble().

Referenced by ImportFromFile().

bool HuginBase::LensDB::LensDB::Database::ImportDistortion ( std::istream &  input)
inlineprivate
bool HuginBase::LensDB::LensDB::Database::ImportEMOR ( std::istream &  input)
inlineprivate
bool HuginBase::LensDB::LensDB::Database::ImportFromFile ( const std::string &  filename)
inline
bool HuginBase::LensDB::LensDB::Database::ImportHFOV ( std::istream &  input)
inlineprivate
bool HuginBase::LensDB::LensDB::Database::ImportLensCrop ( std::istream &  input)
inlineprivate
bool HuginBase::LensDB::LensDB::Database::ImportProjection ( std::istream &  input)
inlineprivate

Definition at line 1144 of file LensDB.cpp.

References SaveLensProjection(), hugin_utils::SplitString(), and hugin_utils::stringToInt().

Referenced by ImportFromFile().

bool HuginBase::LensDB::LensDB::Database::ImportTCA ( std::istream &  input)
inlineprivate
bool HuginBase::LensDB::LensDB::Database::ImportVignetting ( std::istream &  input)
inlineprivate
void HuginBase::LensDB::LensDB::Database::OutputSQLToStream ( const std::string &  sqlstatement,
std::ostream &  stream 
)
inlineprivate

Definition at line 1049 of file LensDB.cpp.

References m_db.

Referenced by ExportToFile().

bool HuginBase::LensDB::LensDB::Database::RemoveCamera ( const std::string &  maker,
const std::string &  model 
)
inline
bool HuginBase::LensDB::LensDB::Database::RemoveCameraFromTable ( const std::string &  table,
const std::string &  maker,
const std::string &  model 
)
inlineprivate

Definition at line 1031 of file LensDB.cpp.

References m_db.

Referenced by RemoveCamera().

bool HuginBase::LensDB::LensDB::Database::RemoveLens ( const std::string &  lensname)
inline
bool HuginBase::LensDB::LensDB::Database::RemoveLensCrop ( const std::string &  lens,
const double  focal,
const int  width,
const int  height 
)
inline

Definition at line 430 of file LensDB.cpp.

References EndTransaction(), and m_db.

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

bool HuginBase::LensDB::LensDB::Database::RemoveLensFromTable ( const std::string &  table,
const std::string &  lens 
)
inlineprivate

Definition at line 1014 of file LensDB.cpp.

References m_db.

Referenced by RemoveLens().

bool HuginBase::LensDB::LensDB::Database::SaveCropFactor ( const std::string &  maker,
const std::string &  model,
const double  cropFactor 
)
inline
bool HuginBase::LensDB::LensDB::Database::SaveDistortion ( const std::string &  lens,
const double  focallength,
const double  a,
const double  b,
const double  c,
const int  weight = 10 
)
inline

Definition at line 483 of file LensDB.cpp.

References m_db.

Referenced by ImportDistortion(), and HuginBase::LensDB::LensDB::SaveDistortion().

bool HuginBase::LensDB::LensDB::Database::SaveEMoR ( const std::string &  maker,
const std::string &  model,
const int  iso,
const double  Ra,
const double  Rb,
const double  Rc,
const double  Rd,
const double  Re,
const int  weight = 10 
)
inline

Definition at line 650 of file LensDB.cpp.

References m_db.

Referenced by ImportEMOR(), and HuginBase::LensDB::LensDB::SaveEMoR().

bool HuginBase::LensDB::LensDB::Database::SaveHFOV ( const std::string &  lens,
const double  focallength,
const double  HFOV,
const int  weight = 10 
)
inline

Definition at line 329 of file LensDB.cpp.

References m_db.

Referenced by ImportHFOV(), and HuginBase::LensDB::LensDB::SaveLensFov().

bool HuginBase::LensDB::LensDB::Database::SaveLensCrop ( const std::string &  lens,
const double  focal,
const int  width,
const int  height,
const int  left,
const int  right,
const int  top,
const int  bottom 
)
inline

Definition at line 387 of file LensDB.cpp.

References BeginTransaction(), EndTransaction(), and m_db.

Referenced by ImportLensCrop(), and HuginBase::LensDB::LensDB::SaveLensCrop().

bool HuginBase::LensDB::LensDB::Database::SaveLensProjection ( const std::string &  lens,
const int  projection 
)
inline
bool HuginBase::LensDB::LensDB::Database::SaveTCAData ( const std::string &  lens,
const double  focallength,
const double  ra,
const double  rb,
const double  rc,
const double  rd,
const double  ba,
const double  bb,
const double  bc,
const double  bd,
const int  weight = 10 
)
inline

Definition at line 620 of file LensDB.cpp.

References m_db.

Referenced by ImportTCA(), and HuginBase::LensDB::LensDB::SaveTCA().

bool HuginBase::LensDB::LensDB::Database::SaveVignetting ( const std::string &  lens,
const double  focallength,
const double  aperture,
const double  distance,
const double  Vb,
const double  Vc,
const double  Vd,
const int  weight = 10 
)
inline

Definition at line 560 of file LensDB.cpp.

References m_db.

Referenced by ImportVignetting(), and HuginBase::LensDB::LensDB::SaveVignetting().

Member Data Documentation

sqlite3* HuginBase::LensDB::LensDB::Database::m_db
private
std::string HuginBase::LensDB::LensDB::Database::m_filename
private

Definition at line 1941 of file LensDB.cpp.

Referenced by Database(), and GetDBFilename().

bool HuginBase::LensDB::LensDB::Database::m_runningTransaction
private

Definition at line 1945 of file LensDB.cpp.

Referenced by BeginTransaction(), EndTransaction(), and ~Database().


The documentation for this class was generated from the following file: