MVE - Multi-View Environment mve-devel
Loading...
Searching...
No Matches
camera_database.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2015, Simon Fuhrmann
3 * TU Darmstadt - Graphics, Capture and Massively Parallel Computing
4 * All rights reserved.
5 *
6 * This software may be modified and distributed under the terms
7 * of the BSD 3-Clause license. See the LICENSE.txt file for details.
8 */
9
10#ifndef SFM_CAMERA_DATABASE_HEADER
11#define SFM_CAMERA_DATABASE_HEADER
12
13#include <vector>
14#include <string>
15
16#include "sfm/defines.h"
17
19
24{
26 std::string maker;
28 std::string model;
37};
38
39/* ---------------------------------------------------------------- */
40
47{
48public:
50 static CameraDatabase* get (void);
51
53 CameraModel const* lookup (std::string const& maker,
54 std::string const& model) const;
55
56private:
57 CameraDatabase (void);
58 void add (std::string const& maker, std::string const& model,
59 float sensor_width_mm, float sensor_height_mm,
60 int sensor_width_px, int sensor_height_px);
61
62private:
63 static CameraDatabase* instance;
64 std::vector<CameraModel> data;
65};
66
67/* ------------------------ Implementation ------------------------ */
68
69inline CameraDatabase*
70CameraDatabase::get (void)
71{
72 if (CameraDatabase::instance == nullptr)
73 CameraDatabase::instance = new CameraDatabase();
74 return CameraDatabase::instance;
75}
76
78
79#endif /* SFM_CAMERA_DATABASE_HEADER */
Camera database which, given a maker and model string, will look for a camera model in the database a...
#define SFM_NAMESPACE_END
Definition defines.h:14
#define SFM_NAMESPACE_BEGIN
Definition defines.h:13
Representation of a digital camera.
float sensor_height_mm
The height of the sensor in milli meters.
float sensor_width_mm
The width of the sensor in milli meters.
int sensor_width_px
The width of the sensor in pixels.
std::string model
The model of the camera.
int sensor_height_px
The height of the sensor in pixels.
std::string maker
The manufacturer for the camera.